btrfs-progs: check: explicit holes in log tree don't get csummed

Fix a false positive in btrfs check, where we were returning an error
because an explicit hole in the log tree had no associated csum entry.

Signed-off-by: Mark Harmstone <maharmstone@fb.com>
This commit is contained in:
Mark Harmstone 2024-10-04 14:20:08 +01:00 committed by Qu Wenruo
parent 2595fbfa21
commit f6dc0e860f
1 changed files with 4 additions and 0 deletions

View File

@ -9694,6 +9694,10 @@ static int check_log_csum(struct btrfs_root *root, u64 addr, u64 length)
u64 data_len;
int ret;
/* Explicit holes don't get csummed */
if (addr == 0)
return 0;
ret = btrfs_search_slot(NULL, root, &key, &path, 0, 0);
if (ret < 0)
return ret;