1. 22 9月, 2009 1 次提交
  2. 25 4月, 2009 1 次提交
    • F
      lockd: call locks_release_private to cleanup per-filesystem state · a9e61e25
      Felix Blyakher 提交于
      For every lock request lockd creates a new file_lock object
      in nlmsvc_setgrantargs() by copying the passed in file_lock with
      locks_copy_lock(). A filesystem can attach it's own lock_operations
      vector to the file_lock. It has to be cleaned up at the end of the
      file_lock's life. However, lockd doesn't do it today, yet it
      asserts in nlmclnt_release_lockargs() that the per-filesystem
      state is clean.
      This patch fixes it by exporting locks_release_private() and adding
      it to nlmsvc_freegrantargs(), to be symmetrical to creating a
      file_lock in nlmsvc_setgrantargs().
      Signed-off-by: NFelix Blyakher <felixb@sgi.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      a9e61e25
  3. 19 3月, 2009 1 次提交
  4. 10 2月, 2009 1 次提交
    • J
      lockd: fix regression in lockd's handling of blocked locks · 9d9b87c1
      J. Bruce Fields 提交于
      If a client requests a blocking lock, is denied, then requests it again,
      then here in nlmsvc_lock() we will call vfs_lock_file() without FL_SLEEP
      set, because we've already queued a block and don't need the locks code
      to do it again.
      
      But that means vfs_lock_file() will return -EAGAIN instead of
      FILE_LOCK_DENIED.  So we still need to translate that -EAGAIN return
      into a nlm_lck_blocked error in this case, and put ourselves back on
      lockd's block list.
      
      The bug was introduced by bde74e4b "locks: add special return
      value for asynchronous locks".
      
      Thanks to Frank van Maarseveen for the report; his original test
      case was essentially
      
      	for i in `seq 30`; do flock /nfsmount/foo sleep 10 & done
      Tested-by: NFrank van Maarseveen <frankvm@frankvm.com>
      Reported-by: NFrank van Maarseveen <frankvm@frankvm.com>
      Cc: Miklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      9d9b87c1
  5. 04 10月, 2008 2 次提交
    • J
      lockd: reject reclaims outside the grace period · d22b1cff
      J. Bruce Fields 提交于
      The current lockd does not reject reclaims that arrive outside of the
      grace period.
      
      Accepting a reclaim means promising to the client that no conflicting
      locks were granted since last it held the lock.  We can meet that
      promise if we assume the only lockers are nfs clients, and that they are
      sufficiently well-behaved to reclaim only locks that they held before,
      and that only reclaim locks have been permitted so far.  Once we leave
      the grace period (and start permitting non-reclaims), we can no longer
      keep that promise.  So we must start rejecting reclaims at that point.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      d22b1cff
    • J
      lockd: move grace period checks to common code · b2b50289
      J. Bruce Fields 提交于
      Do all the grace period checks in svclock.c.  This simplifies the code a
      bit, and will ease some later changes.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      b2b50289
  6. 26 7月, 2008 1 次提交
    • 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
  7. 16 7月, 2008 5 次提交
  8. 30 4月, 2008 1 次提交
  9. 26 4月, 2008 1 次提交
    • 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
  10. 24 4月, 2008 2 次提交
    • J
      lockd: Fix stale nlmsvc_unlink_block comment · 3c61eecb
      J. Bruce Fields 提交于
      As of 5996a298 ("NLM: don't unlock on
      cancel requests") we no longer unlock in this case, so the comment is no
      longer accurate.
      
      Thanks to Stuart Friedberg for pointing out the inconsistency.
      
      Cc: Stuart Friedberg <sfriedberg@hp.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      3c61eecb
    • J
      NLM: Convert lockd to use kthreads · d751a7cd
      Jeff Layton 提交于
      Have lockd_up start lockd using kthread_run. With this change,
      lockd_down now blocks until lockd actually exits, so there's no longer
      need for the waitqueue code at the end of lockd_down. This also means
      that only one lockd can be running at a time which simplifies the code
      within lockd's main loop.
      
      This also adds a check for kthread_should_stop in the main loop of
      nlmsvc_retry_blocked and after that function returns. There's no sense
      continuing to retry blocks if lockd is coming down anyway.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      d751a7cd
  11. 11 2月, 2008 2 次提交
  12. 02 2月, 2008 2 次提交
  13. 10 10月, 2007 1 次提交
  14. 27 9月, 2007 1 次提交
  15. 27 7月, 2007 1 次提交
  16. 07 5月, 2007 8 次提交
  17. 04 2月, 2007 1 次提交
  18. 14 12月, 2006 1 次提交
  19. 09 12月, 2006 1 次提交
  20. 21 10月, 2006 1 次提交
  21. 04 10月, 2006 5 次提交