linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Himanshu Madhani <himanshu.madhani@oracle.com>
To: Damien Le Moal <Damien.LeMoal@wdc.com>
Cc: linux-scsi@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH v2 3/3] scsi: handle zone resources errors
Date: Thu, 10 Sep 2020 10:46:26 -0500	[thread overview]
Message-ID: <4D07E3FF-38F9-4B80-94AD-56D277EB6069@oracle.com> (raw)
In-Reply-To: <20200910074843.217661-4-damien.lemoal@wdc.com>



> On Sep 10, 2020, at 2:48 AM, Damien Le Moal <Damien.LeMoal@wdc.com> wrote:
> 
> ZBC or ZAC disks that have a limit on the number of open zones may fail
> a zone open command or a write to a zone that is not already implicitly
> or explicitly open if the total number of open zones is already at the
> maximum allowed.
> 
> For these operations, instead of returning the generic BLK_STS_IOERR,
> return BLK_STS_DEV_RESOURCE which is returned as -EBUSY to the I/O
> issuer, allowing the device user to act appropriately on these
> relatively benign zone resource errors.
> 
> With this change the NVMe (ZNS) and sd drivers both return the same
> error code for zone resource errors, facilitating the implementation of
> IO error handling by the user with a common code base for both device
> types.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> ---
> drivers/scsi/scsi_lib.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index 7c6dd6f75190..1b5c2a6ad072 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -758,6 +758,15 @@ static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result)
> 			/* See SSC3rXX or current. */
> 			action = ACTION_FAIL;
> 			break;
> +		case DATA_PROTECT:
> +			action = ACTION_FAIL;
> +			if ((sshdr.asc == 0x0C && sshdr.ascq == 0x12) ||
> +			    (sshdr.asc == 0x55 &&
> +			     (sshdr.ascq == 0x0E || sshdr.ascq == 0x0F))) {
> +				/* Insufficient zone resources */
> +				blk_stat = BLK_STS_DEV_RESOURCE;
> +			}
> +			break;
> 		default:
> 			action = ACTION_FAIL;
> 			break;
> -- 
> 2.26.2
> 

Looks Good. 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering


  reply	other threads:[~2020-09-10 15:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-10  7:48 [PATCH v2 0/3] Improve error handling Damien Le Moal
2020-09-10  7:48 ` [PATCH v2 1/3] scsi: Cleanup scsi_noretry_cmd() Damien Le Moal
2020-09-10  8:05   ` Johannes Thumshirn
2020-09-10 15:45   ` Himanshu Madhani
2020-09-10  7:48 ` [PATCH v2 2/3] scsi: update additional sense codes list Damien Le Moal
2020-09-10  8:08   ` Johannes Thumshirn
2020-09-10 15:46   ` Himanshu Madhani
2020-09-10  7:48 ` [PATCH v2 3/3] scsi: handle zone resources errors Damien Le Moal
2020-09-10 15:46   ` Himanshu Madhani [this message]
2020-09-16  0:29 ` [PATCH v2 0/3] Improve error handling Martin K. Petersen
2020-09-16  1:11   ` Damien Le Moal
2020-09-22  3:56 ` Martin K. Petersen

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=4D07E3FF-38F9-4B80-94AD-56D277EB6069@oracle.com \
    --to=himanshu.madhani@oracle.com \
    --cc=Damien.LeMoal@wdc.com \
    --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).