All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: core: sysfs: remove comments that conflict with the actual logic
@ 2022-03-29  2:12 Jackie Liu
  2022-03-29  3:55 ` Guenter Roeck
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jackie Liu @ 2022-03-29  2:12 UTC (permalink / raw)
  To: martin.petersen; +Cc: hch, linux, linux-scsi

From: Jackie Liu <liuyun01@kylinos.cn>

Christoph Hellwig Says:
=======================
I think we should just handle the error properly and remove the comment.
There's no good reason to ignore bsg registration errors.

In fact, after commit 92c4b58b15c5 ("scsi: core: Register sysfs attributes
earlier"), we are already forced to return errno.

We discuss this issue in [1].

[1] https://lore.kernel.org/all/20211022010201.426746-1-liu.yun@linux.dev/

Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
---
 drivers/scsi/scsi_sysfs.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index f1e0c131b77c..322228faf8da 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1392,10 +1392,6 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
 	if (IS_ENABLED(CONFIG_BLK_DEV_BSG)) {
 		sdev->bsg_dev = scsi_bsg_register_queue(sdev);
 		if (IS_ERR(sdev->bsg_dev)) {
-			/*
-			 * 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",
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: core: sysfs: remove comments that conflict with the actual logic
  2022-03-29  2:12 [PATCH] scsi: core: sysfs: remove comments that conflict with the actual logic Jackie Liu
@ 2022-03-29  3:55 ` Guenter Roeck
  2022-03-29  6:15 ` Christoph Hellwig
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2022-03-29  3:55 UTC (permalink / raw)
  To: Jackie Liu, martin.petersen; +Cc: hch, linux-scsi

On 3/28/22 19:12, Jackie Liu wrote:
> From: Jackie Liu <liuyun01@kylinos.cn>
> 
> Christoph Hellwig Says:
> =======================
> I think we should just handle the error properly and remove the comment.
> There's no good reason to ignore bsg registration errors.
> 
> In fact, after commit 92c4b58b15c5 ("scsi: core: Register sysfs attributes
> earlier"), we are already forced to return errno.
> 
> We discuss this issue in [1].
> 
> [1] https://lore.kernel.org/all/20211022010201.426746-1-liu.yun@linux.dev/
> 
> Suggested-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/scsi/scsi_sysfs.c | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index f1e0c131b77c..322228faf8da 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -1392,10 +1392,6 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
>   	if (IS_ENABLED(CONFIG_BLK_DEV_BSG)) {
>   		sdev->bsg_dev = scsi_bsg_register_queue(sdev);
>   		if (IS_ERR(sdev->bsg_dev)) {
> -			/*
> -			 * 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",


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: core: sysfs: remove comments that conflict with the actual logic
  2022-03-29  2:12 [PATCH] scsi: core: sysfs: remove comments that conflict with the actual logic Jackie Liu
  2022-03-29  3:55 ` Guenter Roeck
@ 2022-03-29  6:15 ` Christoph Hellwig
  2022-03-30  3:54 ` Martin K. Petersen
  2022-04-07 13:35 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2022-03-29  6:15 UTC (permalink / raw)
  To: Jackie Liu; +Cc: martin.petersen, hch, linux, linux-scsi

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: core: sysfs: remove comments that conflict with the actual logic
  2022-03-29  2:12 [PATCH] scsi: core: sysfs: remove comments that conflict with the actual logic Jackie Liu
  2022-03-29  3:55 ` Guenter Roeck
  2022-03-29  6:15 ` Christoph Hellwig
@ 2022-03-30  3:54 ` Martin K. Petersen
  2022-04-07 13:35 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2022-03-30  3:54 UTC (permalink / raw)
  To: Jackie Liu; +Cc: martin.petersen, hch, linux, linux-scsi


Jackie,

> I think we should just handle the error properly and remove the
> comment.  There's no good reason to ignore bsg registration errors.

Applied to 5.18/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: core: sysfs: remove comments that conflict with the actual logic
  2022-03-29  2:12 [PATCH] scsi: core: sysfs: remove comments that conflict with the actual logic Jackie Liu
                   ` (2 preceding siblings ...)
  2022-03-30  3:54 ` Martin K. Petersen
@ 2022-04-07 13:35 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2022-04-07 13:35 UTC (permalink / raw)
  To: linux-scsi; +Cc: Martin K . Petersen

On Tue, 29 Mar 2022 10:12:51 +0800, Jackie Liu wrote:

> From: Jackie Liu <liuyun01@kylinos.cn>
> 
> Christoph Hellwig Says:
> =======================
> I think we should just handle the error properly and remove the comment.
> There's no good reason to ignore bsg registration errors.
> 
> [...]

Applied to 5.18/scsi-fixes, thanks!

[1/1] scsi: core: sysfs: remove comments that conflict with the actual logic
      https://git.kernel.org/mkp/scsi/c/99241e119f4a

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-07 13:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29  2:12 [PATCH] scsi: core: sysfs: remove comments that conflict with the actual logic Jackie Liu
2022-03-29  3:55 ` Guenter Roeck
2022-03-29  6:15 ` Christoph Hellwig
2022-03-30  3:54 ` Martin K. Petersen
2022-04-07 13:35 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.