1. 14 7月, 2017 1 次提交
  2. 26 4月, 2017 1 次提交
  3. 21 4月, 2017 2 次提交
    • B
      NFS: Always wait for I/O completion before unlock · f30cb757
      Benjamin Coddington 提交于
      NFS attempts to wait for read and write completion before unlocking in
      order to ensure that the data returned was protected by the lock.  When
      this waiting is interrupted by a signal, the unlock may be skipped, and
      messages similar to the following are seen in the kernel ring buffer:
      
      [20.167876] Leaked locks on dev=0x0:0x2b ino=0x8dd4c3:
      [20.168286] POSIX: fl_owner=ffff880078b06940 fl_flags=0x1 fl_type=0x0 fl_pid=20183
      [20.168727] POSIX: fl_owner=ffff880078b06680 fl_flags=0x1 fl_type=0x0 fl_pid=20185
      
      For NFSv3, the missing unlock will cause the server to refuse conflicting
      locks indefinitely.  For NFSv4, the leftover lock will be removed by the
      server after the lease timeout.
      
      This patch fixes this issue by skipping the usual wait in
      nfs_iocounter_wait if the FL_CLOSE flag is set when signaled.  Instead, the
      wait happens in the unlock RPC task on the NFS UOC rpc_waitqueue.
      
      For NFSv3, use lockd's new nlmclnt_operations along with
      nfs_async_iocounter_wait to defer NLM's unlock task until the lock
      context's iocounter reaches zero.
      
      For NFSv4, call nfs_async_iocounter_wait() directly from unlock's
      current rpc_call_prepare.
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      f30cb757
    • B
      lockd: Introduce nlmclnt_operations · b1ece737
      Benjamin Coddington 提交于
      NFS would enjoy the ability to modify the behavior of the NLM client's
      unlock RPC task in order to delay the transmission of the unlock until IO
      that was submitted under that lock has completed.  This ability can ensure
      that the NLM client will always complete the transmission of an unlock even
      if the waiting caller has been interrupted with fatal signal.
      
      For this purpose, a pointer to a struct nlmclnt_operations can be assigned
      in a nfs_module's nfs_rpc_ops that will install those nlmclnt_operations on
      the nlm_host.  The struct nlmclnt_operations defines three callback
      operations that will be used in a following patch:
      
      nlmclnt_alloc_call - used to call back after a successful allocation of
      	a struct nlm_rqst in nlmclnt_proc().
      
      nlmclnt_unlock_prepare - used to call back during NLM unlock's
      	rpc_call_prepare.  The NLM client defers calling rpc_call_start()
      	until this callback returns false.
      
      nlmclnt_release_call - used to call back when the NLM client's struct
      	nlm_rqst is freed.
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      b1ece737
  4. 08 10月, 2016 1 次提交
  5. 27 9月, 2016 2 次提交
    • M
      fs: rename "rename2" i_op to "rename" · 2773bf00
      Miklos Szeredi 提交于
      Generated patch:
      
      sed -i "s/\.rename2\t/\.rename\t\t/" `git grep -wl rename2`
      sed -i "s/\brename2\b/rename/g" `git grep -wl rename2`
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      2773bf00
    • M
      fs: make remaining filesystems use .rename2 · 1cd66c93
      Miklos Szeredi 提交于
      This is trivial to do:
      
       - add flags argument to foo_rename()
       - check if flags is zero
       - assign foo_rename() to .rename2 instead of .rename
      
      This doesn't mean it's impossible to support RENAME_NOREPLACE for these
      filesystems, but it is not trivial, like for local filesystems.
      RENAME_NOREPLACE must guarantee atomicity (i.e. it shouldn't be possible
      for a file to be created on one host while it is overwritten by rename on
      another host).
      
      Filesystems converted:
      
      9p, afs, ceph, coda, ecryptfs, kernfs, lustre, ncpfs, nfs, ocfs2, orangefs.
      
      After this, we can get rid of the duplicate interfaces for rename.
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: David Howells <dhowells@redhat.com> [AFS]
      Acked-by: NMike Marshall <hubcap@omnibond.com>
      Cc: Eric Van Hensbergen <ericvh@gmail.com>
      Cc: Ilya Dryomov <idryomov@gmail.com>
      Cc: Jan Harkes <jaharkes@cs.cmu.edu>
      Cc: Tyler Hicks <tyhicks@canonical.com>
      Cc: Oleg Drokin <oleg.drokin@intel.com>
      Cc: Trond Myklebust <trond.myklebust@primarydata.com>
      Cc: Mark Fasheh <mfasheh@suse.com>
      1cd66c93
  6. 21 7月, 2016 1 次提交
  7. 16 4月, 2015 1 次提交
  8. 02 3月, 2015 2 次提交
  9. 04 2月, 2015 1 次提交
  10. 13 9月, 2014 1 次提交
  11. 09 7月, 2014 1 次提交
  12. 25 6月, 2014 1 次提交
  13. 29 5月, 2014 4 次提交
  14. 18 3月, 2014 1 次提交
  15. 04 2月, 2014 1 次提交
    • T
      nfs: include xattr.h from fs/nfs/nfs3proc.c · 0a6be655
      Tejun Heo 提交于
      fs/nfs/nfs3proc.c is making use of xattr but was getting linux/xattr.h
      indirectly through linux/cgroup.h, which will soon drop the inclusion
      of xattr.h.  Explicitly include linux/xattr.h from nfs3proc.c so that
      compilation doesn't fail when linux/cgroup.h drops linux/xattr.h.
      
      As the following cgroup changes will depend on these changes, it
      probably would be easier to route this through cgroup branch.  Would
      that be okay?
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      Cc: linux-nfs@vger.kernel.org
      0a6be655
  16. 31 1月, 2014 1 次提交
    • C
      nfs: fix xattr inode op pointers when disabled · 5f13ee9c
      Christoph Hellwig 提交于
      Chris Mason reported a NULL pointer derefernence in generic_getxattr()
      that was due to sb->s_xattr being NULL.
      
      The reason is that the nfs #ifdef's for ACL support were misplaced, and
      the nfs3 inode operations had the xattr operation pointers set up, even
      though xattrs were not actually supported.  As a result, the xattr code
      was being called without the infrastructure having been set up.
      
      Move the #ifdef's appropriately.
      Reported-and-tested-by: NChris Mason <clm@fb.com>
      Acked-by: Al Viro viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5f13ee9c
  17. 26 1月, 2014 1 次提交
  18. 25 10月, 2013 1 次提交
  19. 05 9月, 2013 1 次提交
    • N
      NFSv4: Don't try to recover NFSv4 locks when they are lost. · ef1820f9
      NeilBrown 提交于
      When an NFSv4 client loses contact with the server it can lose any
      locks that it holds.
      
      Currently when it reconnects to the server it simply tries to reclaim
      those locks.  This might succeed even though some other client has
      held and released a lock in the mean time.  So the first client might
      think the file is unchanged, but it isn't.  This isn't good.
      
      If, when recovery happens, the locks cannot be claimed because some
      other client still holds the lock, then we get a message in the kernel
      logs, but the client can still write.  So two clients can both think
      they have a lock and can both write at the same time.  This is equally
      not good.
      
      There was a patch a while ago
        http://comments.gmane.org/gmane.linux.nfs/41917
      
      which tried to address some of this, but it didn't seem to go
      anywhere.  That patch would also send a signal to the process.  That
      might be useful but for now this patch just causes writes to fail.
      
      For NFSv4 (unlike v2/v3) there is a strong link between the lock and
      the write request so we can fairly easily fail any IO of the lock is
      gone.  While some applications might not expect this, it is still
      safer than allowing the write to succeed.
      
      Because this is a fairly big change in behaviour a module parameter,
      "recover_locks", is introduced which defaults to true (the current
      behaviour) but can be set to "false" to tell the client not to try to
      recover things that were lost.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ef1820f9
  20. 22 8月, 2013 1 次提交
  21. 09 6月, 2013 1 次提交
  22. 12 5月, 2013 1 次提交
    • C
      freezer: add unsafe versions of freezable helpers for NFS · 416ad3c9
      Colin Cross 提交于
      NFS calls the freezable helpers with locks held, which is unsafe
      and will cause lockdep warnings when 6aa97070 "lockdep: check
      that no locks held at freeze time" is reapplied (it was reverted
      in dbf520a9).  NFS shouldn't be doing this, but it has
      long-running syscalls that must hold a lock but also shouldn't
      block suspend.  Until NFS freeze handling is rewritten to use a
      signal to exit out of the critical section, add new *_unsafe
      versions of the helpers that will not run the lockdep test when
      6aa97070 is reapplied, and call them from NFS.
      
      In practice the likley result of holding the lock while freezing
      is that a second task blocked on the lock will never freeze,
      aborting suspend, but it is possible to manufacture a case using
      the cgroup freezer, the lock, and the suspend freezer to create
      a deadlock.  Silencing the lockdep warning here will allow
      problems to be found in other drivers that may have a more
      serious deadlock risk, and prevent new problems from being added.
      Signed-off-by: NColin Cross <ccross@android.com>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      416ad3c9
  23. 23 2月, 2013 1 次提交
  24. 13 12月, 2012 1 次提交
    • A
      SUNRPC handle EKEYEXPIRED in call_refreshresult · eb96d5c9
      Andy Adamson 提交于
      Currently, when an RPCSEC_GSS context has expired or is non-existent
      and the users (Kerberos) credentials have also expired or are non-existent,
      the client receives the -EKEYEXPIRED error and tries to refresh the context
      forever.  If an application is performing I/O, or other work against the share,
      the application hangs, and the user is not prompted to refresh/establish their
      credentials. This can result in a denial of service for other users.
      
      Users are expected to manage their Kerberos credential lifetimes to mitigate
      this issue.
      
      Move the -EKEYEXPIRED handling into the RPC layer. Try tk_cred_retry number
      of times to refresh the gss_context, and then return -EACCES to the application.
      Signed-off-by: NAndy Adamson <andros@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      eb96d5c9
  25. 05 9月, 2012 1 次提交
  26. 21 8月, 2012 1 次提交
  27. 31 7月, 2012 2 次提交
  28. 18 7月, 2012 1 次提交
  29. 14 7月, 2012 1 次提交
    • M
      nfs: clean up ->create in nfs_rpc_ops · 8867fe58
      Miklos Szeredi 提交于
      Don't pass nfs_open_context() to ->create().  Only the NFS4 implementation
      needed that and only because it wanted to return an open file using open
      intents.  That task has been replaced by ->atomic_open so it is not necessary
      anymore to pass the context to the create rpc operation.
      
      Despite nfs4_proc_create apparently being okay with a NULL context it Oopses
      somewhere down the call chain.  So allocate a context here.
      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>
      8867fe58
  30. 29 6月, 2012 4 次提交