1. 07 1月, 2009 10 次提交
    • C
      NSM: Generate NSMPROC_MON's "priv" argument when nsm_handle is created · 7e44d3be
      Chuck Lever 提交于
      Introduce a new data type, used by both the in-kernel NLM and NSM
      implementations, that is used to manage the opaque "priv" argument
      for the NSMPROC_MON and NLMPROC_SM_NOTIFY calls.
      
      Construct the "priv" cookie when the nsm_handle is created.
      
      The nsm_init_private() function may look a little strange, but it is
      roughly equivalent to how the XDR encoder formed the "priv" argument.
      It's going to go away soon.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      7e44d3be
    • C
      NSM: Move nsm_find() to fs/lockd/mon.c · 67c6d107
      Chuck Lever 提交于
      The nsm_find() function sets up fresh nsm_handle entries.  This is
      where we will store the "priv" cookie used to lookup nsm_handles during
      reboot recovery.  The cookie will be constructed when nsm_find()
      creates a new nsm_handle.
      
      As much as possible, I would like to keep everything that handles a
      "priv" cookie in fs/lockd/mon.c so that all the smarts are in one
      source file.  That organization should make it pretty simple to see how
      all this works.
      
      To me, it makes more sense than the current arrangement to keep
      nsm_find() with nsm_monitor() and nsm_unmonitor().
      
      So, start reorganizing by moving nsm_find() into fs/lockd/mon.c.  The
      nsm_release() function comes along too, since it shares the nsm_lock
      global variable.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      67c6d107
    • C
      NLM: Move the public declaration of nsm_unmonitor() to lockd.h · 356c3eb4
      Chuck Lever 提交于
      Clean up.
      
      Make the nlm_host argument "const," and move the public declaration to
      lockd.h.  Add a documenting comment.
      
      Bruce observed that nsm_unmonitor()'s only caller doesn't care about
      its return code, so make nsm_unmonitor() return void.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      356c3eb4
    • C
      NSM: Release nsmhandle in nlm_destroy_host · c8c23c42
      Chuck Lever 提交于
      The nsm_handle's reference count is bumped in nlm_lookup_host().  It
      should be decremented in nlm_destroy_host() to make it easier to see
      the balance of these two operations.
      
      Move the nsm_release() call to fs/lockd/host.c.
      
      The h_nsmhandle pointer is set in nlm_lookup_host(), and never cleared.
      The nlm_destroy_host() function is never called for the same nlm_host
      twice, so h_nsmhandle won't ever be NULL when nsm_unmonitor() is
      called.
      
      All references to the nlm_host are gone before it is freed.  We can
      skip making h_nsmhandle NULL just before the nlm_host is deallocated.
      
      It's also likely we can remove the h_nsmhandle NULL check in
      nlmsvc_is_client() as well, but we can do that later when rearchitect-
      ing the nlm_host cache.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      c8c23c42
    • C
      NLM: Move the public declaration of nsm_monitor() to lockd.h · 1e49323c
      Chuck Lever 提交于
      Clean up.
      
      Make the nlm_host argument "const," and move the public declaration to
      lockd.h with other NSM public function (nsm_release, eg) and global
      variable declarations.
      
      Add a documenting comment.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      1e49323c
    • C
      NSM: Support IPv6 version of mon_name · 29ed1407
      Chuck Lever 提交于
      The "mon_name" argument of the NSMPROC_MON and NSMPROC_UNMON upcalls
      is a string that contains the hostname or IP address of the remote peer
      to be notified when this host has rebooted.  The sm-notify command uses
      this identifier to contact the peer when we reboot, so it must be
      either a well-qualified DNS hostname or a presentation format IP
      address string.
      
      When the "nsm_use_hostnames" sysctl is set to zero, the kernel's NSM
      provides a presentation format IP address in the "mon_name" argument.
      Otherwise, the "caller_name" argument from NLM requests is used,
      which is usually just the DNS hostname of the peer.
      
      To support IPv6 addresses for the mon_name argument, we use the
      nsm_handle's address eye-catcher, which already contains an appropriate
      presentation format address string.  Using the eye-catcher string
      obviates the need to use a large buffer on the stack to form the
      presentation address string for the upcall.
      
      This patch also addresses a subtle bug.
      
      An NSMPROC_MON request and the subsequent NSMPROC_UNMON request for the
      same peer are required to use the same value for the "mon_name"
      argument.  Otherwise, rpc.statd's NSMPROC_UNMON processing cannot
      locate the database entry for that peer and remove it.
      
      If the setting of nsm_use_hostnames is changed between the time the
      kernel sends an NSMPROC_MON request and the time it sends the
      NSMPROC_UNMON request for the same peer, the "mon_name" argument for
      these two requests may not be the same.  This is because the value of
      "mon_name" is currently chosen at the moment the call is made based on
      the setting of nsm_use_hostnames
      
      To ensure both requests pass identical contents in the "mon_name"
      argument, we now select which string to use for the argument in the
      nsm_monitor() function.  A pointer to this string is saved in the
      nsm_handle so it can be used for a subsequent NSMPROC_UNMON upcall.
      
      NB: There are other potential problems, such as how nlm_host_rebooted()
      might behave if nsm_use_hostnames were changed while hosts are still
      being monitored.  This patch does not attempt to address those
      problems.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      29ed1407
    • C
      NSM: Use modern style for sm_name field in nsm_handle · f47534f7
      Chuck Lever 提交于
      Clean up: I'm about to add another "char *" field to the nsm_handle
      structure.  The sm_name field uses an older style of declaring a
      "char *" field.  If I match that style for the new field, checkpatch.pl
      will complain.
      
      So, fix the sm_name field to use the new style.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      f47534f7
    • C
      NLM: Support IPv6 scope IDs in nlm_display_address() · bc995801
      Chuck Lever 提交于
      Scope ID support is needed since the kernel's NSM implementation is
      about to use these displayed addresses as a mon_name in some cases.
      
      When nsm_use_hostnames is zero, without scope ID support NSM will fail
      to handle peers that contact us via a link-local address.  Link-local
      addresses do not work without an interface ID, which is stored in the
      sockaddr's sin6_scope_id field.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      bc995801
    • C
      NLM: Remove address eye-catcher buffers from nlm_host · 1df40b60
      Chuck Lever 提交于
      The h_name field in struct nlm_host is a just copy of
      h_nsmhandle->sm_name.  Likewise, the contents of the h_addrbuf field
      should be identical to the sm_addrbuf field.
      
      The h_srcaddrbuf field is used only in one place for debugging.  We can
      live without this until we get %pI formatting for printk().
      
      Currently these buffers are 48 bytes, but we need to support scope IDs
      in IPv6 presentation addresses, which means making the buffers even
      larger.  Instead, let's find ways to eliminate them to save space.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      1df40b60
    • C
      NLM: Use modern style for pointer fields in nlm_host · 7538ce1e
      Chuck Lever 提交于
      Clean up: I'm about to add another "char *" field to the nlm_host
      structure.  The h_name field, for example, uses an older style of
      declaring a "char *" field.  If I match that style for the new field,
      checkpatch.pl will complain.
      
      So, fix pointer fields to use the new style.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      7538ce1e
  2. 24 12月, 2008 1 次提交
  3. 04 10月, 2008 5 次提交
  4. 30 9月, 2008 5 次提交
  5. 16 7月, 2008 3 次提交
  6. 26 4月, 2008 2 次提交
    • W
      lockd: unlock lockd locks held for a certain filesystem · 17efa372
      Wendy Cheng 提交于
      Add /proc/fs/nfsd/unlock_filesystem, which allows e.g.:
      
      shell> echo /mnt/sfs1 > /proc/fs/nfsd/unlock_filesystem
      
      so that a filesystem can be unmounted before allowing a peer nfsd to
      take over nfs service for the filesystem.
      Signed-off-by: NS. Wendy Cheng <wcheng@redhat.com>
      Cc: Lon Hohberger  <lhh@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      
       fs/lockd/svcsubs.c          |   66 +++++++++++++++++++++++++++++++++++++++-----
       fs/nfsd/nfsctl.c            |   65 +++++++++++++++++++++++++++++++++++++++++++
       include/linux/lockd/lockd.h |    7 ++++
       3 files changed, 131 insertions(+), 7 deletions(-)
      17efa372
    • W
      lockd: unlock lockd locks associated with a given server ip · 4373ea84
      Wendy Cheng 提交于
      For high-availability NFS service, we generally need to be able to drop
      file locks held on the exported filesystem before moving clients to a
      new server.  Currently the only way to do that is by shutting down lockd
      entirely, which is often undesireable (for example, if you want to
      continue exporting other filesystems).
      
      This patch allows the administrator to release all locks held by clients
      accessing the client through a given server ip address, by echoing that
      address to a new file, /proc/fs/nfsd/unlock_ip, as in:
      
      shell> echo 10.1.1.2 > /proc/fs/nfsd/unlock_ip
      
      The expected sequence of events can be:
      1. Tear down the IP address
      2. Unexport the path
      3. Write IP to /proc/fs/nfsd/unlock_ip to unlock files
      4. Signal peer to begin take-over.
      
      For now we only support IPv4 addresses and NFSv2/v3 (NFSv4 locks are not
      affected).
      
      Also, if unmounting the filesystem is required, we assume at step 3 that
      clients using the given server ip are the only clients holding locks on
      the given filesystem; otherwise, an additional patch is required to
      allow revoking all locks held by lockd on a given filesystem.
      Signed-off-by: NS. Wendy Cheng <wcheng@redhat.com>
      Cc: Lon Hohberger  <lhh@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      
       fs/lockd/svcsubs.c          |   66 +++++++++++++++++++++++++++++++++++++++-----
       fs/nfsd/nfsctl.c            |   65 +++++++++++++++++++++++++++++++++++++++++++
       include/linux/lockd/lockd.h |    7 ++++
       3 files changed, 131 insertions(+), 7 deletions(-)
      4373ea84
  7. 20 4月, 2008 1 次提交
  8. 20 3月, 2008 2 次提交
  9. 02 2月, 2008 1 次提交
  10. 11 7月, 2007 1 次提交
  11. 07 5月, 2007 2 次提交
  12. 01 5月, 2007 1 次提交
  13. 14 12月, 2006 1 次提交
  14. 09 12月, 2006 1 次提交
  15. 08 12月, 2006 1 次提交
  16. 21 10月, 2006 1 次提交
  17. 04 10月, 2006 2 次提交