1. 29 9月, 2012 2 次提交
  2. 12 9月, 2012 1 次提交
  3. 01 8月, 2012 3 次提交
  4. 31 7月, 2012 3 次提交
    • B
      NFS: Convert v4 into a module · 89d77c8f
      Bryan Schumaker 提交于
      This patch exports symbols needed by the v4 module.  In addition, I also
      switch over to using IS_ENABLED() to check if CONFIG_NFS_V4 or
      CONFIG_NFS_V4_MODULE are set.
      
      The module (nfs4.ko) will be created in the same directory as nfs.ko and
      will be automatically loaded the first time you try to mount over NFS v4.
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      89d77c8f
    • B
      NFS: Convert v2 into a module · ddda8e0a
      Bryan Schumaker 提交于
      The module (nfs2.ko) will be created in the same directory as nfs.ko and
      will be automatically loaded the first time you try to mount over NFS v2.
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ddda8e0a
    • J
      nfs: skip commit in releasepage if we're freeing memory for fs-related reasons · 5cf02d09
      Jeff Layton 提交于
      We've had some reports of a deadlock where rpciod ends up with a stack
      trace like this:
      
          PID: 2507   TASK: ffff88103691ab40  CPU: 14  COMMAND: "rpciod/14"
           #0 [ffff8810343bf2f0] schedule at ffffffff814dabd9
           #1 [ffff8810343bf3b8] nfs_wait_bit_killable at ffffffffa038fc04 [nfs]
           #2 [ffff8810343bf3c8] __wait_on_bit at ffffffff814dbc2f
           #3 [ffff8810343bf418] out_of_line_wait_on_bit at ffffffff814dbcd8
           #4 [ffff8810343bf488] nfs_commit_inode at ffffffffa039e0c1 [nfs]
           #5 [ffff8810343bf4f8] nfs_release_page at ffffffffa038bef6 [nfs]
           #6 [ffff8810343bf528] try_to_release_page at ffffffff8110c670
           #7 [ffff8810343bf538] shrink_page_list.clone.0 at ffffffff81126271
           #8 [ffff8810343bf668] shrink_inactive_list at ffffffff81126638
           #9 [ffff8810343bf818] shrink_zone at ffffffff8112788f
          #10 [ffff8810343bf8c8] do_try_to_free_pages at ffffffff81127b1e
          #11 [ffff8810343bf958] try_to_free_pages at ffffffff8112812f
          #12 [ffff8810343bfa08] __alloc_pages_nodemask at ffffffff8111fdad
          #13 [ffff8810343bfb28] kmem_getpages at ffffffff81159942
          #14 [ffff8810343bfb58] fallback_alloc at ffffffff8115a55a
          #15 [ffff8810343bfbd8] ____cache_alloc_node at ffffffff8115a2d9
          #16 [ffff8810343bfc38] kmem_cache_alloc at ffffffff8115b09b
          #17 [ffff8810343bfc78] sk_prot_alloc at ffffffff81411808
          #18 [ffff8810343bfcb8] sk_alloc at ffffffff8141197c
          #19 [ffff8810343bfce8] inet_create at ffffffff81483ba6
          #20 [ffff8810343bfd38] __sock_create at ffffffff8140b4a7
          #21 [ffff8810343bfd98] xs_create_sock at ffffffffa01f649b [sunrpc]
          #22 [ffff8810343bfdd8] xs_tcp_setup_socket at ffffffffa01f6965 [sunrpc]
          #23 [ffff8810343bfe38] worker_thread at ffffffff810887d0
          #24 [ffff8810343bfee8] kthread at ffffffff8108dd96
          #25 [ffff8810343bff48] kernel_thread at ffffffff8100c1ca
      
      rpciod is trying to allocate memory for a new socket to talk to the
      server. The VM ends up calling ->releasepage to get more memory, and it
      tries to do a blocking commit. That commit can't succeed however without
      a connected socket, so we deadlock.
      
      Fix this by setting PF_FSTRANS on the workqueue task prior to doing the
      socket allocation, and having nfs_release_page check for that flag when
      deciding whether to do a commit call. Also, set PF_FSTRANS
      unconditionally in rpc_async_schedule since that function can also do
      allocations sometimes.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: stable@vger.kernel.org
      5cf02d09
  5. 18 7月, 2012 3 次提交
  6. 29 6月, 2012 2 次提交
  7. 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
  8. 25 5月, 2012 1 次提交
  9. 09 5月, 2012 1 次提交
  10. 29 3月, 2012 1 次提交
  11. 01 2月, 2012 1 次提交
  12. 05 1月, 2012 1 次提交
    • N
      NFS - fix recent breakage to NFS error handling. · 2edb6bc3
      NeilBrown 提交于
      From c6d615d2b97fe305cbf123a8751ced859dca1d5e Mon Sep 17 00:00:00 2001
      From: NeilBrown <neilb@suse.de>
      Date: Wed, 16 Nov 2011 09:39:05 +1100
      Subject: [PATCH] NFS - fix recent breakage to NFS error handling.
      
      commit 02c24a82 made a small and
      presumably unintended change to write error handling in NFS.
      
      Previously an error from filemap_write_and_wait_range would only be of
      interest if nfs_file_fsync did not return an error.  After this commit,
      an error from filemap_write_and_wait_range would mean that (the rest of)
      nfs_file_fsync would not even be called.
      
      This means that:
       1/ you are more likely to see EIO than e.g. EDQUOT or ENOSPC.
       2/ NFS_CONTEXT_ERROR_WRITE remains set for longer so more writes are
          synchronous.
      
      This patch restores previous behaviour.
      
      Cc: stable@kernel.org
      Cc: Josef Bacik <josef@redhat.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      2edb6bc3
  13. 16 12月, 2011 1 次提交
  14. 05 11月, 2011 2 次提交
  15. 03 11月, 2011 1 次提交
  16. 28 10月, 2011 2 次提交
    • A
      nfs: drop unnecessary locking in llseek · 79835a71
      Andi Kleen 提交于
      This makes NFS follow the standard generic_file_llseek locking scheme.
      
      Cc: Trond.Myklebust@netapp.com
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      79835a71
    • A
      vfs: do (nearly) lockless generic_file_llseek · ef3d0fd2
      Andi Kleen 提交于
      The i_mutex lock use of generic _file_llseek hurts.  Independent processes
      accessing the same file synchronize over a single lock, even though
      they have no need for synchronization at all.
      
      Under high utilization this can cause llseek to scale very poorly on larger
      systems.
      
      This patch does some rethinking of the llseek locking model:
      
      First the 64bit f_pos is not necessarily atomic without locks
      on 32bit systems. This can already cause races with read() today.
      This was discussed on linux-kernel in the past and deemed acceptable.
      The patch does not change that.
      
      Let's look at the different seek variants:
      
      SEEK_SET: Doesn't really need any locking.
      If there's a race one writer wins, the other loses.
      
      For 32bit the non atomic update races against read()
      stay the same. Without a lock they can also happen
      against write() now.  The read() race was deemed
      acceptable in past discussions, and I think if it's
      ok for read it's ok for write too.
      
      => Don't need a lock.
      
      SEEK_END: This behaves like SEEK_SET plus it reads
      the maximum size too. Reading the maximum size would have the
      32bit atomic problem. But luckily we already have a way to read
      the maximum size without locking (i_size_read), so we
      can just use that instead.
      
      Without i_mutex there is no synchronization with write() anymore,
      however since the write() update is atomic on 64bit it just behaves
      like another racy SEEK_SET.  On non atomic 32bit it's the same
      as SEEK_SET.
      
      => Don't need a lock, but need to use i_size_read()
      
      SEEK_CUR: This has a read-modify-write race window
      on the same file. One could argue that any application
      doing unsynchronized seeks on the same file is already broken.
      But for the sake of not adding a regression here I'm
      using the file->f_lock to synchronize this. Using this
      lock is much better than the inode mutex because it doesn't
      synchronize between processes.
      
      => So still need a lock, but can use a f_lock.
      
      This patch implements this new scheme in generic_file_llseek.
      I dropped generic_file_llseek_unlocked and changed all callers.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      ef3d0fd2
  17. 21 7月, 2011 2 次提交
  18. 31 3月, 2011 1 次提交
  19. 25 3月, 2011 1 次提交
  20. 24 3月, 2011 1 次提交
  21. 12 3月, 2011 1 次提交
  22. 08 12月, 2010 1 次提交
  23. 31 10月, 2010 2 次提交
  24. 25 10月, 2010 2 次提交
  25. 20 10月, 2010 1 次提交
  26. 23 9月, 2010 1 次提交
    • S
      nfs: introduce mount option '-olocal_lock' to make locks local · 5eebde23
      Suresh Jayaraman 提交于
      NFS clients since 2.6.12 support flock locks by emulating fcntl byte-range
      locks. Due to this, some windows applications which seem to use both flock
      (share mode lock mapped as flock by Samba) and fcntl locks sequentially on
      the same file, can't lock as they falsely assume the file is already locked.
      The problem was reported on a setup with windows clients accessing excel files
      on a Samba exported share which is originally a NFS mount from a NetApp filer.
      
      Older NFS clients (< 2.6.12) did not see this problem as flock locks were
      considered local. To support legacy flock behavior, this patch adds a mount
      option "-olocal_lock=" which can take the following values:
      
         'none'  		- Neither flock locks nor POSIX locks are local
         'flock' 		- flock locks are local
         'posix' 		- fcntl/POSIX locks are local
         'all'		- Both flock locks and POSIX locks are local
      
      Testing:
      
         - This patch was tested by using -olocal_lock option with different values
           and the NLM calls were noted from the network packet captured.
      
           'none'  - NLM calls were seen during both flock() and fcntl(), flock lock
         	       was granted, fcntl was denied
           'flock' - no NLM calls for flock(), NLM call was seen for fcntl(),
         	       granted
           'posix' - NLM call was seen for flock() - granted, no NLM call for fcntl()
           'all'   - no NLM calls were seen during both flock() and fcntl()
      
         - No bugs were seen during NFSv4 locking/unlocking in general and NFSv4
           reboot recovery.
      
      Cc: Neil Brown <neilb@suse.de>
      Signed-off-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      5eebde23
  27. 13 9月, 2010 1 次提交