From f6dc0e860f41ec7e1a5dce37346ef8479769111e Mon Sep 17 00:00:00 2001 From: Mark Harmstone Date: Fri, 4 Oct 2024 14:20:08 +0100 Subject: [PATCH] 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 --- check/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/check/main.c b/check/main.c index d10cf0514..b3da286a8 100644 --- a/check/main.c +++ b/check/main.c @@ -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;