aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-06-20 15:50:14 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-06-24 16:20:07 -0400
commitdb3a3bcf08d5c79290b369d70cc0b80c369d8ad9 (patch)
tree9a15adef276c422b2c6e63873798e73c1410d4ee
parent6b16351acbd415e66ba16bf7d473ece1574cf0bc (diff)
NFSv2/v3: Remove incorrect dprintks from the readdir reply code
The actual size of the directory is unknown to the client, so it is always requesting the maximum number it can handle. If the server is replying with fewer entries than was requested, then that will usually reflect the fact that we've hit the end of the directory. Flagging it as an error is therefore incorrect. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs2xdr.c10
-rw-r--r--fs/nfs/nfs3xdr.c10
2 files changed, 4 insertions, 16 deletions
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index baf759bccd05..db81166182c9 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -978,16 +978,10 @@ static int decode_readdirok(struct xdr_stream *xdr)
978 pglen = xdr->buf->page_len; 978 pglen = xdr->buf->page_len;
979 hdrlen = (u8 *)xdr->p - (u8 *)xdr->iov->iov_base; 979 hdrlen = (u8 *)xdr->p - (u8 *)xdr->iov->iov_base;
980 recvd = xdr->buf->len - hdrlen; 980 recvd = xdr->buf->len - hdrlen;
981 if (unlikely(pglen > recvd)) 981 if (pglen > recvd)
982 goto out_cheating; 982 pglen = recvd;
983out:
984 xdr_read_pages(xdr, pglen); 983 xdr_read_pages(xdr, pglen);
985 return pglen; 984 return pglen;
986out_cheating:
987 dprintk("NFS: server cheating in readdir result: "
988 "pglen %u > recvd %u\n", pglen, recvd);
989 pglen = recvd;
990 goto out;
991} 985}
992 986
993static int nfs2_xdr_dec_readdirres(struct rpc_rqst *req, 987static int nfs2_xdr_dec_readdirres(struct rpc_rqst *req,
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index 902de489ec9b..3c61c7f80a4b 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -2045,16 +2045,10 @@ static int decode_dirlist3(struct xdr_stream *xdr)
2045 pglen = xdr->buf->page_len; 2045 pglen = xdr->buf->page_len;
2046 hdrlen = (u8 *)xdr->p - (u8 *)xdr->iov->iov_base; 2046 hdrlen = (u8 *)xdr->p - (u8 *)xdr->iov->iov_base;
2047 recvd = xdr->buf->len - hdrlen; 2047 recvd = xdr->buf->len - hdrlen;
2048 if (unlikely(pglen > recvd)) 2048 if (pglen > recvd)
2049 goto out_cheating; 2049 pglen = recvd;
2050out:
2051 xdr_read_pages(xdr, pglen); 2050 xdr_read_pages(xdr, pglen);
2052 return pglen; 2051 return pglen;
2053out_cheating:
2054 dprintk("NFS: server cheating in readdir result: "
2055 "pglen %u > recvd %u\n", pglen, recvd);
2056 pglen = recvd;
2057 goto out;
2058} 2052}
2059 2053
2060static int decode_readdir3resok(struct xdr_stream *xdr, 2054static int decode_readdir3resok(struct xdr_stream *xdr,