diff options
author | Hou Tao <houtao1@huawei.com> | 2025-01-20 16:29:48 +0800 |
---|---|---|
committer | Mikulas Patocka <mpatocka@redhat.com> | 2025-01-21 22:00:57 +0100 |
commit | 2f8c28d0d97313edc36d62cbd505019f36111fd5 (patch) | |
tree | 3c358ed4222236fde0fdd009f9950a9400dbad90 /drivers/md | |
parent | 7c88f7cfab553016a1b02a38ba261d9ac3750b6a (diff) |
dm-crypt: use bi_sector in bio when initialize integrity seed
bio->bi_iter.bi_sector has already been initialized when initialize the
integrity seed in dm_crypt_integrity_io_alloc(). There is no need to
calculate it again. Therefore, use the helper bip_set_seed() to
initialize the seed and pass bi_iter.bi_sector to it instead.
Mikulas: We can't use bip_set_seed because it doesn't compile without
CONFIG_BLK_DEV_INTEGRITY.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-crypt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 551c934bfc501..8a4c24d4ee029 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1187,7 +1187,7 @@ static int dm_crypt_integrity_io_alloc(struct dm_crypt_io *io, struct bio *bio) tag_len = io->cc->tuple_size * (bio_sectors(bio) >> io->cc->sector_shift); - bip->bip_iter.bi_sector = io->cc->start + io->sector; + bip->bip_iter.bi_sector = bio->bi_iter.bi_sector; ret = bio_integrity_add_page(bio, virt_to_page(io->integrity_metadata), tag_len, offset_in_page(io->integrity_metadata)); |