• Kent Overstreet's avatar
    bcachefs: Fix bch2_btree_node_upgrade() · 62448afe
    Kent Overstreet authored
    Previously, if we were trying to upgrade from a read to an intent lock
    but we held an additional read lock via another btree_path,
    bch2_btree_node_upgrade() would always fail, in six_lock_tryupgrade().
    
    This patch factors out the code that __bch2_btree_node_lock_write() uses
    to temporarily drop extra read locks, so that six_lock_tryupgrade() can
    succeed.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
    62448afe
btree_locking.c 12.1 KB