Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-01-12 15:46:58 +0100
committerJohannes Thumshirn <jthumshirn@suse.de>2018-01-12 15:47:01 +0100
commit5c4b33e73d958c235f24873d3db129a0955cf76c (patch)
tree294650643eee2394a6d46265b3f78b827cadfec2
parent248952d541cc8d9ebaaf69e2df26e50c929b5682 (diff)
block: Provide blk_status_t decoding for path errors
-rw-r--r--patches.drivers/block-Provide-blk_status_t-decoding-for-path-errors.patch59
-rw-r--r--series.conf1
2 files changed, 60 insertions, 0 deletions
diff --git a/patches.drivers/block-Provide-blk_status_t-decoding-for-path-errors.patch b/patches.drivers/block-Provide-blk_status_t-decoding-for-path-errors.patch
new file mode 100644
index 0000000000..4f3c908333
--- /dev/null
+++ b/patches.drivers/block-Provide-blk_status_t-decoding-for-path-errors.patch
@@ -0,0 +1,59 @@
+From: Keith Busch <keith.busch@intel.com>
+Date: Tue, 9 Jan 2018 12:04:16 -0700
+Subject: block: Provide blk_status_t decoding for path errors
+Patch-mainline: Queued in subsystem maintainer repository
+Git-repo: git://git.kernel.dk/linux-block
+Git-commit: 9111e5686c8cf3905191d4feb819acd874437500
+References: FATE#323952, FATE#322506
+
+This patch provides a common decoder for block status path related errors
+that may be retried so various entities wishing to consult this do not
+have to duplicate this decision.
+
+Acked-by: Mike Snitzer <snitzer@redhat.com>
+Reviewed-by: Hannes Reinecke <hare@suse.com>
+Signed-off-by: Keith Busch <keith.busch@intel.com>
+Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+---
+ include/linux/blk_types.h | 28 ++++++++++++++++++++++++++++
+ 1 file changed, 28 insertions(+)
+
+--- a/include/linux/blk_types.h
++++ b/include/linux/blk_types.h
+@@ -38,6 +38,34 @@ typedef u8 __bitwise blk_status_t;
+
+ #define BLK_STS_AGAIN ((__force blk_status_t)12)
+
++/**
++ * blk_path_error - returns true if error may be path related
++ * @error: status the request was completed with
++ *
++ * Description:
++ * This classifies block error status into non-retryable errors and ones
++ * that may be successful if retried on a failover path.
++ *
++ * Return:
++ * %false - retrying failover path will not help
++ * %true - may succeed if retried
++ */
++static inline bool blk_path_error(blk_status_t error)
++{
++ switch (error) {
++ case BLK_STS_NOTSUPP:
++ case BLK_STS_NOSPC:
++ case BLK_STS_TARGET:
++ case BLK_STS_NEXUS:
++ case BLK_STS_MEDIUM:
++ case BLK_STS_PROTECTION:
++ return false;
++ }
++
++ /* Anything else could be a path failure, so should be retried */
++ return true;
++}
++
+ struct blk_issue_stat {
+ u64 stat;
+ };
diff --git a/series.conf b/series.conf
index d91ddc0bd8..79232da894 100644
--- a/series.conf
+++ b/series.conf
@@ -6503,6 +6503,7 @@
# git://git.kernel.dk/linux-block.git for-next
patches.drivers/nvme-Add-more-command-status-translation.patch
patches.drivers/nvme-multipath-Consult-blk_status_t-for-failover.patch
+ patches.drivers/block-Provide-blk_status_t-decoding-for-path-errors.patch
# out-of-tree patches
patches.drivers/s390-sles15-00-04-04-kmsg-add-VNIC-Characteristics-msg-documentation.patch