summaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_file.c
diff options
context:
space:
mode:
authorDominique Martinet <dominique.martinet@cea.fr>2015-11-06 03:44:21 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-06 04:34:48 +0100
commitb64787401fd85b66403dd05159a749e333059c0a (patch)
treec2d662385ee821bc5d7cd4c4b88e2c1c06b55f76 /fs/9p/vfs_file.c
parentrcu: force alignment on struct callback_head/rcu_head (diff)
downloadlinux-b64787401fd85b66403dd05159a749e333059c0a.tar.xz
linux-b64787401fd85b66403dd05159a749e333059c0a.zip
9p: do not overwrite return code when locking fails
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/9p/vfs_file.c')
-rw-r--r--fs/9p/vfs_file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 3abc447783aa..6b747394f6f5 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -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: