[PATCH] nfsd4_truncate() bogus return value
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 19 Jan 2006 01:43:46 +0000 (17:43 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 19 Jan 2006 03:20:27 +0000 (19:20 -0800)
-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 <viro@zeniv.linux.org.uk>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/nfsd/nfs4state.c

index 82c36ccd8b5c0220375c4184afd746a419b94dd5..ddee0e0371a6c66176ccb850d3b0d6c47c15e680 100644 (file)
@@ -1600,7 +1600,7 @@ nfsd4_truncate(struct svc_rqst *rqstp, struct svc_fh *fh,
        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);
 }