diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2009-06-15 20:01:02 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-06-15 20:01:02 -0400 |
commit | 978d910d31c5202e251298bf3f603300a54605dd (patch) | |
tree | 69a5c7a2f1fac9b98dcc3bc95d9214686d487f16 /fs | |
parent | b263c2c8bf13c273485bd99dbbeba79c844409dd (diff) | |
download | op-kernel-dev-978d910d31c5202e251298bf3f603300a54605dd.zip op-kernel-dev-978d910d31c5202e251298bf3f603300a54605dd.tar.gz |
Btrfs: always update root items for fs trees at commit time
commit_fs_roots skips updating root items for fs trees that aren't modified.
This is unsafe now that relocation code modifies root item's last_snapshot
field without modifying corresponding fs tree.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/transaction.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 2e177d7..4e83457 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -543,13 +543,13 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans, btrfs_free_log(trans, root); btrfs_update_reloc_root(trans, root); - if (root->commit_root == root->node) - continue; - - free_extent_buffer(root->commit_root); - root->commit_root = btrfs_root_node(root); + if (root->commit_root != root->node) { + free_extent_buffer(root->commit_root); + root->commit_root = btrfs_root_node(root); + btrfs_set_root_node(&root->root_item, + root->node); + } - btrfs_set_root_node(&root->root_item, root->node); err = btrfs_update_root(trans, fs_info->tree_root, &root->root_key, &root->root_item); |