1. 30 9月, 2008 5 次提交
    • C
      lockd: address-family independent printable addresses · 1b333c54
      Chuck Lever 提交于
      Knowing which source address is used for communicating with remote NLM
      services can be helpful for debugging configuration problems on hosts
      with multiple addresses.
      
      Keep the dprintk debugging here, but adapt it so it displays AF_INET6
      addresses properly.  There are also a couple of dprintk clean-ups as
      well.
      
      At some point we will aggregate the helpers that display presentation
      format addresses into a single set of shared helpers.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      1b333c54
    • C
      NLM: Clean up before introducing new debugging messages · c2526f42
      Chuck Lever 提交于
      We're about to introduce some extra debugging messages in nlm_lookup_host().
      Bring the coding style up to date first so we can cleanly introduce the new
      debugging messages.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      c2526f42
    • J
      lockd: don't depend on lockd main loop to end grace · c8ab5f2a
      J. Bruce Fields 提交于
      End lockd's grace period using schedule_delayed_work() instead of a
      check on every pass through the main loop.
      
      After a later patch, we'll depend on lockd to end its grace period even
      if it's not currently handling requests; so it shouldn't depend on being
      woken up from the main loop to do so.
      
      Also, Nakano Hiroaki (who independently produced a similar patch)
      noticed that the current behavior is buggy in the face of jiffies
      wraparound:
      
      	"lockd uses time_before() to determine whether the grace period
      	has expired. This would seem to be enough to avoid timer
      	wrap-around issues, but, unfortunately, that is not the case.
      	The time_* family of comparison functions can be safely used to
      	compare jiffies relatively close in time, but they stop working
      	after approximately LONG_MAX/2 ticks. nfsd can suffer this
      	problem because the time_before() comparison in lockd() is not
      	performed until the first request comes in, which means that if
      	there is no lockd traffic for more than LONG_MAX/2 ticks we are
      	screwed.
      
      	"The implication of this is that once time_before() starts
      	misbehaving any attempt from a NFS client to execute fcntl()
      	will be received with a NLM_LCK_DENIED_GRACE_PERIOD message for
      	25 days (assuming HZ=1000). In other words, the 50 seconds grace
      	period could turn into a grace period of 50 days or more.
      
      	"Note: This bug was analyzed independently by Oda-san
      	<oda@valinux.co.jp> and myself."
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Cc: Nakano Hiroaki <nakano.hiroaki@oss.ntt.co.jp>
      Cc: Itsuro Oda <oda@valinux.co.jp>
      c8ab5f2a
    • J
      locks: allow lockd to process blocked locks during grace period · 8fafa900
      J. Bruce Fields 提交于
      The check here is currently harmless but unnecessary, since, as the
      comment notes, there aren't any blocked-lock callbacks to process
      during the grace period anyway.
      
      And eventually we want to allow multiple grace periods that come and go
      for different filesystems over the course of the lifetime of lockd, at
      which point this check is just going to get in the way.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      8fafa900
    • C
      SUNRPC: Add address family field to svc_serv data structure · e851db5b
      Chuck Lever 提交于
      Introduce and initialize an address family field in the svc_serv structure.
      
      This field will determine what family to use for the service's listener
      sockets and what families are advertised via the local rpcbind daemon.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      e851db5b
  2. 26 7月, 2008 2 次提交
    • M
      locks: add special return value for asynchronous locks · bde74e4b
      Miklos Szeredi 提交于
      Use a special error value FILE_LOCK_DEFERRED to mean that a locking
      operation returned asynchronously.  This is returned by
      
        posix_lock_file() for sleeping locks to mean that the lock has been
        queued on the block list, and will be woken up when it might become
        available and needs to be retried (either fl_lmops->fl_notify() is
        called or fl_wait is woken up).
      
        f_op->lock() to mean either the above, or that the filesystem will
        call back with fl_lmops->fl_grant() when the result of the locking
        operation is known.  The filesystem can do this for sleeping as well
        as non-sleeping locks.
      
      This is to make sure, that return values of -EAGAIN and -EINPROGRESS by
      filesystems are not mistaken to mean an asynchronous locking.
      
      This also makes error handling in fs/locks.c and lockd/svclock.c slightly
      cleaner.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: David Teigland <teigland@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bde74e4b
    • M
      lockd: dont return EAGAIN for a permanent error · cc77b152
      Miklos Szeredi 提交于
      Fix nlm_fopen() to return NLM_FAILED (or NLM_LCK_DENIED_NOLOCKS) instead
      of NLM_LCK_DENIED.  The latter means the lock request failed because of a
      conflicting lock (i.e.  a temporary error), which is wrong in this case.
      
      Also fix the client to return ENOLCK instead of EAGAIN if a blocking lock
      request returns with NLM_LOCK_DENIED.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: David Teigland <teigland@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cc77b152
  3. 23 7月, 2008 1 次提交
  4. 16 7月, 2008 8 次提交
  5. 24 6月, 2008 1 次提交
  6. 30 4月, 2008 1 次提交
  7. 26 4月, 2008 3 次提交
    • J
      locks: don't call ->copy_lock methods on return of conflicting locks · 1a747ee0
      J. Bruce Fields 提交于
      The file_lock structure is used both as a heavy-weight representation of
      an active lock, with pointers to reference-counted structures, etc., and
      as a simple container for parameters that describe a file lock.
      
      The conflicting lock returned from __posix_lock_file is an example of
      the latter; so don't call the filesystem or lock manager callbacks when
      copying to it.  This also saves the need for an unnecessary
      locks_init_lock in the nfsv4 server.
      
      Thanks to Trond for pointing out the error.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      1a747ee0
    • 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
  8. 24 4月, 2008 8 次提交
  9. 20 4月, 2008 7 次提交
  10. 20 3月, 2008 4 次提交