projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c2faff7
)
Btrfs: do not backup tree roots when fsync
author
Liu Bo
<
[email protected]
>
Wed, 13 Sep 2017 18:25:21 +0000
(12:25 -0600)
committer
David Sterba
<
[email protected]
>
Tue, 26 Sep 2017 12:53:04 +0000
(14:53 +0200)
It doesn't make sense to backup tree roots when doing fsync, since
during fsync those tree roots have not been consistent on disk.
Signed-off-by: Liu Bo <
[email protected]
>
Reviewed-by: Qu Wenruo <
[email protected]
>
Reviewed-by: David Sterba <
[email protected]
>
Signed-off-by: David Sterba <
[email protected]
>
fs/btrfs/disk-io.c
patch
|
blob
|
history
diff --git
a/fs/btrfs/disk-io.c
b/fs/btrfs/disk-io.c
index 27d45864053661a6393a9de5c461a720181fb863..0f2271815eb636bd71bd8bcfa53a7fb918b60da9 100644
(file)
--- a/
fs/btrfs/disk-io.c
+++ b/
fs/btrfs/disk-io.c
@@
-3641,7
+3641,14
@@
int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
u64 flags;
do_barriers = !btrfs_test_opt(fs_info, NOBARRIER);
- backup_super_roots(fs_info);
+
+ /*
+ * max_mirrors == 0 indicates we're from commit_transaction,
+ * not from fsync where the tree roots in fs_info have not
+ * been consistent on disk.
+ */
+ if (max_mirrors == 0)
+ backup_super_roots(fs_info);
sb = fs_info->super_for_commit;
dev_item = &sb->dev_item;