Re: [PATCH] scsi/sg: fix checking return value of blk_get_queue()

From: Shinichiro Kawasaki
Date: Thu Jul 13 2023 - 08:23:22 EST


On Jul 05, 2023 / 10:40, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@xxxxxxxxxx>
>
> Commit fcaa174a9c99 ("scsi/sg: don't grab scsi host module reference")
> make a mess how blk_get_queue() is called, blk_get_queue() returns true
> on success while the caller expects it returns 0 on success.
>
> Fix this problem and also add a corresponding error message on failure.
>
> Fixes: fcaa174a9c99 ("scsi/sg: don't grab scsi host module reference")
> Reported-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
> Closes: https://lore.kernel.org/all/87lefv622n.fsf@xxxxxxxxxxxxx/
> Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx>

I observed that /dev/sg* files are not created with kernel v6.5-rc1, and it
causes blktests scsi/002 failure. I confirmed this patch fixes it. Thanks.

Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>