Commit db3a3bcf authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 6b16351a
...@@ -978,16 +978,10 @@ static int decode_readdirok(struct xdr_stream *xdr) ...@@ -978,16 +978,10 @@ static int decode_readdirok(struct xdr_stream *xdr)
pglen = xdr->buf->page_len; pglen = xdr->buf->page_len;
hdrlen = (u8 *)xdr->p - (u8 *)xdr->iov->iov_base; hdrlen = (u8 *)xdr->p - (u8 *)xdr->iov->iov_base;
recvd = xdr->buf->len - hdrlen; recvd = xdr->buf->len - hdrlen;
if (unlikely(pglen > recvd)) if (pglen > recvd)
goto out_cheating; pglen = recvd;
out:
xdr_read_pages(xdr, pglen); xdr_read_pages(xdr, pglen);
return pglen; return pglen;
out_cheating:
dprintk("NFS: server cheating in readdir result: "
"pglen %u > recvd %u\n", pglen, recvd);
pglen = recvd;
goto out;
} }
static int nfs2_xdr_dec_readdirres(struct rpc_rqst *req, static int nfs2_xdr_dec_readdirres(struct rpc_rqst *req,
......
...@@ -2045,16 +2045,10 @@ static int decode_dirlist3(struct xdr_stream *xdr) ...@@ -2045,16 +2045,10 @@ static int decode_dirlist3(struct xdr_stream *xdr)
pglen = xdr->buf->page_len; pglen = xdr->buf->page_len;
hdrlen = (u8 *)xdr->p - (u8 *)xdr->iov->iov_base; hdrlen = (u8 *)xdr->p - (u8 *)xdr->iov->iov_base;
recvd = xdr->buf->len - hdrlen; recvd = xdr->buf->len - hdrlen;
if (unlikely(pglen > recvd)) if (pglen > recvd)
goto out_cheating; pglen = recvd;
out:
xdr_read_pages(xdr, pglen); xdr_read_pages(xdr, pglen);
return pglen; return pglen;
out_cheating:
dprintk("NFS: server cheating in readdir result: "
"pglen %u > recvd %u\n", pglen, recvd);
pglen = recvd;
goto out;
} }
static int decode_readdir3resok(struct xdr_stream *xdr, static int decode_readdir3resok(struct xdr_stream *xdr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment