1. 04 10月, 2008 5 次提交
  2. 30 9月, 2008 14 次提交
  3. 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
  4. 23 7月, 2008 1 次提交
  5. 16 7月, 2008 8 次提交
  6. 24 6月, 2008 1 次提交
  7. 30 4月, 2008 1 次提交
  8. 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
  9. 24 4月, 2008 5 次提交