Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fed3b381 authored by Liu Bo's avatar Liu Bo Committed by David Sterba
Browse files

Btrfs: do not backup tree roots when fsync



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: default avatarLiu Bo <bo.li.liu@oracle.com>
Reviewed-by: default avatarQu Wenruo <quwenruo.btrfs@gmx.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent c2faff79
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -3641,6 +3641,13 @@ int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
	u64 flags;

	do_barriers = !btrfs_test_opt(fs_info, NOBARRIER);

	/*
	 * 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;