diff mbox

9p: do not overwrite return code when locking fails

Message ID 1437638007-1223-1-git-send-email-dominique.martinet@cea.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Dominique Martinet July 23, 2015, 7:53 a.m. UTC
If the remote locking fail, we run a local vfs unlock that should work
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 mbox

Patch

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: