1. 01 12月, 2009 1 次提交
    • D
      dlm: always use GFP_NOFS · 573c24c4
      David Teigland 提交于
      Replace all GFP_KERNEL and ls_allocation with GFP_NOFS.
      ls_allocation would be GFP_KERNEL for userland lockspaces
      and GFP_NOFS for file system lockspaces.
      
      It was discovered that any lockspaces on the system can
      affect all others by triggering memory reclaim in the
      file system which could in turn call back into the dlm
      to acquire locks, deadlocking dlm threads that were
      shared by all lockspaces, like dlm_recv.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      573c24c4
  2. 12 3月, 2009 1 次提交
    • D
      dlm: fix length calculation in compat code · 1fecb1c4
      David Teigland 提交于
      Using offsetof() to calculate name length does not work because
      it does not produce consistent results with with structure packing.
      This caused memcpy to corrupt memory by copying 4 extra bytes off
      the end of the buffer on 64 bit kernels with 32 bit userspace
      (the only case where this 32/64 compat code is used).
      
      The fix is to calculate name length directly from the start instead
      of trying to derive it later using count and offsetof.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      1fecb1c4
  3. 24 12月, 2008 1 次提交
    • D
      dlm: improve how bast mode handling · fd22a51b
      David Teigland 提交于
      The lkb bastmode value is set in the context of processing the
      lock, and read by the dlm_astd thread.  Because it's accessed
      in these two separate contexts, the writing/reading ought to
      be done under a lock.  This is simple to do by setting it and
      reading it when the lkb is added to and removed from dlm_astd's
      callback list which is properly locked.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      fd22a51b
  4. 05 9月, 2008 1 次提交
  5. 29 8月, 2008 2 次提交
    • D
      dlm: detect available userspace daemon · dc68c7ed
      David Teigland 提交于
      If dlm_controld (the userspace daemon that controls the setup and
      recovery of the dlm) fails, the kernel should shut down the lockspaces
      in the kernel rather than leaving them running.  This is detected by
      having dlm_controld hold a misc device open while running, and if
      the kernel detects a close while the daemon is still needed, it stops
      the lockspaces in the kernel.
      
      Knowing that the userspace daemon isn't running also allows the
      lockspace create/remove routines to avoid waiting on the daemon
      for join/leave operations.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      dc68c7ed
    • D
      dlm: allow multiple lockspace creates · 0f8e0d9a
      David Teigland 提交于
      Add a count for lockspace create and release so that create can
      be called multiple times to use the lockspace from different places.
      Also add the new flag DLM_LSFL_NEWEXCL to create a lockspace with
      the previous behavior of returning -EEXIST if the lockspace already
      exists.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      0f8e0d9a
  6. 14 8月, 2008 1 次提交
  7. 15 7月, 2008 1 次提交
  8. 21 6月, 2008 1 次提交
  9. 07 2月, 2008 2 次提交
  10. 04 2月, 2008 1 次提交
  11. 31 1月, 2008 3 次提交
  12. 20 10月, 2007 1 次提交
  13. 09 7月, 2007 4 次提交
    • D
      [DLM] canceling deadlocked lock · 8b4021fa
      David Teigland 提交于
      Add a function that can be used through libdlm by a system daemon to cancel
      another process's deadlocked lock.  A completion ast with EDEADLK is returned
      to the process waiting for the lock.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      8b4021fa
    • D
      [DLM] timeout fixes · 84d8cd69
      David Teigland 提交于
      Various fixes related to the new timeout feature:
      - add_timeout() missed setting TIMEWARN flag on lkb's when the
        TIMEOUT flag was already set
      - clear_proc_locks should remove a dead process's locks from the
        timeout list
      - the end-of-life calculation for user locks needs to consider that
        ETIMEDOUT is equivalent to -DLM_ECANCEL
      - make initial default timewarn_cs config value visible in configfs
      - change bit position of TIMEOUT_CANCEL flag so it's not copied to
        a remote master node
      - set timestamp on remote lkb's so a lock dump will display the time
        they've been waiting
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      84d8cd69
    • D
      [DLM] dlm_device interface changes [3/6] · d7db923e
      David Teigland 提交于
      Change the user/kernel device interface used by libdlm:
      - Add ability for userspace to check the version of the interface.  libdlm
        can now adapt to different versions of the kernel interface.
      - Increase the size of the flags passed in a lock request so all possible
        flags can be used from userspace.
      - Add an opaque "xid" value for each lock.  This "transaction id" will be
        used later to associate locks with each other during deadlock detection.
      - Add a "timeout" value for each lock.  This is used along with the
        DLM_LKF_TIMEOUT flag.
      
      Also, remove a fragment of unused code in device_read().
      
      This patch requires updating libdlm which is backward compatible with
      older kernels.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      d7db923e
    • D
      [DLM] add lock timeouts and warnings [2/6] · 3ae1acf9
      David Teigland 提交于
      New features: lock timeouts and time warnings.  If the DLM_LKF_TIMEOUT
      flag is set, then the request/conversion will be canceled after waiting
      the specified number of centiseconds (specified per lock).  This feature
      is only available for locks requested through libdlm (can be enabled for
      kernel dlm users if there's a use for it.)
      
      If the new DLM_LSFL_TIMEWARN flag is set when creating the lockspace, then
      a warning message will be sent to userspace (using genetlink) after a
      request/conversion has been waiting for a given number of centiseconds
      (configurable per node).  The time warnings will be used in the future
      to do deadlock detection in userspace.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      3ae1acf9
  14. 01 5月, 2007 4 次提交
    • P
      [DLM] Remove redundant assignment · fc7c44f0
      Patrick Caulfield 提交于
      This patch removes a redundant (and incorrect) assignment from compat_output
      Signed-Off-By: NPatrick Caulfield <pcaulfie@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      fc7c44f0
    • D
      [DLM] interface for purge (2/2) · 72c2be77
      David Teigland 提交于
      Add code to accept purge commands from userland.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      72c2be77
    • D
      [DLM] overlapping cancel and unlock · ef0c2bb0
      David Teigland 提交于
      Full cancel and force-unlock support.  In the past, cancel and force-unlock
      wouldn't work if there was another operation in progress on the lock.  Now,
      both cancel and unlock-force can overlap an operation on a lock, meaning there
      may be 2 or 3 operations in progress on a lock in parallel.  This support is
      important not only because cancel and force-unlock are explicit operations
      that an app can use, but both are used implicitly when a process exits while
      holding locks.
      
      Summary of changes:
      
      - add-to and remove-from waiters functions were rewritten to handle situations
        with more than one remote operation outstanding on a lock
      
      - validate_unlock_args detects when an overlapping cancel/unlock-force
        can be sent and when it needs to be delayed until a request/lookup
        reply is received
      
      - processing request/lookup replies detects when cancel/unlock-force
        occured during the op, and carries out the delayed cancel/unlock-force
      
      - manipulation of the "waiters" (remote operation) state of a lock moved under
        the standard rsb mutex that protects all the other lock state
      
      - the two recovery routines related to locks on the waiters list changed
        according to the way lkb's are now locked before accessing waiters state
      
      - waiters recovery detects when lkb's being recovered have overlapping
        cancel/unlock-force, and may not recover such locks
      
      - revert_lock (cancel) returns a value to distinguish cases where it did
        nothing vs cases where it actually did a cancel; the cancel completion ast
        should only be done when cancel did something
      
      - orphaned locks put on new list so they can be found later for purging
      
      - cancel must be called on a lock when making it an orphan
      
      - flag user locks (ENDOFLIFE) at the end of their useful life (to the
        application) so we can return an error for any further cancel/unlock-force
      
      - we weren't setting COMP/BAST ast flags if one was already set, so we'd lose
        either a completion or blocking ast
      
      - clear an unread bast on a lock that's become unlocked
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      ef0c2bb0
    • P
      [DLM] Don't delete misc device if lockspace removal fails · 254da030
      Patrick Caulfield 提交于
      Currently if the lockspace removal fails the misc device associated with a
      lockspace is left deleted. After that there is no way to access the orphaned
      lockspace from userland.
      
      This patch recreates the misc device if th dlm_release_lockspace fails. I
      believe this is better than attempting to remove the lockspace first because
      that leaves an unattached device lying around. The potential gap in which there
      is no access to the lockspace between removing the misc device and recreating it
      is acceptable ... after all the application is trying to remove it, and only new
      users of the lockspace will be affected.
      Signed-Off-By: NPatrick Caulfield <pcaulfie@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      254da030
  15. 08 3月, 2007 1 次提交
  16. 13 2月, 2007 1 次提交
  17. 06 2月, 2007 1 次提交
    • D
      [DLM] fix user unlocking · a1bc86e6
      David Teigland 提交于
      When a user process exits, we clear all the locks it holds.  There is a
      problem, though, with locks that the process had begun unlocking before it
      exited.  We couldn't find the lkb's that were in the process of being
      unlocked remotely, to flag that they are DEAD.  To solve this, we move
      lkb's being unlocked onto a new list in the per-process structure that
      tracks what locks the process is holding.  We can then go through this
      list to flag the necessary lkb's when clearing locks for a process when it
      exits.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      a1bc86e6
  18. 01 9月, 2006 1 次提交
  19. 21 7月, 2006 1 次提交
  20. 20 7月, 2006 1 次提交
  21. 13 7月, 2006 1 次提交