]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
blk-crypto: fix missing blktrace bio split events
authorYu Kuai <yukuai3@huawei.com>
Sat, 18 Oct 2025 16:14:33 +0000 (12:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:01:18 +0000 (14:01 +0100)
[ Upstream commit 06d712d297649f48ebf1381d19bd24e942813b37 ]

trace_block_split() is missing, resulting in blktrace inability to catch
BIO split events and making it harder to analyze the BIO sequence.

Cc: stable@vger.kernel.org
Fixes: 488f6682c832 ("block: blk-crypto-fallback for Inline Encryption")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[ added queue parameter to trace_block_split() call ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/blk-crypto-fallback.c

index c162b754efbd6a62235946db2e582f6e94b594e4..4ba66b3a2f96190bbc4b2d2fcfcf6250fc29dcba 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/mempool.h>
 #include <linux/module.h>
 #include <linux/random.h>
+#include <trace/events/block.h>
 
 #include "blk-crypto-internal.h"
 
@@ -227,7 +228,9 @@ static bool blk_crypto_split_bio_if_needed(struct bio **bio_ptr)
                        bio->bi_status = BLK_STS_RESOURCE;
                        return false;
                }
+
                bio_chain(split_bio, bio);
+               trace_block_split(bio->bi_disk->queue, split_bio, bio->bi_iter.bi_sector);
                submit_bio_noacct(bio);
                *bio_ptr = split_bio;
        }