]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
9p: do not overwrite return code when locking fails
authorDominique Martinet <dominique.martinet@cea.fr>
Wed, 21 Oct 2015 22:02:48 +0000 (09:02 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 Oct 2015 22:02:48 +0000 (09:02 +1100)
If the remote locking fail, we run a local vfs unlock that should work and
return success to userland when we didn't actually lock at all.  We need
to tell the application that tried to lock that it didn't get it, not that
all went well.

Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Ron Minnich <rminnich@sandia.gov>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/9p/vfs_file.c

index 3abc447783aa83cc7c5f57a57a52b9caa9063f94..6b747394f6f566dfbd7e2608d1690f88f81e4206 100644 (file)
@@ -231,7 +231,8 @@ out_unlock:
        if (res < 0 && fl->fl_type != F_UNLCK) {
                fl_type = fl->fl_type;
                fl->fl_type = F_UNLCK;
-               res = posix_lock_file_wait(filp, fl);
+               /* Even if this fails we want to return the remote error */
+               posix_lock_file_wait(filp, fl);
                fl->fl_type = fl_type;
        }
 out: