mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-25 15:42:23 +00:00
Avoid tree of tree root cow when committing a clean FS
The root node generation number code made commit_tree_root look like the kernel code. It forces a cow of the tree of tree roots even when the FS hasn't changed. This causes errors during fsck and other readonly operations. This adds a check to see if commit_tree_root is going to trigger writes to the tree of tree roots, and bails if none are pending. Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
712c1dea5e
commit
0a7869d69d
@ -293,6 +293,9 @@ static int commit_tree_roots(struct btrfs_trans_handle *trans,
|
||||
struct list_head *next;
|
||||
struct extent_buffer *eb;
|
||||
|
||||
if (fs_info->readonly)
|
||||
return 0;
|
||||
|
||||
eb = fs_info->tree_root->node;
|
||||
extent_buffer_get(eb);
|
||||
btrfs_cow_block(trans, fs_info->tree_root, eb, NULL, 0, &eb);
|
||||
|
Loading…
Reference in New Issue
Block a user