Skip to content

Commit 7f077e3

Browse files
adam900710kdave
authored andcommitted
btrfs-progs: tune: implement resume support for empty csum tree
We have a very rare chance to hit a fs with empty csum tree but still has CHANGING_DATA_CSUM flag. The window is very small, but it's still possible, so handle it by jumping directly to metadata csum change. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 8f23ca0 commit 7f077e3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tune/change-csum.c

+7
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,13 @@ static int resume_data_csum_change(struct btrfs_fs_info *fs_info, u16 new_csum_t
827827
if (ret == 0)
828828
new_csum_found = true;
829829

830+
/*
831+
* No csum item found at all, this fs has empty csum tree.
832+
* Just go metadata change.
833+
*/
834+
if (!old_csum_found && !new_csum_found)
835+
goto new_meta_csum;
836+
830837
/*
831838
* Only old csums exists. This can be one of the two cases:
832839
* - Only the csum change item inserted, no new csum generated.

0 commit comments

Comments
 (0)