From: Dominique Martinet Date: Fri, 6 Nov 2015 02:44:21 +0000 (-0800) Subject: 9p: do not overwrite return code when locking fails X-Git-Tag: v4.4-rc1~99^2~148 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b64787401fd85b66403dd05159a749e333059c0a;p=platform%2Fkernel%2Flinux-exynos.git 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 Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 3abc447..6b74739 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: