• Jan Schmidt's avatar
    Btrfs: fix locking on ROOT_REPLACE operations in tree mod log · d9abbf1c
    Jan Schmidt authored
    To resolve backrefs, ROOT_REPLACE operations in the tree mod log are
    required to be tied to at least one KEY_REMOVE_WHILE_FREEING operation.
    Therefore, those operations must be enclosed by tree_mod_log_write_lock()
    and tree_mod_log_write_unlock() calls.
    
    Those calls are private to the tree_mod_log_* functions, which means that
    removal of the elements of an old root node must be logged from
    tree_mod_log_insert_root. This partly reverts and corrects commit ba1bfbd5
    (Btrfs: fix a tree mod logging issue for root replacement operations).
    
    This fixes the brand-new version of xfstest 276 as of commit cfe73f71.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarJan Schmidt <list.btrfs@jan-o-sch.net>
    Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
    Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
    d9abbf1c
ctree.c 149 KB