mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: "James E . J . Bottomley" <jejb@linux.ibm.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Guenter Roeck <linux@roeck-us.net>, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>, Jackie Liu <liuyun01@kylinos.cn>
Subject: [PATCH] scsi: bsg: Ignore bsg queue registration failures again
Date: Wed, 22 Dec 2021 08:54:27 -0800	[thread overview]
Message-ID: <20211222165427.1855582-1-linux@roeck-us.net> (raw)

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


             reply	other threads:[~2021-12-22 16:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22 16:54 Guenter Roeck [this message]
2021-12-23  6:34 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211222165427.1855582-1-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=liuyun01@kylinos.cn \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®