summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Mason <chris.mason@fusionio.com>2012-07-02 15:29:53 -0400
committerBen Hutchings <ben@decadent.org.uk>2012-07-12 04:32:17 +0100
commit518c75d289bfd41eadf8c55df1dc96a8e1779232 (patch)
tree551040cd2398a611cb5d7633e6525af20bd80215
parent2abafc06328d22a3cc486b060ae1d20d19430141 (diff)
downloadlwn-518c75d289bfd41eadf8c55df1dc96a8e1779232.tar.gz
lwn-518c75d289bfd41eadf8c55df1dc96a8e1779232.zip
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: Ben Hutchings <ben@decadent.org.uk>
-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 3568374d419d..19b127c15486 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -692,6 +692,8 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
kfree(name);
iput(inode);
+
+ btrfs_run_delayed_items(trans, root);
return ret;
}
@@ -897,6 +899,7 @@ again:
ret = btrfs_unlink_inode(trans, root, dir,
inode, victim_name,
victim_name_len);
+ btrfs_run_delayed_items(trans, root);
}
kfree(victim_name);
ptr = (unsigned long)(victim_ref + 1) + victim_name_len;
@@ -1477,6 +1480,9 @@ again:
ret = btrfs_unlink_inode(trans, root, dir, inode,
name, name_len);
BUG_ON(ret);
+
+ btrfs_run_delayed_items(trans, root);
+
kfree(name);
iput(inode);