1. 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
  2. 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
  3. 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
  4. 16 7月, 2008 5 次提交
  5. 30 4月, 2008 1 次提交
  6. 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
  7. 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
  8. 11 2月, 2008 2 次提交
  9. 02 2月, 2008 2 次提交
  10. 10 10月, 2007 1 次提交
  11. 27 9月, 2007 1 次提交
  12. 27 7月, 2007 1 次提交
  13. 07 5月, 2007 8 次提交
  14. 04 2月, 2007 1 次提交
  15. 14 12月, 2006 1 次提交
  16. 09 12月, 2006 1 次提交
  17. 21 10月, 2006 1 次提交
  18. 04 10月, 2006 5 次提交
  19. 02 10月, 2006 1 次提交
  20. 04 8月, 2006 1 次提交
  21. 01 7月, 2006 1 次提交