1. 11 4月, 2016 1 次提交
  2. 09 1月, 2016 1 次提交
    • N
      nfsd: don't hold i_mutex over userspace upcalls · bbddca8e
      NeilBrown 提交于
      We need information about exports when crossing mountpoints during
      lookup or NFSv4 readdir.  If we don't already have that information
      cached, we may have to ask (and wait for) rpc.mountd.
      
      In both cases we currently hold the i_mutex on the parent of the
      directory we're asking rpc.mountd about.  We've seen situations where
      rpc.mountd performs some operation on that directory that tries to take
      the i_mutex again, resulting in deadlock.
      
      With some care, we may be able to avoid that in rpc.mountd.  But it
      seems better just to avoid holding a mutex while waiting on userspace.
      
      It appears that lookup_one_len is pretty much the only operation that
      needs the i_mutex.  So we could just drop the i_mutex elsewhere and do
      something like
      
      	mutex_lock()
      	lookup_one_len()
      	mutex_unlock()
      
      In many cases though the lookup would have been cached and not required
      the i_mutex, so it's more efficient to create a lookup_one_len() variant
      that only takes the i_mutex when necessary.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      bbddca8e
  3. 13 10月, 2015 1 次提交
  4. 07 5月, 2015 1 次提交
  5. 16 4月, 2015 1 次提交
  6. 23 6月, 2014 1 次提交
  7. 23 5月, 2014 1 次提交
  8. 24 1月, 2014 1 次提交
  9. 11 12月, 2013 1 次提交
    • A
      nfsd: don't return high mode bits · 6e14b46b
      Albert Fluegel 提交于
      The Linux NFS server replies among other things to a "Check access permission"
      the following:
      
      NFS:    File type = 2 (Directory)
      NFS:    Mode = 040755
      
      A netapp server replies here:
      NFS:    File type = 2 (Directory)
      NFS:    Mode = 0755
      
      The RFC 1813 i read:
         fattr3
      
            struct fattr3 {
               ftype3     type;
               mode3      mode;
               uint32     nlink;
      ...
      For the mode bits only the lowest 9 are defined in the RFC
      
      As far as I can tell, knfsd has always done this, so apparently it's harmless.
      Nevertheless, it appears to be wrong.
      
      Note this is already correct in the NFSv4 case, only v2 and v3 need
      fixing.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      6e14b46b
  10. 26 2月, 2013 1 次提交
  11. 13 2月, 2013 2 次提交
  12. 18 12月, 2012 1 次提交
  13. 11 12月, 2012 1 次提交
  14. 13 4月, 2012 1 次提交
    • A
      nfsd: fix compose_entry_fh() failure exits · efe39651
      Al Viro 提交于
      Restore the original logics ("fail on mountpoints, negatives and in
      case of fh_compose() failures").  Since commit 8177e (nfsd: clean up
      readdirplus encoding) that got broken -
      	rv = fh_compose(fhp, exp, dchild, &cd->fh);
      	if (rv)
      	       goto out;
      	if (!dchild->d_inode)
      		goto out;
      	rv = 0;
      out:
      is equivalent to
      	rv = fh_compose(fhp, exp, dchild, &cd->fh);
      out:
      and the second check has no effect whatsoever...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      efe39651
  15. 19 5月, 2011 1 次提交
  16. 31 3月, 2011 1 次提交
  17. 09 12月, 2010 1 次提交
    • N
      nfsd: Fix possible BUG_ON firing in set_change_info · c1ac3ffc
      Neil Brown 提交于
      If vfs_getattr in fill_post_wcc returns an error, we don't
      set fh_post_change.
      For NFSv4, this can result in set_change_info triggering a BUG_ON.
      i.e. fh_post_saved being zero isn't really a bug.
      
      So:
       - instead of BUGging when fh_post_saved is zero, just clear ->atomic.
       - if vfs_getattr fails in fill_post_wcc, take a copy of i_ctime anyway.
         This will be used i seg_change_info, but not overly trusted.
       - While we are there, remove the pointless 'if' statements in set_change_info.
         There is no harm setting all the values.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Cc: stable@kernel.org
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      c1ac3ffc
  18. 16 12月, 2009 1 次提交
  19. 15 12月, 2009 2 次提交
  20. 15 11月, 2009 1 次提交
  21. 05 9月, 2009 2 次提交
  22. 29 4月, 2009 1 次提交
    • J
      nfsd: support ext4 i_version · c654b8a9
      J. Bruce Fields 提交于
      ext4 supports a real NFSv4 change attribute, which is bumped whenever
      the ctime would be updated, including times when two updates arrive
      within a jiffy of each other.  (Note that although ext4 has space for
      nanosecond-precision ctime, the real resolution is lower: it actually
      uses jiffies as the time-source.)  This ensures clients will invalidate
      their caches when they need to.
      
      There is some fear that keeping the i_version up-to-date could have
      performance drawbacks, so for now it's turned on only by a mount option.
      We hope to do something better eventually.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Cc: Theodore Tso <tytso@mit.edu>
      c654b8a9
  23. 15 2月, 2008 1 次提交
  24. 02 2月, 2008 4 次提交
  25. 14 1月, 2008 1 次提交
  26. 10 10月, 2007 1 次提交
    • P
      knfsd: 64 bit ino support for NFS server · 40ee5dc6
      Peter Staubach 提交于
      Modify the NFS server code to support 64 bit ino's, as
      appropriate for the system and the NFS protocol version.
      
      The gist of the changes is to query the underlying file system
      for attributes and not just to use the cached attributes in the
      inode.  For this specific purpose, the inode only contains an
      ino field which unsigned long, which is large enough on 64 bit
      platforms, but is not large enough on 32 bit platforms.
      
      I haven't been able to find any reason why ->getattr can't be called
      while i_mutex.  The specification indicates that i_mutex is not
      required to be held in order to invoke ->getattr, but it doesn't say
      that i_mutex can't be held while invoking ->getattr.
      
      I also haven't come to any conclusions regarding the value of
      lease_get_mtime() and whether it should or should not be invoked
      by fill_post_wcc() too.  I chose not to change this because I
      thought that it was safer to leave well enough alone.  If we
      decide to make a change, it can be done separately.
      Signed-off-by: NPeter Staubach <staubach@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Acked-by: NNeil Brown <neilb@suse.de>
      40ee5dc6
  27. 10 5月, 2007 2 次提交
  28. 28 3月, 2007 1 次提交
  29. 15 2月, 2007 1 次提交
  30. 27 1月, 2007 1 次提交
    • N
      [PATCH] knfsd: Fix type mismatch with filldir_t used by nfsd · a0ad13ef
      NeilBrown 提交于
      nfsd defines a type 'encode_dent_fn' which is much like 'filldir_t' except
      that the first pointer is 'struct readdir_cd *' rather than 'void *'.  It
      then casts encode_dent_fn points to 'filldir_t' as needed.  This hides any
      other type mismatches between the two such as the fact that the 'ino' arg
      recently changed from ino_t to u64.
      
      So: get rid of 'encode_dent_fn', get rid of the cast of the function type,
      change the first arg of various functions from 'struct readdir_cd *' to
      'void *', and live with the fact that we have a little less type checking
      on the calling of these functions now.  Less internal (to nfsd) checking
      offset by more external checking, which is more important.
      
      Thanks to Gabriel Paubert <paubert@iram.es> for discovering this and
      providing an initial patch.
      Signed-off-by: NGabriel Paubert <paubert@iram.es>
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a0ad13ef
  31. 08 12月, 2006 1 次提交
  32. 21 10月, 2006 1 次提交
  33. 04 10月, 2006 1 次提交