Skip to content

Commit b630556

Browse files
author
Chris Mason
committed
Btrfs: run delayed directory updates during log replay
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 <[email protected]> cc: [email protected]
1 parent 7fd1a3f commit b630556

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/btrfs/tree-log.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,8 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
690690
kfree(name);
691691

692692
iput(inode);
693+
694+
btrfs_run_delayed_items(trans, root);
693695
return ret;
694696
}
695697

@@ -895,6 +897,7 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans,
895897
ret = btrfs_unlink_inode(trans, root, dir,
896898
inode, victim_name,
897899
victim_name_len);
900+
btrfs_run_delayed_items(trans, root);
898901
}
899902
kfree(victim_name);
900903
ptr = (unsigned long)(victim_ref + 1) + victim_name_len;
@@ -1475,6 +1478,9 @@ static noinline int check_item_in_log(struct btrfs_trans_handle *trans,
14751478
ret = btrfs_unlink_inode(trans, root, dir, inode,
14761479
name, name_len);
14771480
BUG_ON(ret);
1481+
1482+
btrfs_run_delayed_items(trans, root);
1483+
14781484
kfree(name);
14791485
iput(inode);
14801486

0 commit comments

Comments
 (0)