]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Btrfs: fix locking on ROOT_REPLACE operations in tree mod log
authorJan Schmidt <list.btrfs@jan-o-sch.net>
Wed, 20 Mar 2013 13:49:48 +0000 (13:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2013 16:26:02 +0000 (09:26 -0700)
commit8e0bf542fadde9a9ef58c46fa1411dd6cdfb3b14
tree2b5bed12a68e37234954da4a3c222622038bcb6b
parentb9cde88f39769f464346db07253ce926e671a6e7
Btrfs: fix locking on ROOT_REPLACE operations in tree mod log

commit d9abbf1c3131b679379762700201ae69367f3f62 upstream.

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.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/ctree.c