linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] 9p: do not overwrite return code when locking fails
@ 2015-08-03  6:36 Dominique Martinet
  0 siblings, 0 replies; only message in thread
From: Dominique Martinet @ 2015-08-03  6:36 UTC (permalink / raw)
  To: v9fs-developer
  Cc: Eric Van Hensbergen, Ron Minnich, Latchesar Ionkov, linux-kernel,
	Al Viro, Kirill A. Shutemov, Andrew Morton, linux-fsdevel,
	Dominique Martinet

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>
---
 fs/9p/vfs_file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 1ef16bd..be641f1 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:
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-03  6:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-03  6:36 [PATCH RESEND] 9p: do not overwrite return code when locking fails Dominique Martinet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).