Re: [PATCH] block: Fix dio->ref leak on integrity error in __blkdev_direct_IO()
From: Yang Xiuwei
Date: Fri Jun 26 2026 - 05:04:43 EST
---
Hi Wentao,
On Thu, Jun 25, 2026 at 05:21:06PM +0800, Wentao Liang wrote:
> Fix by matching the existing error handling pattern used for
> blkdev_iov_iter_get_pages() failure: end the current bio with an error
> status and break out of the submission loop.
Looks good to me.
> + if (unlikely(ret)) {
> + bio->bi_status = errno_to_blk_status(ret);
> + bio_endio(bio);
> + break;
> + }
Small nit: consider bio_endio_status(bio, errno_to_blk_status(ret))
instead, now that the helper exists.
Reviewed-by: Yang Xiuwei <yangxiuwei@xxxxxxxxxx>
Thanks,
Yang Xiuwei