From: Christoph Hellwig <hch@lst.de>
To: Mike Christie <michael.christie@oracle.com>
Cc: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me,
martin.petersen@oracle.com, jejb@linux.ibm.com,
linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org,
linux-block@vger.kernel.org
Subject: Re: [PATCH 1/3] block: Add error codes for common PR failures
Date: Wed, 9 Nov 2022 07:52:16 +0100 [thread overview]
Message-ID: <20221109065216.GA11097@lst.de> (raw)
In-Reply-To: <20221109031106.201324-2-michael.christie@oracle.com>
On Tue, Nov 08, 2022 at 09:11:04PM -0600, Mike Christie wrote:
> If a PR operation fails we can return a device specific error which is
> impossible to handle in some cases because we could have a mix of devices
> when DM is used, or future users like lio only know it's interacting with
> a block device so it doesn't know the type.
>
> This patch adds a new pr_status enum so drivers can convert errors to a
> common type which can be handled by the caller.
>
> Signed-off-by: Mike Christie <michael.christie@oracle.com>
> ---
> include/uapi/linux/pr.h | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/include/uapi/linux/pr.h b/include/uapi/linux/pr.h
> index ccc78cbf1221..16b856fb8053 100644
> --- a/include/uapi/linux/pr.h
> +++ b/include/uapi/linux/pr.h
> @@ -4,6 +4,30 @@
>
> #include <linux/types.h>
>
> +enum pr_status {
> + PR_STS_SUCCESS = 0x0,
> + /*
> + * These error codes have no mappings to existing SCSI errors.
> + */
> + /* The request is not supported. */
> + PR_STS_OP_NOT_SUPP = 0x7fffffff,
> + /* The request is invalid/illegal. */
> + PR_STS_OP_INVALID = 0x7ffffffe,
> + /*
> + * The following error codes are based on SCSI, because the interface
> + * was originally created for it and has existing users.
> + */
> + /* Generic device failure. */
> + PR_STS_IOERR = 0x2,
> + PR_STS_RESERVATION_CONFLICT = 0x18,
> + /* Temporary path failure that can be retried. */
> + PR_STS_RETRY_PATH_FAILURE = 0xe0000,
> + /* The request was failed due to a fast failure timer. */
> + PR_STS_PATH_FAST_FAILED = 0xf0000,
> + /* The path cannot be reached and has been marked as failed. */
> + PR_STS_PATH_FAILED = 0x10000,
Nit: I'd movee the NOT_SUPP/INVALID to the end to follow the numerical
order.
Otherwise looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
next prev parent reply other threads:[~2022-11-09 6:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 3:11 [PATCH 0/3] block/scsi/nvme: Add error codes for PR ops Mike Christie
2022-11-09 3:11 ` [PATCH 1/3] block: Add error codes for common PR failures Mike Christie
2022-11-09 6:52 ` Christoph Hellwig [this message]
2022-11-09 3:11 ` [PATCH 2/3] scsi: Convert SCSI errors to PR_STS errors Mike Christie
2022-11-09 6:52 ` Christoph Hellwig
2022-11-10 18:59 ` kernel test robot
2022-11-10 19:29 ` kernel test robot
2022-11-09 3:11 ` [PATCH 3/3] nvme: Convert NVMe errors to PT_STS errors Mike Christie
2022-11-09 6:53 ` Christoph Hellwig
2022-11-09 17:20 ` Mike Christie
2022-11-15 9:14 ` Christoph Hellwig
2022-11-15 16:56 ` Mike Christie
2022-11-09 8:28 ` Chao Leng
2022-11-09 17:35 ` Mike Christie
2022-11-10 0:58 ` Chao Leng
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=20221109065216.GA11097@lst.de \
--to=hch@lst.de \
--cc=axboe@fb.com \
--cc=jejb@linux.ibm.com \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michael.christie@oracle.com \
--cc=sagi@grimberg.me \
/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 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.