]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: fallback to transaction csum tree on a commit root csum miss
authorBoris Burkov <boris@bur.io>
Thu, 11 Jun 2026 21:40:17 +0000 (14:40 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Jun 2026 23:59:20 +0000 (01:59 +0200)
commit3dcd50730814e5220072d2b26d0587af6bfb6dbe
tree4c5ddab28bf99f787ccca6a887ce2f6984db336b
parentce6050bafb4e33377dc17fcc357736bfc351180c
btrfs: fallback to transaction csum tree on a commit root csum miss

We have been running with commit root csums enabled for some time and
have noticed a slight uptick in zero csum errors. Investigating those
revealed that they were same transaction reads of extents that were just
relocated, but the extent map generation was long ago.

It turns out that relocation intentionally does not update the extent
generation (replace_file_extents()), but must write a new csum since the
data has moved, so we must account for this with commit root csum reading.

Luckily this is a short lived condition: after the relocation transaction
the commit root will once again have the csum. So we can add a generic
fallback to the lookup to try again with the transaction csum root.

Fixes: f07b855c56b1 ("btrfs: try to search for data csums in commit root")
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Boris Burkov <boris@bur.io>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file-item.c