aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-08-15 18:39:32 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-08-26 18:22:50 -0400
commit75c096f753b273b59f1b9a0745e9e4b5d911a312 (patch)
treee447160f8c299cbdc20718d56c8a995bc17dd381 /fs/nfsd/nfs4xdr.c
parente281d8100995133dc65e00b1dec8f84b91b6e8c3 (diff)
nfsd4: it's OK to return nfserr_symlink
The nfsd4 code has a bunch of special exceptions for error returns which map nfserr_symlink to other errors. In fact, the spec makes it clear that nfserr_symlink is to be preferred over less specific errors where possible. The patch that introduced it back in 2.6.4 is "kNFSd: correct symlink related error returns.", which claims that these special exceptions are represent an NFSv4 break from v2/v3 tradition--when in fact the symlink error was introduced with v4. I suspect what happened was pynfs tests were written that were overly faithful to the (known-incomplete) rfc3530 error return lists, and then code was fixed up mindlessly to make the tests pass. Delete these unnecessary exceptions. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 51ec1f274501..78c792fb59a8 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2778,8 +2778,6 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr,
2778 read->rd_offset, resp->rqstp->rq_vec, read->rd_vlen, 2778 read->rd_offset, resp->rqstp->rq_vec, read->rd_vlen,
2779 &maxcount); 2779 &maxcount);
2780 2780
2781 if (nfserr == nfserr_symlink)
2782 nfserr = nfserr_inval;
2783 if (nfserr) 2781 if (nfserr)
2784 return nfserr; 2782 return nfserr;
2785 eof = (read->rd_offset + maxcount >= 2783 eof = (read->rd_offset + maxcount >=
@@ -2905,8 +2903,6 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4
2905 readdir->common.err == nfserr_toosmall && 2903 readdir->common.err == nfserr_toosmall &&
2906 readdir->buffer == page) 2904 readdir->buffer == page)
2907 nfserr = nfserr_toosmall; 2905 nfserr = nfserr_toosmall;
2908 if (nfserr == nfserr_symlink)
2909 nfserr = nfserr_notdir;
2910 if (nfserr) 2906 if (nfserr)
2911 goto err_no_verf; 2907 goto err_no_verf;
2912 2908