On Fri, 28 Mar 2025, LongPing Wei wrote:
> bi_size is always 0 here since the iterator was already advanced.
>
> Fixes: 8cf3ae875ee4 ("dm-verity: support block number limits for different
> ioprio classes")
> Signed-off-by: LongPing Wei <weilongp...@oppo.com>
> ---
> drivers/md/dm-verity-target.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c
> index 2ed10b4c63c5..40448a8c74b1 100644
> --- a/drivers/md/dm-verity-target.c
> +++ b/drivers/md/dm-verity-target.c
> @@ -689,6 +689,7 @@ static void verity_end_io(struct bio *bio)
> {
> struct dm_verity_io *io = bio->bi_private;
> unsigned short ioprio = IOPRIO_PRIO_CLASS(bio->bi_ioprio);
> + unsigned int bytes = io->n_blocks << io->v->data_dev_block_bits;
>
> if (bio->bi_status &&
> (!verity_fec_is_enabled(io->v) ||
> @@ -699,7 +700,7 @@ static void verity_end_io(struct bio *bio)
> }
>
> if (static_branch_unlikely(&use_bh_wq_enabled) && io->v->use_bh_wq &&
> - verity_use_bh(bio->bi_iter.bi_size, ioprio)) {
> + verity_use_bh(bytes, ioprio)) {
> if (in_hardirq() || irqs_disabled()) {
> INIT_WORK(&io->bh_work, verity_bh_work);
> queue_work(system_bh_wq, &io->bh_work);
> --
> 2.34.1
OK, I merged both patches into the existing patch.
Mikulas