Re: [PATCH v2] scsi: fix WARNING in scsi_alloc_sgtables

From: Martin K. Petersen
Date: Tue Jul 26 2022 - 23:15:47 EST


On Wed, 20 Jul 2022 10:51:20 +0800, Jason Yan wrote:

> As explained in SG_IO howto[1]:
>
> "If iovec_count is non-zero then 'dxfer_len' should be equal to the sum
> of iov_len lengths. If not, the minimum of the two is the transfer
> length."
>
> When iovec_count is non-zero and dxfer_len is zero, the sg_io() just
> genarated a null bio, and finally caused a warning below. To fix it,
> skip generating a bio for this request if dxfer_len is zero.
>
> [...]

Applied to 5.19/scsi-fixes, thanks!

[1/1] scsi: fix WARNING in scsi_alloc_sgtables
https://git.kernel.org/mkp/scsi/c/d9a434fa0c12

--
Martin K. Petersen Oracle Linux Engineering