Re: [PATCH] block: fix dio leak on integrity metadata mapping failure

From: Christoph Hellwig

Date: Mon May 25 2026 - 03:46:12 EST


> + if (unlikely(ret)) {
> + bio->bi_status = BLK_STS_IOERR;
> + bio_endio(bio);
> + break;
> + }

AFAICS the same issue also exists for the other goto fail case,
so we should convert the code at that label to a bio_endio().

I think both this and the existing -EAGAIN case and even the
-EIOCBQUEUED case leak the reference on the original bio. Or am
I missing something?

It might makes sense to stop playing games with that bio refcount
and just have a status field in struct blkdev_dio.