block,scsi: BLK_STS_AGAIN clarification
Subsystems (2)
cover block,scsi: BLK_STS_AGAIN clarification
Hi all,
BLK_STS_AGAIN should only be used under very specify circumstances, so we should better document that. And modify the SCSI midlayer to not return it, of course.
As usual, comments and reviews are welcome.
Hannes Reinecke (2):
block: document BLK_STS_AGAIN usage
scsi: return BLK_STS_TRANSPORT for ALUA transitioning
drivers/scsi/scsi_lib.c | 2 +- include/linux/blk_types.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
2.29.2
PATCH 1/2 block: document BLK_STS_AGAIN usage
BLK_STS_AGAIN should only be used if RQF_NOWAIT is set and the bio would block. So we'd better document that to avoid accidental misuse.
--- include/linux/blk_types.h | 4 ++++ 1 file changed, 4 insertions(+)
include/linux/blk_types.h +4 -0
@@ -105,6 +105,10 @@ typedef u16 blk_short_t;/* hack for device mapper, don't use elsewhere: */ #define BLK_STS_DM_REQUEUE ((__force blk_status_t)11) +/* +* BLK_STS_AGAIN should only be returned if RQF_NOWAIT is set +* and the bio would block (cf bio_wouldblock_error()) +*/ #define BLK_STS_AGAIN ((__force blk_status_t)12)/*
Signature · 1 line
2.29.2
Re: [PATCH 1/2] block: document BLK_STS_AGAIN usage
Quoted 2 lines · Hannes Reinecke
BLK_STS_AGAINshould only be used ifRQF_NOWAITis set and the bio would block. So we'd better document that to avoid accidental misuse.
Looks good:
given that nothing in patch 2 depends on this it would be good to just get this into the block tree ASAP.
Re: [PATCH 1/2] block: document BLK_STS_AGAIN usage
In reply to Hannes ReineckeQuoted 5 lines · Hannes Reinecke
BLK_STS_AGAINshould only be used ifRQF_NOWAITis set and the bio would block. So we'd better document that to avoid accidental misuse.Signed-off-by Hannes Reinecke <[email protected]>---
Looks good.
-ck
PATCH 2/2 scsi: return BLK_STS_TRANSPORT for ALUA transitioning
In reply to Hannes ReineckeWhen the 'ALUA state transitioning' sense code is returned we cannot use BLK_STS_AGAIN, as this has a very specific use-case. So return BLK_STS_TRANSPORT here.
--- drivers/scsi/scsi_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_lib.c +1 -1
@@ -779,7 +779,7 @@ static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result) action =ACTION_DELAYED_RETRY ;break ;case 0x0a :/* ALUA state transition */ - blk_stat =BLK_STS_AGAIN ; + blk_stat =BLK_STS_TRANSPORT ; fallthrough;default : action =ACTION_FAIL ;
Signature · 1 line
2.29.2
Re: [PATCH 2/2] scsi: return BLK_STS_TRANSPORT for ALUA transitioning
Quoted 6 lines · Hannes Reinecke
When the 'ALUA state transitioning' sense code is returned we cannot use
BLK_STS_AGAIN, as this has a very specific use-case. So returnBLK_STS_TRANSPORThere.Signed-off-by Hannes Reinecke <[email protected]>---
Do we need a fixes tag ? irrespective of that looks good.
-ck
Martin K. Petersen
AppliedRe: [PATCH 2/2] scsi: return BLK_STS_TRANSPORT for ALUA transitioning
In reply to Hannes ReineckeHannes,
Quoted 3 lines
When the 'ALUA state transitioning' sense code is returned we cannot use
BLK_STS_AGAIN, as this has a very specific use-case. So returnBLK_STS_TRANSPORThere.
Applied to 5.19/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Re: (subset) [PATCH 0/2] block,scsi: BLK_STS_AGAIN clarification
In reply to Hannes ReineckeQuoted 11 lines · Hannes Reinecke
BLK_STS_AGAINshould only be used under very specify circumstances, so we should better document that. And modify the SCSI midlayer to not return it, of course.As usual, comments and reviews are welcome.
Hannes Reinecke (2):
block: documentBLK_STS_AGAINusage
scsi: returnBLK_STS_TRANSPORTfor ALUA transitioning[...]
Applied, thanks!
[1/2] block: document BLK_STS_AGAIN usage
commit: 98d40e76652e9aeb3aec4065f600d633ed335e94
Best regards,
Signature · 1 line
Jens Axboe