1. 17 12月, 2010 6 次提交
    • C
      lockd: Clean up nlmsvc_lookup_host() · 67216b94
      Chuck Lever 提交于
      Clean up.
      
      Change nlmsvc_lookup_host() to be purpose-built for server-side
      nlm_host management.  This replaces the generic nlm_lookup_host()
      helper function, just like on the client side.  The lookup logic is
      specialized for server host lookups.
      
      The server side cache also gets its own specialized equivalent of the
      nlm_release_host() function.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      67216b94
    • C
      lockd: Create client-side nlm_host cache · 8ea6ecc8
      Chuck Lever 提交于
      NFS clients don't need the garbage collection processing that is
      performed on nlm_host structures.  The client picks up an nlm_host at
      mount time and holds a reference to it until the file system is
      unmounted.
      
      Servers, on the other hand, don't have a precise way to tell when an
      nlm_host is no longer being used, so zero refcount nlm_host entries
      are left to expire in the cache after a time.
      
      Basically there's nothing holding a reference to an nlm_host between
      individual server-side NLM requests, but we can't afford the expense
      of recreating them for every new NLM request from a client.  The
      nlm_host cache adds some lifetime hysteresis to entries in the cache
      so the next time a particular nlm_host is needed, it's likely to be
      discovered by a lookup rather than created from whole cloth.
      
      With the new implementation, client nlm_host cache items are no longer
      garbage collected, and are destroyed directly by a new release
      function specialized for client entries, nlmclnt_release_host().  They
      are cached in their own data structure, and have their own lookup
      logic, simplified and specialized for client nlm_host entries.
      
      However, the client nlm_host cache still shares reboot recovery logic
      with the server nlm_host cache.  The NSM "peer rebooted" downcall for
      clients and servers still come through the same RPC call.  This is a
      legacy formal API that would be difficult to alter, and besides, the
      user space NSM implementation can't tell the difference between peers
      that are clients or servers.
      
      For this reason, the client cache continues to share the
      nlm_host_mutex (and reboot recovery logic) with the server cache.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      8ea6ecc8
    • C
      lockd: Add nlm_destroy_host_locked() · 723bb5b5
      Chuck Lever 提交于
      Refactor the tail of nlm_gc_hosts() into nlm_destroy_host() so that
      this logic can be used separately from garbage collection.
      
      Rename it _locked() to document that it must be called with the hosts
      cache mutex held.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      723bb5b5
    • C
      lockd: Add nlm_alloc_host() · a7952f40
      Chuck Lever 提交于
      Refactor nlm_host allocation and initialization into a separate
      function.  This will be the common piece of server and client nlm_host
      lookup logic after the nlm_host cache is split.
      
      Small change: use kmalloc() instead of kzalloc(), as we're overwriting
      almost all fields in the new nlm_host struct with non-zero values
      immediately after it is allocated.  An added benefit is we now have an
      explicit reference to each field name where it is initialized (for all
      you cscope fans out there).
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      a7952f40
    • J
      lockd: reorganize nlm_host_rebooted · b10e30f6
      J. Bruce Fields 提交于
      Minor reorganization; no change in behavior.  This will save some
      duplicated code after we split the client and server host caches.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      [ cel: Forward-ported to 2.6.37 ]
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      b10e30f6
    • J
      lockd: define host_for_each{_safe} macros · b1137468
      J. Bruce Fields 提交于
      We've got a lot of loops like this, and I find them a little easier to
      read with the macros.  More such loops are coming.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      [ cel: Forward-ported to 2.6.37 ]
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      b1137468
  2. 16 11月, 2010 1 次提交
    • T
      NLM: Fix a regression in lockd · 8e35f8e7
      Trond Myklebust 提交于
      Nick Bowler reports:
      There are no unusual messages on the client... but I just logged into
      the server and I see lots of messages of the following form:
      
        nfsd: request from insecure port (192.168.8.199:35766)!
        nfsd: request from insecure port (192.168.8.199:35766)!
        nfsd: request from insecure port (192.168.8.199:35766)!
        nfsd: request from insecure port (192.168.8.199:35766)!
        nfsd: request from insecure port (192.168.8.199:35766)!
      
      Bisected to commit 92476850 (SUNRPC:
      Properly initialize sock_xprt.srcaddr in all cases)
      
      Apparently, removing the 'transport->srcaddr.ss_family = family' from
      xs_create_sock() triggers this due to nlmclnt_lookup_host() incorrectly
      initialising the srcaddr family to AF_UNSPEC.
      Reported-by: NNick Bowler <nbowler@elliptictech.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      8e35f8e7
  3. 02 10月, 2010 1 次提交
  4. 09 2月, 2010 1 次提交
  5. 21 8月, 2009 1 次提交
  6. 10 8月, 2009 1 次提交
  7. 07 1月, 2009 11 次提交
  8. 24 12月, 2008 1 次提交
  9. 25 11月, 2008 1 次提交
    • C
      NLM: client-side nlm_lookup_host() should avoid matching on srcaddr · a8d82d9b
      Chuck Lever 提交于
      Since commit c98451bd, the loop in nlm_lookup_host() unconditionally
      compares the host's h_srcaddr field to the incoming source address.
      For client-side nlm_host entries, both are always AF_UNSPEC, so this
      check is unnecessary.
      
      Since commit 781b61a6, which added support for AF_INET6 addresses to
      nlm_cmp_addr(), nlm_cmp_addr() now returns FALSE for AF_UNSPEC
      addresses, which causes nlm_lookup_host() to create a fresh nlm_host
      entry every time it is called on the client.
      
      These extra entries will eventually expire once the server is
      unmounted, so the impact of this regression, introduced with lockd
      IPv6 support in 2.6.28, should be minor.
      
      We could fix this by adding an arm in nlm_cmp_addr() for AF_UNSPEC
      addresses, but really, nlm_lookup_host() shouldn't be matching on the
      srcaddr field for client-side nlm_host lookups.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      a8d82d9b
  10. 31 10月, 2008 1 次提交
  11. 30 10月, 2008 1 次提交
  12. 29 10月, 2008 1 次提交
  13. 04 10月, 2008 4 次提交
  14. 30 9月, 2008 9 次提交