linux/net/sunrpc/xprtrdma
Chuck Lever cf570a9374 svcrdma: Do not write xdr_buf::tail in a Write chunk
When the Linux NFS server writes an odd-length data item into a
Write chunk, it finishes with XDR pad bytes. If the data item is
smaller than the Write chunk, the pad bytes are written at the end
of the data item, but still inside the chunk (ie, in the
application's buffer). Since this is direct data placement, that
exposes the pad bytes.

XDR pad bytes are inserted in order to preserve the XDR alignment
of the next XDR data item in an XDR stream. But Write chunks do not
appear in the payload XDR stream, and only one data item is allowed
in each chunk. Thus XDR padding is not needed in a Write chunk.

With NFSv4, the Linux NFS server places the results of any
operations that follow an NFSv4 READ or READLINK in the xdr_buf's
tail. Those results also should never be sent as a part of a Write
chunk. The current logic in send_write_chunks() appears to assume
that the xdr_buf's tail contains only pad bytes (ie, NFSv3).

The server should write only the contents of the xdr_buf's page list
in a Write chunk. If there's more than an XDR pad in the tail, that
needs to go inline or in the Reply chunk.

BugLink: https://bugzilla.linux-nfs.org/show_bug.cgi?id=294
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2016-03-01 13:06:33 -08:00
..
backchannel.c xprtrdma: Disable RPC/RDMA backchannel debugging messages 2015-12-18 15:34:33 -05:00
fmr_ops.c xprtrdma: Add ro_unmap_sync method for FMR 2015-12-18 15:34:33 -05:00
frwr_ops.c Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00
Makefile svcrdma: Add class for RDMA backwards direction transport 2016-01-19 15:30:48 -05:00
module.c rpcrdma: Merge svcrdma and xprtrdma modules into one 2015-06-04 16:56:02 -04:00
physical_ops.c xprtrdma: Add ro_unmap_sync method for all-physical registration 2015-12-18 15:34:33 -05:00
rpc_rdma.c xprtrdma: Invalidate in the RPC reply handler 2015-12-18 15:34:33 -05:00
svc_rdma.c svcrdma: Define maximum number of backchannel requests 2016-01-19 15:30:48 -05:00
svc_rdma_backchannel.c svc_rdma: use local_dma_lkey 2016-01-19 15:30:48 -05:00
svc_rdma_marshal.c svcrdma: Keep rpcrdma_msg fields in network byte-order 2015-06-04 16:55:59 -04:00
svc_rdma_recvfrom.c svc_rdma: use local_dma_lkey 2016-01-19 15:30:48 -05:00
svc_rdma_sendto.c svcrdma: Do not write xdr_buf::tail in a Write chunk 2016-03-01 13:06:33 -08:00
svc_rdma_transport.c svc_rdma: use local_dma_lkey 2016-01-19 15:30:48 -05:00
transport.c Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00
verbs.c Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00
xprt_rdma.h Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00