From: Al Viro Date: Thu, 19 Jan 2006 01:43:48 +0000 (-0800) Subject: [PATCH] nfsd4_lock() returns bogus values to clients X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7fcd53303de8dbbed863f6471ca92eb96a1faa28;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [PATCH] nfsd4_lock() returns bogus values to clients missing nfserrno() 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 Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 856ed4fd662b..1143cfb64549 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2761,7 +2761,10 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock goto conflicting_lock; case (EDEADLK): status = nfserr_deadlock; + dprintk("NFSD: nfsd4_lock: posix_lock_file() failed! status %d\n",status); + goto out; default: + status = nfserrno(status); dprintk("NFSD: nfsd4_lock: posix_lock_file() failed! status %d\n",status); goto out; }