1. 02 10月, 2012 2 次提交
    • C
      SUNRPC: Introduce rpc_clone_client_set_auth() · ba9b584c
      Chuck Lever 提交于
      An ULP is supposed to be able to replace a GSS rpc_auth object with
      another GSS rpc_auth object using rpcauth_create().  However,
      rpcauth_create() in 3.5 reliably fails with -EEXIST in this case.
      This is because when gss_create() attempts to create the upcall pipes,
      sometimes they are already there.  For example if a pipe FS mount
      event occurs, or a previous GSS flavor was in use for this rpc_clnt.
      
      It turns out that's not the only problem here.  While working on a
      fix for the above problem, we noticed that replacing an rpc_clnt's
      rpc_auth is not safe, since dereferencing the cl_auth field is not
      protected in any way.
      
      So we're deprecating the ability of rpcauth_create() to switch an
      rpc_clnt's security flavor during normal operation.  Instead, let's
      add a fresh API that clones an rpc_clnt and gives the clone a new
      flavor before it's used.
      
      This makes immediate use of the new __rpc_clone_client() helper.
      
      This can be used in a similar fashion to rpcauth_create() when a
      client is hunting for the correct security flavor.  Instead of
      replacing an rpc_clnt's security flavor in a loop, the ULP replaces
      the whole rpc_clnt.
      
      To fix the -EEXIST problem, any ULP logic that relies on replacing
      an rpc_clnt's rpc_auth with rpcauth_create() must be changed to use
      this API instead.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ba9b584c
    • C
      SUNRPC: Refactor rpc_clone_client() · 1b63a751
      Chuck Lever 提交于
      rpc_clone_client() does most of the same tasks as rpc_new_client(),
      so there is an opportunity for code re-use.  Create a generic helper
      that makes it easy to clone an RPC client while replacing any of the
      clnt's parameters.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      1b63a751
  2. 01 8月, 2012 1 次提交
    • M
      nfs: enable swap on NFS · a564b8f0
      Mel Gorman 提交于
      Implement the new swapfile a_ops for NFS and hook up ->direct_IO.  This
      will set the NFS socket to SOCK_MEMALLOC and run socket reconnect under
      PF_MEMALLOC as well as reset SOCK_MEMALLOC before engaging the protocol
      ->connect() method.
      
      PF_MEMALLOC should allow the allocation of struct socket and related
      objects and the early (re)setting of SOCK_MEMALLOC should allow us to
      receive the packets required for the TCP connection buildup.
      
      [jlayton@redhat.com: Restore PF_MEMALLOC task flags in all cases]
      [dfeng@redhat.com: Fix handling of multiple swap files]
      [a.p.zijlstra@chello.nl: Original patch]
      Signed-off-by: NMel Gorman <mgorman@suse.de>
      Acked-by: NRik van Riel <riel@redhat.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Eric B Munson <emunson@mgebm.net>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Xiaotian Feng <dfeng@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a564b8f0
  3. 31 7月, 2012 1 次提交
  4. 11 7月, 2012 1 次提交
  5. 20 5月, 2012 1 次提交
  6. 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
  7. 30 4月, 2012 1 次提交
  8. 28 4月, 2012 3 次提交
  9. 29 3月, 2012 1 次提交
  10. 03 3月, 2012 3 次提交
    • C
      SUNRPC: Add API to acquire source address · 2e738fdc
      Chuck Lever 提交于
      NFSv4.0 clients must send endpoint information for their callback
      service to NFSv4.0 servers during their first contact with a server.
      Traditionally on Linux, user space provides the callback endpoint IP
      address via the "clientaddr=" mount option.
      
      During an NFSv4 migration event, it is possible that an FSID may be
      migrated to a destination server that is accessible via a different
      source IP address than the source server was.  The client must update
      callback endpoint information on the destination server so that it can
      maintain leases and allow delegation.
      
      Without a new "clientaddr=" option from user space, however, the
      kernel itself must construct an appropriate IP address for the
      callback update.  Provide an API in the RPC client for upper layer
      RPC consumers to acquire a source address for a remote.
      
      The mechanism used by the mount.nfs command is copied: set up a
      connected UDP socket to the designated remote, then scrape the source
      address off the socket.  We are careful to select the correct network
      namespace when setting up the temporary UDP socket.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      2e738fdc
    • T
      SUNRPC: Move clnt->cl_server into struct rpc_xprt · 4e0038b6
      Trond Myklebust 提交于
      When the cl_xprt field is updated, the cl_server field will also have
      to change.  Since the contents of cl_server follow the remote endpoint
      of cl_xprt, just move that field to the rpc_xprt.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      [ cel: simplify check_gss_callback_principal(), whitespace changes ]
      [ cel: forward ported to 3.4 ]
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      4e0038b6
    • T
      SUNRPC: Use RCU to dereference the rpc_clnt.cl_xprt field · 2446ab60
      Trond Myklebust 提交于
      A migration event will replace the rpc_xprt used by an rpc_clnt.  To
      ensure this can be done safely, all references to cl_xprt must now use
      a form of rcu_dereference().
      
      Special care is taken with rpc_peeraddr2str(), which returns a pointer
      to memory whose lifetime is the same as the rpc_xprt.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      [ cel: fix lockdep splats and layering violations ]
      [ cel: forward ported to 3.4 ]
      [ cel: remove rpc_max_reqs(), add rpc_net_ns() ]
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      2446ab60
  11. 28 2月, 2012 1 次提交
  12. 06 2月, 2012 1 次提交
  13. 01 2月, 2012 10 次提交
  14. 20 10月, 2011 1 次提交
  15. 20 7月, 2011 1 次提交
  16. 15 7月, 2011 1 次提交
  17. 13 7月, 2011 1 次提交
  18. 02 7月, 2011 1 次提交
  19. 17 6月, 2011 1 次提交
  20. 15 6月, 2011 1 次提交
  21. 28 5月, 2011 3 次提交
  22. 25 4月, 2011 1 次提交
  23. 18 3月, 2011 1 次提交
    • S
      RPC: killing RPC tasks races fixed · 8e26de23
      Stanislav Kinsbursky 提交于
      RPC task RPC_TASK_QUEUED bit is set must be checked before trying to wake up
      task rpc_killall_tasks() because task->tk_waitqueue can not be set (equal to
      NULL).
      Also, as Trond Myklebust mentioned, such approach (instead of checking
      tk_waitqueue to NULL) allows us to "optimise away the call to
      rpc_wake_up_queued_task() altogether for those
      tasks that aren't queued".
      
      Here is an example of dereferencing of tk_waitqueue equal to NULL:
      
      CPU 0               	CPU 1				CPU 2
      --------------------	---------------------	--------------------------
      nfs4_run_open_task
      rpc_run_task
      rpc_execute
      rpc_set_active
      rpc_make_runnable
      (waiting)
      			rpc_async_schedule
      			nfs4_open_prepare
      			nfs_wait_on_sequence
      						nfs_umount_begin
      						rpc_killall_tasks
      						rpc_wake_up_task
      						rpc_wake_up_queued_task
      						spin_lock(tk_waitqueue == NULL)
      						BUG()
      			rpc_sleep_on
      			spin_lock(&q->lock)
      			__rpc_sleep_on
      			task->tk_waitqueue = q
      Signed-off-by: NStanislav Kinsbursky <skinsbursky@openvz.org>
      Cc: stable@kernel.org
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      8e26de23
  24. 12 3月, 2011 1 次提交