Skip to contentSkip to conversation

Revert "scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()"

PATCH In review Bart Van Assche 4 participants 6 messages Apr 5, 2018 – Apr 10, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH v3 1/3 Revert "scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()"

In reply to a message not in the archive

The description of commit e39a97353e53 is wrong: it mentions that commit 2a842acab109 introduced a bug in __scsi_error_from_host_byte() although that commit did not change the behavior of that function. Additionally, commit e39a97353e53 introduced a bug: it causes commands that fail with hostbyte=DID_OK and driverbyte=DRIVER_SENSE to be completed with BLK_STS_OK. Hence revert that commit.

Fixes e39a97353e53 ("scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()")
Cc Hannes Reinecke <[email protected]>
Cc Douglas Gilbert <[email protected]>
Cc Damien Le Moal <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Lee Duncan <[email protected]>
---
 drivers/scsi/scsi_lib.c | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/scsi_lib.c +0 -2
index 1d83f29aee74..c0e4ae733cce 100644
@@ -733,8 +733,6 @@ static blk_status_t __scsi_error_from_host_byte(struct scsi_cmnd *cmd,
 		int result)
 {
 	switch (host_byte(result)) {
-	case DID_OK:
-		return BLK_STS_OK;
 	case DID_TRANSPORT_FAILFAST:
 		return BLK_STS_TRANSPORT;
 	case DID_TARGET_FAILURE:
Signature · 1 line
2.16.2
Reviewed-by on v3 1/3
#3 lore raw
In reply to Bart Van Assche
Quoted 25 lines · On Thu, 5 Apr 2018 10:32:59 -0700 Bart Van Assche <[email protected]>…

The description of commit e39a97353e53 is wrong: it mentions that commit 2a842acab109 introduced a bug in __scsi_error_from_host_byte() although that commit did not change the behavior of that function. Additionally, commit e39a97353e53 introduced a bug: it causes commands that fail with hostbyte=DID_OK and driverbyte=DRIVER_SENSE to be completed with BLK_STS_OK. Hence revert that commit.

Fixes e39a97353e53 ("scsi: core: return BLK_STS_OK for DID_OK in

__scsi_error_from_host_byte()") Reported-by: Damien Le Moal <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Cc: Hannes Reinecke <[email protected]>
Cc: Douglas Gilbert <[email protected]>
Cc: Damien Le Moal <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Lee Duncan <[email protected]>
Cc: [email protected]

---
 drivers/scsi/scsi_lib.c | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/scsi_lib.c +0 -0
index 1d83f29aee74..c0e4ae733cce 100644

drivers/scsi/scsi_lib.c static blk_status_t · line 738

Quoted 8 lines
drivers/scsi/scsi_lib.c +0 -2
@@ -733,8 +733,6 @@ static blk_status_t
 __scsi_error_from_host_byte(struct scsi_cmnd *cmd, int result)
 {
 	switch (host_byte(result)) {
-	case DID_OK:
-		return BLK_STS_OK;
 	case DID_TRANSPORT_FAILFAST:
 		return BLK_STS_TRANSPORT;
 	case DID_TARGET_FAILURE:

Cheers,

Hannes

#4 lore raw
In reply to Bart Van Assche

Hi,

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag,
fixing commit: e39a97353e53 scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte().

The bot has also determined it's probably a bug fixing patch. (score: 94.6757)

The bot has tested the following trees: v4.16.1.

v4.16.1: Build OK!

#6 lore raw

Re: [PATCH v3 0/3] Report all request failures again to user space

In reply to a message not in the archive

Hi,

[This is an automated email]

This commit has been processed by the -stable helper bot and determined to be a high probability candidate for -stable trees. (score: 19.8603)

The bot has tested the following trees: v4.16.1, v4.15.16, v4.14.33, v4.9.93, v4.4.127.

v4.16.1: Failed to apply! Possible dependencies:
Unable to calculate

v4.15.16: Build OK!
v4.14.33: Build OK!
v4.9.93: Failed to apply! Possible dependencies:
2a842acab109 ("block: introduce new block status code type") b6800ec54c74 ("Make scsi_result_to_blk_status() recognize CONDITION MET")

v4.4.127: Failed to apply! Possible dependencies:
2a842acab109 ("block: introduce new block status code type") b6800ec54c74 ("Make scsi_result_to_blk_status() recognize CONDITION MET")

Please let us know if you'd like to have this patch included in a stable tree.

#5 lore raw
In reply to Sasha Levin
Quoted 10 lines · Sasha Levin

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag,
fixing commit: e39a97353e53 scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte().

The bot has also determined it's probably a bug fixing patch. (score: 94.6757)

The bot has tested the following trees: v4.16.1.

v4.16.1: Build OK!

Hello Sasha,

Please fix your bot. Your bot replied to a patch that has a "Cc: stable" tag.

Bart.