]> Gentwo Git Trees - linux/.git/commit
btrfs: add orig_logical to btrfs_bio for encryption
authorJosef Bacik <josef@toxicpanda.com>
Tue, 18 Nov 2025 16:08:40 +0000 (17:08 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 25 Nov 2025 00:52:23 +0000 (01:52 +0100)
commitbd45e9e3f6232f76fa9bd0e40c1e3409e4449f5e
tree284492f9f271595249cea377a427ff4276407709
parent45d99129b64b2311cc067b38221d475942166118
btrfs: add orig_logical to btrfs_bio for encryption

When checksumming the encrypted bio on writes we need to know which
logical address this checksum is for.  At the point where we get the
encrypted bio the bi_sector is the physical location on the target disk,
so we need to save the original logical offset in the btrfs_bio.  Then
we can use this when checksumming the bio instead of the
bio->iter.bi_sector.

Note: The patch was taken from v5 of fscrypt patchset
(https://lore.kernel.org/linux-btrfs/cover.1706116485.git.josef@toxicpanda.com/)
which was handled over time by various people: Omar Sandoval, Sweet Tea
Dorminy, Josef Bacik.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Daniel Vacek <neelx@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ add note ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/bio.c
fs/btrfs/bio.h
fs/btrfs/file-item.c