NFS - Properly handle NFSv3 EOF short-reads
commit28953d39b23eec3fbd96a46ca2c4946bfe8d1a61
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 24 Aug 2009 22:41:42 +0000 (24 15:41 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 24 Aug 2009 22:41:42 +0000 (24 15:41 -0700)
tree26a5030727bc392b81f5ff7348dcc6906d7d4282
parentc7841cbec4a96ffd7a4d6b4f0b8d3d07f9e278da
NFS - Properly handle NFSv3 EOF short-reads

* Short reads were not causing the remainder of the buffer to be
  zero'd out in all cases, causing the fsx filesystem test to fail.

* An EOF condition was sometimes improperly reporting a non-zero
  bp->b_resid.  Race against the server where the client's idea of
  the file size differs from the server could result in a non-zero
  bp->b_resid after a BIO.

  Zero out the remaining space and and set bp->b_resid to 0.  The
  NFS client code always specifies buffers within the bounds of
  the file.

Reported-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>
sys/vfs/nfs/nfs_bio.c
sys/vfs/nfs/nfs_vnops.c