All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] block,scsi: BLK_STS_AGAIN clarification
@ 2022-05-24  5:56 Hannes Reinecke
  2022-05-24  5:56 ` [PATCH 1/2] block: document BLK_STS_AGAIN usage Hannes Reinecke
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Hannes Reinecke @ 2022-05-24  5:56 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, Martin K. Petersen, James Bottomley, linux-block,
	linux-scsi, Hannes Reinecke

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(-)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] block: document BLK_STS_AGAIN usage
  2022-05-24  5:56 [PATCH 0/2] block,scsi: BLK_STS_AGAIN clarification Hannes Reinecke
@ 2022-05-24  5:56 ` Hannes Reinecke
  2022-05-24  8:36   ` Christoph Hellwig
  2022-05-24 15:14   ` Chaitanya Kulkarni
  2022-05-24  5:56 ` [PATCH 2/2] scsi: return BLK_STS_TRANSPORT for ALUA transitioning Hannes Reinecke
  2022-05-28  2:38 ` (subset) [PATCH 0/2] block,scsi: BLK_STS_AGAIN clarification Jens Axboe
  2 siblings, 2 replies; 8+ messages in thread
From: Hannes Reinecke @ 2022-05-24  5:56 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, Martin K. Petersen, James Bottomley, linux-block,
	linux-scsi, Hannes Reinecke

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.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 include/linux/blk_types.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 1973ef9bd40f..8fb8f79cb74e 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -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)
 
 /*
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] scsi: return BLK_STS_TRANSPORT for ALUA transitioning
  2022-05-24  5:56 [PATCH 0/2] block,scsi: BLK_STS_AGAIN clarification Hannes Reinecke
  2022-05-24  5:56 ` [PATCH 1/2] block: document BLK_STS_AGAIN usage Hannes Reinecke
@ 2022-05-24  5:56 ` Hannes Reinecke
  2022-05-24 15:15   ` Chaitanya Kulkarni
  2022-06-02  2:39   ` Martin K. Petersen
  2022-05-28  2:38 ` (subset) [PATCH 0/2] block,scsi: BLK_STS_AGAIN clarification Jens Axboe
  2 siblings, 2 replies; 8+ messages in thread
From: Hannes Reinecke @ 2022-05-24  5:56 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, Martin K. Petersen, James Bottomley, linux-block,
	linux-scsi, 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 return BLK_STS_TRANSPORT here.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 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 8d18cc7e510e..a55deb5caa34 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -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;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] block: document BLK_STS_AGAIN usage
  2022-05-24  5:56 ` [PATCH 1/2] block: document BLK_STS_AGAIN usage Hannes Reinecke
@ 2022-05-24  8:36   ` Christoph Hellwig
  2022-05-24 15:14   ` Chaitanya Kulkarni
  1 sibling, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2022-05-24  8:36 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Christoph Hellwig, Jens Axboe, Martin K. Petersen,
	James Bottomley, linux-block, linux-scsi

On Tue, May 24, 2022 at 07:56:30AM +0200, Hannes Reinecke wrote:
> 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.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

given that nothing in patch 2 depends on this it would be good to just
get this into the block tree ASAP.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] block: document BLK_STS_AGAIN usage
  2022-05-24  5:56 ` [PATCH 1/2] block: document BLK_STS_AGAIN usage Hannes Reinecke
  2022-05-24  8:36   ` Christoph Hellwig
@ 2022-05-24 15:14   ` Chaitanya Kulkarni
  1 sibling, 0 replies; 8+ messages in thread
From: Chaitanya Kulkarni @ 2022-05-24 15:14 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Jens Axboe, Martin K. Petersen, James Bottomley, linux-block,
	linux-scsi, Christoph Hellwig

On 5/23/22 22:56, Hannes Reinecke wrote:
> 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.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---


Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] scsi: return BLK_STS_TRANSPORT for ALUA transitioning
  2022-05-24  5:56 ` [PATCH 2/2] scsi: return BLK_STS_TRANSPORT for ALUA transitioning Hannes Reinecke
@ 2022-05-24 15:15   ` Chaitanya Kulkarni
  2022-06-02  2:39   ` Martin K. Petersen
  1 sibling, 0 replies; 8+ messages in thread
From: Chaitanya Kulkarni @ 2022-05-24 15:15 UTC (permalink / raw)
  To: Hannes Reinecke, Christoph Hellwig
  Cc: Jens Axboe, Martin K. Petersen, James Bottomley, linux-block, linux-scsi

On 5/23/22 22:56, Hannes Reinecke wrote:
> When 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.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---

Do we need a fixes tag ? irrespective of that looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: (subset) [PATCH 0/2] block,scsi: BLK_STS_AGAIN clarification
  2022-05-24  5:56 [PATCH 0/2] block,scsi: BLK_STS_AGAIN clarification Hannes Reinecke
  2022-05-24  5:56 ` [PATCH 1/2] block: document BLK_STS_AGAIN usage Hannes Reinecke
  2022-05-24  5:56 ` [PATCH 2/2] scsi: return BLK_STS_TRANSPORT for ALUA transitioning Hannes Reinecke
@ 2022-05-28  2:38 ` Jens Axboe
  2 siblings, 0 replies; 8+ messages in thread
From: Jens Axboe @ 2022-05-28  2:38 UTC (permalink / raw)
  To: Christoph Hellwig, hare
  Cc: linux-scsi, martin.petersen, james.bottomley, linux-block

On Tue, 24 May 2022 07:56:29 +0200, Hannes Reinecke wrote:
> 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
> 
> [...]

Applied, thanks!

[1/2] block: document BLK_STS_AGAIN usage
      commit: 98d40e76652e9aeb3aec4065f600d633ed335e94

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] scsi: return BLK_STS_TRANSPORT for ALUA transitioning
  2022-05-24  5:56 ` [PATCH 2/2] scsi: return BLK_STS_TRANSPORT for ALUA transitioning Hannes Reinecke
  2022-05-24 15:15   ` Chaitanya Kulkarni
@ 2022-06-02  2:39   ` Martin K. Petersen
  1 sibling, 0 replies; 8+ messages in thread
From: Martin K. Petersen @ 2022-06-02  2:39 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Christoph Hellwig, Jens Axboe, Martin K. Petersen,
	James Bottomley, linux-block, linux-scsi


Hannes,

> When 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.

Applied to 5.19/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-02  2:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24  5:56 [PATCH 0/2] block,scsi: BLK_STS_AGAIN clarification Hannes Reinecke
2022-05-24  5:56 ` [PATCH 1/2] block: document BLK_STS_AGAIN usage Hannes Reinecke
2022-05-24  8:36   ` Christoph Hellwig
2022-05-24 15:14   ` Chaitanya Kulkarni
2022-05-24  5:56 ` [PATCH 2/2] scsi: return BLK_STS_TRANSPORT for ALUA transitioning Hannes Reinecke
2022-05-24 15:15   ` Chaitanya Kulkarni
2022-06-02  2:39   ` Martin K. Petersen
2022-05-28  2:38 ` (subset) [PATCH 0/2] block,scsi: BLK_STS_AGAIN clarification Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.