]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: Incoming xdr_bufs may have content in tail buffer
authorChuck Lever <chuck.lever@oracle.com>
Fri, 18 Aug 2017 15:12:27 +0000 (11:12 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 5 Sep 2017 19:15:29 +0000 (15:15 -0400)
commit9af2aa6163e562320f75d18ad4e5c72d288319a9
treea07c8ea087aec4334faf0c626f2ab5f396685622
parentd4a54482aa14f2943a5be07653fb65c1b37c964e
nfsd: Incoming xdr_bufs may have content in tail buffer

Since the beginning, svcsock has built a received RPC Call message
by populating the xdr_buf's head, then placing the remaining
message bytes in the xdr_buf's page list. The xdr_buf's tail is
never populated.

This means that an NFSv4 COMPOUND containing an NFS WRITE operation
plus trailing operations has a page list that contains the WRITE
data payload followed by the trailing operations. NFSv4 XDR decoders
will not look in the xdr_buf's tail, ever, because svcsock never put
anything there.

To support transports that can pass the write payload in the
xdr_buf's pagelist and trailing content in the xdr_buf's tail,
introduce logic in READ_BUF that switches to the xdr_buf's tail vec
when the decoder runs out of content in rq_arg.pages.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4xdr.c
fs/nfsd/xdr4.h