Message ID | 6a45bc14a406c86552e6446f9e78dae3489f26b5.1684913599.git.wqu@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs-progs: tune: add resume support for csum conversion | expand |
diff --git a/tune/change-csum.c b/tune/change-csum.c index 05bddaa48d27..aef3b05a0d9d 100644 --- a/tune/change-csum.c +++ b/tune/change-csum.c @@ -828,6 +828,13 @@ static int resume_data_csum_change(struct btrfs_fs_info *fs_info, if (ret == 0) new_csum_found = true; + /* + * No csum item found at all, this fs has empty csum tree. + * Just go metadata change. + */ + if (!old_csum_found && !new_csum_found) + goto new_meta_csum; + /* * Only old csums exists. This can be one of the two cases: * - Only the csum change item inserted, no new csum generated.
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> --- tune/change-csum.c | 7 +++++++ 1 file changed, 7 insertions(+)