1. 24 Nov, 2008 2 commits
  2. 09 Nov, 2008 1 commit
    • Doug Nazar's avatar
      Fix nfsd truncation of readdir results · b726e923
      Doug Nazar authored
      Commit 8d7c4203 "nfsd: fix failure to set eof in readdir in some
      situations" introduced a bug: on a directory in an exported ext3
      filesystem with dir_index unset, a READDIR will only return about 250
      entries, even if the directory was larger.
      
      Bisected it back to this commit; reverting it fixes the problem.
      
      It turns out that in this case ext3 reads a block at a time, then
      returns from readdir, which means we can end up with buf.full==0 but
      with more entries in the directory still to be read.  Before 8d7c4203
      (but after c002a6c7 "Optimise NFS readdir hack slightly"), this would
      cause us to return the READDIR result immediately, but with the eof bit
      unset.  That could cause a performance regression (because the client
      would need more roundtrips to the server to read the whole directory),
      but no loss in correctness, since the cleared eof bit caused the client
      to send another readdir.  After 8d7c4203, the setting of the eof bit
      made this a correctness problem.
      
      So, move nfserr_eof into the loop and remove the buf.full check so that
      we loop until buf.used==0.  The following seems to do the right thing
      and reduces the network traffic since we don't return a READDIR result
      until the buffer is full.
      
      Tested on an empty directory & large directory; eof is properly sent and
      there are no more short buffers.
      Signed-off-by: default avatarDoug Nazar <nazard@dragoninc.ca>
      Cc: David Woodhouse <David.Woodhouse@intel.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      b726e923
  3. 30 Oct, 2008 2 commits
    • Chuck Lever's avatar
      NLM: Set address family before calling nlm_host_rebooted() · d7dc61d0
      Chuck Lever authored
      The nlm_host_rebooted() function uses nlm_cmp_addr() to find an
      nsm_handle that matches the rebooted peer.  In order for this to work,
      the passed-in address must have a proper address family.
      
      This fixes a post-2.6.28 regression introduced by commit 781b61a6, which
      added AF_INET6 support to nlm_cmp_addr().  Before that commit,
      nlm_cmp_addr() didn't care about the address family; it compared only
      the sin_addr.s_addr field for equality.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      d7dc61d0
    • J. Bruce Fields's avatar
      nfsd: fix failure to set eof in readdir in some situations · 8d7c4203
      J. Bruce Fields authored
      Before 14f7dd63 "[PATCH] Copy XFS
      readdir hack into nfsd code", readdir_cd->err was reset to eof before
      each call to vfs_readdir; afterwards, it is set only once.  Similarly,
      c002a6c7 "[PATCH] Optimise NFS readdir
      hack slightly", can cause us to exit without nfserr_eof set.  Fix this.
      
      This ensures the "eof" bit is set when needed in readdir replies.  (The
      particular case I saw was an nfsv4 readdir of an empty directory, which
      returned with no entries (the protocol requires "." and ".." to be
      filtered out), but with eof unset.)
      
      Cc: David Woodhouse <David.Woodhouse@intel.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      8d7c4203
  4. 26 Oct, 2008 21 commits
  5. 24 Oct, 2008 6 commits
  6. 23 Oct, 2008 8 commits