2006-01-13 01:01:13

by NeilBrown

[permalink] [raw]
Subject: [PATCH kNFSd 024 of 26] nfsd4_truncate() bogus return value


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

-EINVAL (in host order, no less) is not a good thing to return to client.
nfsd4_truncate() returns it in one case and its callers expect nfs_....
from it. AFAICS, it should be nfserr_inval

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

### Diffstat output
./fs/nfsd/nfs4state.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff ./fs/nfsd/nfs4state.c~current~ ./fs/nfsd/nfs4state.c
--- ./fs/nfsd/nfs4state.c~current~ 2006-01-13 11:51:09.000000000 +1100
+++ ./fs/nfsd/nfs4state.c 2006-01-13 11:51:10.000000000 +1100
@@ -1600,7 +1600,7 @@ nfsd4_truncate(struct svc_rqst *rqstp, s
if (!open->op_truncate)
return 0;
if (!(open->op_share_access & NFS4_SHARE_ACCESS_WRITE))
- return -EINVAL;
+ return nfserr_inval;
return nfsd_setattr(rqstp, fh, &iattr, 0, (time_t)0);
}



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs