Skip to contentSkip to conversation

scsi: core: sysfs: remove comments that conflict with the actual logic

PATCH Applied Jackie Liu 4 participants 5 messages Mar 29, 2022 – Apr 7, 2022 SCSI

lore
Share & tools
lore

Jackie Liu

author
#0 lore raw

PATCH 1/1 scsi: core: sysfs: remove comments that conflict with the actual logic

From: Jackie Liu <[email protected]>

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/[email protected]/

---
 drivers/scsi/scsi_sysfs.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/scsi/scsi_sysfs.c +0 -4
index f1e0c131b77c..322228faf8da 100644
@@ -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",
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Jackie Liu

From: Jackie Liu <[email protected]>

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.

Quoted 6 lines

We discuss this issue in [1].

[1] https://lore.kernel.org/all/[email protected]/

Quoted 19 lines
---
  drivers/scsi/scsi_sysfs.c | 4 ----
  1 file changed, 4 deletions(-)
drivers/scsi/scsi_sysfs.c +0 -4
index f1e0c131b77c..322228faf8da 100644
@@ -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",
#3 lore raw
In reply to Jackie Liu

Jackie,

Quoted 2 lines

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!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#4 lore raw
In reply to Jackie Liu
Quoted 8 lines · Jackie Liu

From: Jackie Liu <[email protected]>

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
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering