[PATCH] nfsd4_lock() returns bogus values to clients

From: Al Viro
Date: Sun Dec 25 2005 - 01:50:16 EST


From: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
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 <viro@xxxxxxxxxxxxxxxxxx>

---

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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/