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 David Sterba
parent e8223cd20b
commit 88dc309aca

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;