1. 04 1月, 2013 1 次提交
  2. 18 12月, 2012 1 次提交
  3. 15 12月, 2012 2 次提交
    • T
      NFS: nfs_lookup_revalidate should not trust an inode with i_nlink == 0 · 65a0c149
      Trond Myklebust 提交于
      If the inode has no links, then we should force a new lookup.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      65a0c149
    • T
      NFS: Fix calls to drop_nlink() · 1f018458
      Trond Myklebust 提交于
      It is almost always wrong for NFS to call drop_nlink() after removing a
      file. What we really want is to mark the inode's attributes for
      revalidation, and we want to ensure that the VFS drops it if we're
      reasonably sure that this is the final unlink().
      Do the former using the usual cache validity flags, and the latter
      by testing if inode->i_nlink == 1, and clearing it in that case.
      
      This also fixes the following warning reported by Neil Brown and
      Jeff Layton (among others).
      
      [634155.004438] WARNING:
      at /home/abuild/rpmbuild/BUILD/kernel-desktop-3.5.0/lin [634155.004442]
      Hardware name: Latitude E6510 [634155.004577]  crc_itu_t crc32c_intel
      snd_hwdep snd_pcm snd_timer snd soundcor [634155.004609] Pid: 13402, comm:
      bash Tainted: G        W    3.5.0-36-desktop # [634155.004611] Call Trace:
      [634155.004630]  [<ffffffff8100444a>] dump_trace+0xaa/0x2b0
      [634155.004641]  [<ffffffff815a23dc>] dump_stack+0x69/0x6f
      [634155.004653]  [<ffffffff81041a0b>] warn_slowpath_common+0x7b/0xc0
      [634155.004662]  [<ffffffff811832e4>] drop_nlink+0x34/0x40
      [634155.004687]  [<ffffffffa05bb6c3>] nfs_dentry_iput+0x33/0x70 [nfs]
      [634155.004714]  [<ffffffff8118049e>] dput+0x12e/0x230
      [634155.004726]  [<ffffffff8116b230>] __fput+0x170/0x230
      [634155.004735]  [<ffffffff81167c0f>] filp_close+0x5f/0x90
      [634155.004743]  [<ffffffff81167cd7>] sys_close+0x97/0x100
      [634155.004754]  [<ffffffff815c3b39>] system_call_fastpath+0x16/0x1b
      [634155.004767]  [<00007f2a73a0d110>] 0x7f2a73a0d10f
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: stable@vger.kernel.org [3.3+]
      1f018458
  4. 30 11月, 2012 2 次提交
  5. 02 10月, 2012 1 次提交
    • W
      NFSv4: Add ACCESS operation to OPEN compound · 6168f62c
      Weston Andros Adamson 提交于
      The OPEN operation has no way to differentiate an open for read and an
      open for execution - both look like read to the server. This allowed
      users to read files that didn't have READ access but did have EXEC access,
      which is obviously wrong.
      
      This patch adds an ACCESS call to the OPEN compound to handle the
      difference between OPENs for reading and execution.  Since we're going
      through the trouble of calling ACCESS, we check all possible access bits
      and cache the results hopefully avoiding an ACCESS call in the future.
      Signed-off-by: NWeston Andros Adamson <dros@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      6168f62c
  6. 31 7月, 2012 3 次提交
  7. 18 7月, 2012 3 次提交
  8. 14 7月, 2012 14 次提交
  9. 29 6月, 2012 2 次提交
  10. 02 6月, 2012 1 次提交
    • M
      nfs: don't open in ->d_revalidate · 0ef97dcf
      Miklos Szeredi 提交于
      NFSv4 can't do reliable opens in d_revalidate, since it cannot know whether a
      mount needs to be followed or not.  It does check d_mountpoint() on the dentry,
      which can result in a weird error if the VFS found that the mount does not in
      fact need to be followed, e.g.:
      
        # mount --bind /mnt/nfs /mnt/nfs-clone
        # echo something > /mnt/nfs/tmp/bar
        # echo x > /tmp/file
        # mount --bind /tmp/file /mnt/nfs-clone/tmp/bar
        # cat  /mnt/nfs/tmp/bar
        cat: /mnt/nfs/tmp/bar: Not a directory
      
      Which should, by any sane filesystem, result in "something" being printed.
      
      So instead do the open in f_op->open() and in the unlikely case that the cached
      dentry turned out to be invalid, drop the dentry and return EOPENSTALE to let
      the VFS retry.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      CC: Trond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      0ef97dcf
  11. 11 5月, 2012 1 次提交
    • L
      vfs: make it possible to access the dentry hash/len as one 64-bit entry · 26fe5750
      Linus Torvalds 提交于
      This allows comparing hash and len in one operation on 64-bit
      architectures.  Right now only __d_lookup_rcu() takes advantage of this,
      since that is the case we care most about.
      
      The use of anonymous struct/unions hides the alternate 64-bit approach
      from most users, the exception being a few cases where we initialize a
      'struct qstr' with a static initializer.  This makes the problematic
      cases use a new QSTR_INIT() helper function for that (but initializing
      just the name pointer with a "{ .name = xyzzy }" initializer remains
      valid, as does just copying another qstr structure).
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      26fe5750
  12. 02 5月, 2012 1 次提交
    • T
      NFS: Adapt readdirplus to application usage patterns · d69ee9b8
      Trond Myklebust 提交于
      While the use of READDIRPLUS is significantly more efficient than
      READDIR followed by many LOOKUP calls, it is still less efficient
      than just READDIR if the attributes are not required.
      
      This patch tracks when lookups are attempted on the directory,
      and uses that information to selectively disable READDIRPLUS
      on that directory.
      The first 'readdir' call is always served using READDIRPLUS.
      Subsequent calls only use READDIRPLUS if there was a successful
      lookup or revalidation on a child in the mean time.
      
      Credit for the original idea should go to Neil Brown. See:
            http://www.spinics.net/lists/linux-nfs/msg19996.html
      However, the implementation in this patch differs from Neil's
      in that it focuses on tracking lookups rather than calls to
      stat().
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Neil Brown <neilb@suse.de>
      d69ee9b8
  13. 28 4月, 2012 1 次提交
  14. 20 4月, 2012 1 次提交
  15. 20 3月, 2012 1 次提交
  16. 03 3月, 2012 1 次提交
    • C
      NFS: Make nfs_cache_array.size a signed integer · 88b8e133
      Chuck Lever 提交于
      Eliminate a number of implicit type casts in comparisons, and these
      compiler warnings:
      
      fs/nfs/dir.c: In function ‘nfs_readdir_clear_array’:
      fs/nfs/dir.c:264:16: warning: comparison between signed and unsigned
      		integer expressions [-Wsign-compare]
      fs/nfs/dir.c: In function ‘nfs_readdir_search_for_cookie’:
      fs/nfs/dir.c:352:16: warning: comparison between signed and unsigned
      		integer expressions [-Wsign-compare]
      fs/nfs/dir.c: In function ‘nfs_do_filldir’:
      fs/nfs/dir.c:769:38: warning: comparison between signed and unsigned
      		integer expressions [-Wsign-compare]
      fs/nfs/dir.c:780:9: warning: comparison between signed and unsigned
      		integer expressions [-Wsign-compare]
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      88b8e133
  17. 01 2月, 2012 1 次提交
  18. 04 1月, 2012 3 次提交