linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Song Liu <song@kernel.org>
To: <linux-block@vger.kernel.org>, <linux-scsi@vger.kernel.org>
Cc: <kernel-team@fb.com>, <jejb@linux.ibm.com>,
	<martin.petersen@oracle.com>, <axboe@kernel.dk>, <hare@suse.de>,
	Song Liu <song@kernel.org>
Subject: [PATCH v2 3/3] scsi: use BLK_STS_OFFLINE for not fully online devices
Date: Thu, 3 Feb 2022 11:28:27 -0800	[thread overview]
Message-ID: <20220203192827.1370270-4-song@kernel.org> (raw)
In-Reply-To: <20220203192827.1370270-1-song@kernel.org>

The new error message for such case looks like

[  172.809565] device offline error, dev sda, sector 3138208 ...

which will not be confused with regular I/O error (BLK_STS_IOERR).

Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Song Liu <song@kernel.org>
---
 drivers/scsi/scsi_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 0a70aa763a96..e30bc51578e9 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1276,7 +1276,7 @@ scsi_device_state_check(struct scsi_device *sdev, struct request *req)
 		 * power management commands.
 		 */
 		if (req && !(req->rq_flags & RQF_PM))
-			return BLK_STS_IOERR;
+			return BLK_STS_OFFLINE;
 		return BLK_STS_OK;
 	}
 }
-- 
2.30.2


  parent reply	other threads:[~2022-02-03 19:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 19:28 [PATCH v2 0/3] block: scsi: introduce and use BLK_STS_OFFLINE Song Liu
2022-02-03 19:28 ` [PATCH v2 1/3] block: introduce BLK_STS_OFFLINE Song Liu
2022-02-04  7:25   ` Hannes Reinecke
2022-02-03 19:28 ` [PATCH v2 2/3] block: return -ENODEV for BLK_STS_OFFLINE Song Liu
2022-02-04  7:26   ` Hannes Reinecke
2022-02-03 19:28 ` Song Liu [this message]
2022-02-04  3:16 ` [PATCH v2 0/3] block: scsi: introduce and use BLK_STS_OFFLINE Martin K. Petersen
2022-02-04  4:10 ` Jens Axboe

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=20220203192827.1370270-4-song@kernel.org \
    --to=song@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.de \
    --cc=jejb@linux.ibm.com \
    --cc=kernel-team@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).