Skip to content

Commit

Permalink
nfsd: wrap too long lines in nfsd4_encode_read
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Christoph Hellwig authored and J. Bruce Fields committed Jun 22, 2015
1 parent 96bcad5 commit 68e8bb0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3431,21 +3431,24 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr,
nfserr = nfserr_resource;
goto out;
}
if (resp->xdr.buf->page_len && test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags)) {
if (resp->xdr.buf->page_len &&
test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags)) {
WARN_ON_ONCE(1);
nfserr = nfserr_resource;
goto out;
}
xdr_commit_encode(xdr);

maxcount = svc_max_payload(resp->rqstp);
maxcount = min_t(unsigned long, maxcount, (xdr->buf->buflen - xdr->buf->len));
maxcount = min_t(unsigned long, maxcount,
(xdr->buf->buflen - xdr->buf->len));
maxcount = min_t(unsigned long, maxcount, read->rd_length);

if (read->rd_tmp_file)
ra = nfsd_init_raparms(file);

if (file->f_op->splice_read && test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags))
if (file->f_op->splice_read &&
test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags))
nfserr = nfsd4_encode_splice_read(resp, read, file, maxcount);
else
nfserr = nfsd4_encode_readv(resp, read, file, maxcount);
Expand Down

0 comments on commit 68e8bb0

Please sign in to comment.