* [PATCH] scsi: bsg: Ignore bsg queue registration failures again
@ 2021-12-22 16:54 Guenter Roeck
2021-12-23 6:34 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Guenter Roeck @ 2021-12-22 16:54 UTC (permalink / raw)
To: Martin K . Petersen
Cc: James E . J . Bottomley, linux-scsi, linux-kernel, Guenter Roeck,
Jens Axboe, Christoph Hellwig, Jackie Liu
Since commit 5f7cf82c1d73 ("scsi: bsg: Fix errno when
scsi_bsg_register_queue() fails"), errors from registering the bsg queue
are no longer ignored but returned to the caller. At the same time, the
comment in the code still states that errors are ignored. On top of that,
the message preporting the problem is printed as dev_info, not dev_err.
Both suggest that errors from bsg queue registrations should indeed be
ignored.
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jackie Liu <liuyun01@kylinos.cn>
Fixes: 5f7cf82c1d73 ("scsi: bsg: Fix errno when scsi_bsg_register_queue() fails"
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
Commit 5f7cf82c1d73 has proliferated to stable releases, so this patch
should probably be backported as well.
Alternatives:
- revert commit 5f7cf82c1d73
- Change the comment to match the code, and print the message as error
drivers/scsi/scsi_sysfs.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index d4edce930a4a..caa4ad1f893a 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1391,10 +1391,9 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
* We're treating error on bsg register as non-fatal, so
* pretend nothing went wrong.
*/
- error = PTR_ERR(sdev->bsg_dev);
sdev_printk(KERN_INFO, sdev,
- "Failed to register bsg queue, errno=%d\n",
- error);
+ "Failed to register bsg queue, errno=%ld\n",
+ PTR_ERR(sdev->bsg_dev));
sdev->bsg_dev = NULL;
}
}
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi: bsg: Ignore bsg queue registration failures again
2021-12-22 16:54 [PATCH] scsi: bsg: Ignore bsg queue registration failures again Guenter Roeck
@ 2021-12-23 6:34 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2021-12-23 6:34 UTC (permalink / raw)
To: Guenter Roeck
Cc: Martin K . Petersen, James E . J . Bottomley, linux-scsi,
linux-kernel, Jens Axboe, Christoph Hellwig, Jackie Liu
On Wed, Dec 22, 2021 at 08:54:27AM -0800, Guenter Roeck wrote:
> Since commit 5f7cf82c1d73 ("scsi: bsg: Fix errno when
> scsi_bsg_register_queue() fails"), errors from registering the bsg queue
> are no longer ignored but returned to the caller. At the same time, the
> comment in the code still states that errors are ignored. On top of that,
> the message preporting the problem is printed as dev_info, not dev_err.
> Both suggest that errors from bsg queue registrations should indeed be
> ignored.
But there is no good reason to ignore it. The proper fix is to fully
handle the errors.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-23 6:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-22 16:54 [PATCH] scsi: bsg: Ignore bsg queue registration failures again Guenter Roeck
2021-12-23 6:34 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).