Skip to content
Snippets Groups Projects
  • Chris Mason's avatar
    ea4ebde0
    Btrfs: fix deadlocks with trylock on tree nodes · ea4ebde0
    Chris Mason authored
    
    The Btrfs tree trylock function is poorly named.  It always takes
    the spinlock and backs off if the blocking lock is held.  This
    can lead to surprising lockups because people expect it to really be a
    trylock.
    
    This commit makes it a pure trylock, both for the spinlock and the
    blocking lock.  It also reworks the nested lock handling slightly to
    avoid taking the read lock while a spinning write lock might be held.
    
    Signed-off-by: default avatarChris Mason <clm@fb.com>
    ea4ebde0
    History
    Btrfs: fix deadlocks with trylock on tree nodes
    Chris Mason authored
    
    The Btrfs tree trylock function is poorly named.  It always takes
    the spinlock and backs off if the blocking lock is held.  This
    can lead to surprising lockups because people expect it to really be a
    trylock.
    
    This commit makes it a pure trylock, both for the spinlock and the
    blocking lock.  It also reworks the nested lock handling slightly to
    avoid taking the read lock while a spinning write lock might be held.
    
    Signed-off-by: default avatarChris Mason <clm@fb.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.