aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Mason <chris.mason@fusionio.com>2012-07-02 15:29:53 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 11:47:39 -0400
commitd0f7cf8a1ab0479ecc37989bd332c28d5ff04f89 (patch)
tree2102c322528824d7564b2bf39406f2e00f795e07
parentc45f606a03193a95a55ef1802646e5a67fff642b (diff)
Btrfs: run delayed directory updates during log replay
commit b6305567e7d31b0bec1b8cb9ec0cadd7f7086f5f upstream. While we are resolving directory modifications in the tree log, we are triggering delayed metadata updates to the filesystem btrees. This commit forces the delayed updates to run so the replay code can find any modifications done. It stops us from crashing because the directory deleltion replay expects items to be removed immediately from the tree. Signed-off-by: Chris Mason <chris.mason@fusionio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/btrfs/tree-log.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 7fa128d32f7..faf7d0bc0a0 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -691,6 +691,8 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
691 kfree(name); 691 kfree(name);
692 692
693 iput(inode); 693 iput(inode);
694
695 btrfs_run_delayed_items(trans, root);
694 return ret; 696 return ret;
695} 697}
696 698
@@ -896,6 +898,7 @@ again:
896 ret = btrfs_unlink_inode(trans, root, dir, 898 ret = btrfs_unlink_inode(trans, root, dir,
897 inode, victim_name, 899 inode, victim_name,
898 victim_name_len); 900 victim_name_len);
901 btrfs_run_delayed_items(trans, root);
899 } 902 }
900 kfree(victim_name); 903 kfree(victim_name);
901 ptr = (unsigned long)(victim_ref + 1) + victim_name_len; 904 ptr = (unsigned long)(victim_ref + 1) + victim_name_len;
@@ -1476,6 +1479,9 @@ again:
1476 ret = btrfs_unlink_inode(trans, root, dir, inode, 1479 ret = btrfs_unlink_inode(trans, root, dir, inode,
1477 name, name_len); 1480 name, name_len);
1478 BUG_ON(ret); 1481 BUG_ON(ret);
1482
1483 btrfs_run_delayed_items(trans, root);
1484
1479 kfree(name); 1485 kfree(name);
1480 iput(inode); 1486 iput(inode);
1481 1487