Commit b6478740 authored by Dominique Martinet's avatar Dominique Martinet Committed by Linus Torvalds

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: default avatarDominique Martinet <>
Cc: Eric Van Hensbergen <>
Cc: Ron Minnich <>
Cc: Latchesar Ionkov <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 720abae3
......@@ -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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment