1. 03 5月, 2010 1 次提交
    • N
      sunrpc: centralise most calls to svc_xprt_received · b48fa6b9
      Neil Brown 提交于
      svc_xprt_received must be called when ->xpo_recvfrom has finished
      receiving a message, so that the XPT_BUSY flag will be cleared and
      if necessary, requeued for further work.
      
      This call is currently made in each ->xpo_recvfrom function, often
      from multiple different points.  In each case it is the earliest point
      on a particular path where it is known that the protection provided by
      XPT_BUSY is no longer needed.
      
      However there are (still) some error paths which do not call
      svc_xprt_received, and requiring each ->xpo_recvfrom to make the call
      does not encourage robustness.
      
      So: move the svc_xprt_received call to be made just after the
      call to ->xpo_recvfrom(), and move it of the various ->xpo_recvfrom
      methods.
      
      This means that it may not be called at the earliest possible instant,
      but this is unlikely to be a measurable performance issue.
      
      Note that there are still other calls to svc_xprt_received as it is
      also needed when an xprt is newly created.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      b48fa6b9
  2. 30 3月, 2010 1 次提交
  3. 24 3月, 2010 1 次提交
  4. 15 3月, 2010 3 次提交
    • N
      sunrpc: never return expired entries in sunrpc_cache_lookup · d202cce8
      NeilBrown 提交于
      If sunrpc_cache_lookup finds an expired entry, remove it from
      the cache and return a freshly created non-VALID entry instead.
      This ensures that we only ever get a usable entry, or an
      entry that will become usable once an update arrives.
      i.e. we will never need to repeat the lookup.
      
      This allows us to remove the 'is_expired' test from cache_check
      (i.e. from cache_is_valid).  cache_check should never get an expired
      entry as 'lookup' will never return one.  If it does happen - due to
      inconvenient timing - then just accept it as still valid, it won't be
      very much past it's use-by date.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      d202cce8
    • N
      sunrpc/cache: factor out cache_is_expired · 2f50d8b6
      NeilBrown 提交于
      This removes a tiny bit of code duplication, but more important
      prepares for following patch which will perform the expiry check in
      cache_lookup and the rest of the validity check in cache_check.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      2f50d8b6
    • N
      sunrpc: don't keep expired entries in the auth caches. · 3af4974e
      NeilBrown 提交于
      currently expired entries remain in the auth caches as long
      as there is a reference.
      This was needed long ago when the auth_domain cache used the same
      cache infrastructure.  But since that (being a very different sort
      of cache) was separated, this test is no longer needed.
      
      So remove the test on refcnt and tidy up the surrounding code.
      
      This allows the cache_dequeue call (which needed to be there to
      drop a potentially awkward reference) can be moved outside of the
      spinlock which is a better place for it.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      3af4974e
  5. 07 3月, 2010 1 次提交
  6. 04 3月, 2010 1 次提交
  7. 03 3月, 2010 2 次提交
  8. 01 3月, 2010 3 次提交
  9. 27 2月, 2010 1 次提交
    • N
      sunrpc: remove unnecessary svc_xprt_put · ab1b18f7
      Neil Brown 提交于
      The 'struct svc_deferred_req's on the xpt_deferred queue do not
      own a reference to the owning xprt.  This is seen in svc_revisit
      which is where things are added to this queue.  dr->xprt is set to
      NULL and the reference to the xprt it put.
      
      So when this list is cleaned up in svc_delete_xprt, we mustn't
      put the reference.
      
      Also, replace the 'for' with a 'while' which is arguably
      simpler and more likely to compile efficiently.
      
      Cc: Tom Tucker <tom@opengridcomputing.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Cc: stable@kernel.org
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      ab1b18f7
  10. 15 2月, 2010 1 次提交
  11. 10 2月, 2010 5 次提交
  12. 27 1月, 2010 4 次提交
  13. 07 1月, 2010 2 次提交
    • X
      sunrpc: fix peername failed on closed listener · b292cf9c
      Xiaotian Feng 提交于
      There're some warnings of "nfsd: peername failed (err 107)!"
      socket error -107 means Transport endpoint is not connected.
      This warning message was outputed by svc_tcp_accept() [net/sunrpc/svcsock.c],
      when kernel_getpeername returns -107. This means socket might be CLOSED.
      
      And svc_tcp_accept was called by svc_recv() [net/sunrpc/svc_xprt.c]
      
              if (test_bit(XPT_LISTENER, &xprt->xpt_flags)) {
              <snip>
                      newxpt = xprt->xpt_ops->xpo_accept(xprt);
              <snip>
      
      So this might happen when xprt->xpt_flags has both XPT_LISTENER and XPT_CLOSE.
      
      Let's take a look at commit b0401d72, this commit has moved the close
      processing after do recvfrom method, but this commit also introduces this
      warnings, if the xpt_flags has both XPT_LISTENER and XPT_CLOSED, we should
      close it, not accpet then close.
      Signed-off-by: NXiaotian Feng <dfeng@redhat.com>
      Cc: J. Bruce Fields <bfields@fieldses.org>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: stable@kernel.org
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      b292cf9c
    • R
      sunrpc: fix build-time warning · 6c853099
      Randy Dunlap 提交于
      Fix auth_gss printk format warning:
      
      net/sunrpc/auth_gss/auth_gss.c:660: warning: format '%ld' expects type 'long int', but argument 3 has type 'ssize_t'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      6c853099
  14. 19 12月, 2009 3 次提交
  15. 16 12月, 2009 2 次提交
  16. 10 12月, 2009 1 次提交
  17. 09 12月, 2009 1 次提交
  18. 04 12月, 2009 7 次提交
    • A
      tree-wide: fix assorted typos all over the place · af901ca1
      André Goddard Rosa 提交于
      That is "success", "unknown", "through", "performance", "[re|un]mapping"
      , "access", "default", "reasonable", "[con]currently", "temperature"
      , "channel", "[un]used", "application", "example","hierarchy", "therefore"
      , "[over|under]flow", "contiguous", "threshold", "enough" and others.
      Signed-off-by: NAndré Goddard Rosa <andre.goddard@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      af901ca1
    • C
      SUNRPC: soft connect semantics for UDP · 3a28becc
      Chuck Lever 提交于
      Introduce soft connect behavior for UDP transports.  In this case, a
      major timeout returns ETIMEDOUT instead of EIO.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      3a28becc
    • C
      SUNRPC: Use soft connect semantics when performing RPC ping · caabea8a
      Chuck Lever 提交于
      Currently, if a remote RPC service is unreachable, an RPC ping will
      hang until the underlying transport connect attempt times out.  A more
      desirable behavior might be to have the ping fail immediately so upper
      layers can recover appropriately.
      
      In the case of an NFS mount, for instance, this would mean the
      mount(2) system call could fail immediately if the server isn't
      listening, rather than hanging uninterruptibly for more than 3
      minutes.
      
      Change rpc_ping() so that it fails immediately for connection-oriented
      transports.  rpc_create() will then fail immediately for such
      transports if an RPC ping was requested.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      caabea8a
    • C
      SUNRPC: Use soft connects for autobinding over TCP · 012da158
      Chuck Lever 提交于
      Autobinding is handled by the rpciod process, not in user processes
      that are generating regular RPC requests.  Thus autobinding is usually
      not affected by signals targetting user processes, such as KILL or
      timer expiration events.
      
      In addition, an RPC request generated by a user process that has
      RPC_TASK_SOFTCONN set and needs to perform an autobind will hang if
      the remote rpcbind service is not available.
      
      For rpcbind queries on connection-oriented transports, let's use the
      new soft connect semantic to return control to the user's process
      quickly, if the kernel's rpcbind client can't connect to the remote
      rpcbind service.
      
      Logic is introduced in call_bind_status() to handle connection errors
      that occurred during an asynchronous rpcbind query.  The logic
      abandons the rpcbind query if the RPC request has SOFTCONN set, and
      retries after a few seconds in the normal case.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      012da158
    • C
      SUNRPC: Use TCP for local rpcbind upcalls · 2a76b3bf
      Chuck Lever 提交于
      Use TCP with the soft connect semantic for local rpcbind upcalls so
      the kernel can detect immediately if the local rpcbind daemon is not
      running.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      2a76b3bf
    • C
      SUNRPC: Use a cached RPC client and transport for rpcbind upcalls · c526611d
      Chuck Lever 提交于
      The kernel's rpcbind client creates and deletes an rpc_clnt and its
      underlying transport socket for every upcall to the local rpcbind
      daemon.
      
      When starting a typical NFS server on IPv4 and IPv6, the NFS service
      itself does three upcalls (one per version) times two upcalls (one
      per transport) times two upcalls (one per address family), making 12,
      plus another one for the initial call to unregister previous NFS
      services.  Starting the NLM service adds an additional 13 upcalls,
      for similar reasons.
      
      (Currently the NFS service doesn't start IPv6 listeners, but it will
      soon enough).
      
      Instead, let's create an rpc_clnt for rpcbind upcalls during the
      first local rpcbind query, and cache it.  This saves the overhead of
      creating and destroying an rpc_clnt and a socket for every upcall.
      
      The new logic also prevents the kernel from attempting an RPCB_SET or
      RPCB_UNSET if it knows from the start that the local portmapper does
      not support rpcbind protocol version 4.  This will cut down on the
      number of rpcbind upcalls in legacy environments.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      c526611d
    • C
      SUNRPC: Simplify synopsis of rpcb_local_clnt() · 5a462115
      Chuck Lever 提交于
      Clean up: At one point, rpcb_local_clnt() handled IPv6 loopback
      addresses too, but it doesn't any more; only IPv4 loopback is used
      now.  Get rid of the @addr and @addrlen arguments to
      rpcb_local_clnt().
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      5a462115