[PATCH] nfsd4_lock() returns bogus values to clients

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Al Viro <[email protected]>
Date: 1135493243 -0500

missing nfserror() in default case of a switch by return value of
posix_lock_file(); as the result we send negative host-endian to
clients that expect positive network-endian, preferably mentioned
in RFC...  BTW, that case is not impossible - posix_lock_file()
can return -ENOLCK and we do not handle that one explicitly.

Signed-off-by: Al Viro <[email protected]>

---

 fs/nfsd/nfs4state.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

d91fdfa7ab75e45dd9dba36808d36fc2e1d5c634
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 71689b0..f32f68c 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2815,7 +2815,10 @@ nfsd4_lock(struct svc_rqst *rqstp, struc
 		goto conflicting_lock;
 	case (EDEADLK):
 		status = nfserr_deadlock;
+		dprintk("NFSD: nfsd4_lock: posix_lock_file() failed! status %d\n",status);
+		goto out_destroy_new_stateid;
 	default:        
+		status = nfserror(status);
 		dprintk("NFSD: nfsd4_lock: posix_lock_file() failed! status %d\n",status);
 		goto out_destroy_new_stateid;
 	}
-- 
0.99.9.GIT

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux