block: Rename BLK_STS_NEXUS to BLK_STS_RESV_CONFLICT
authorMike Christie <michael.christie@oracle.com>
Fri, 7 Apr 2023 20:05:35 +0000 (15:05 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 12 Apr 2023 01:55:35 +0000 (21:55 -0400)
BLK_STS_NEXUS is used for NVMe/SCSI reservation conflicts and DASD's
locking feature which works similar to NVMe/SCSI reservations where a
host can get a lock on a device and when the lock is taken it will get
failures.

This patch renames BLK_STS_NEXUS so it better reflects this type of
use.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Link: https://lore.kernel.org/r/20230407200551.12660-3-michael.christie@oracle.com
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
block/blk-core.c
drivers/nvme/host/core.c
drivers/s390/block/dasd.c
drivers/scsi/scsi_lib.c
include/linux/blk_types.h

index 9e5e0277a4d95a5e2f09b6cafaf4d8cd97ee5983..ff8fb7a493891e3aa0ee0e8a0f2165d7b952c6bd 100644 (file)
@@ -155,7 +155,7 @@ static const struct {
        [BLK_STS_NOSPC]         = { -ENOSPC,    "critical space allocation" },
        [BLK_STS_TRANSPORT]     = { -ENOLINK,   "recoverable transport" },
        [BLK_STS_TARGET]        = { -EREMOTEIO, "critical target" },
-       [BLK_STS_NEXUS]         = { -EBADE,     "critical nexus" },
+       [BLK_STS_RESV_CONFLICT] = { -EBADE,     "reservation conflict" },
        [BLK_STS_MEDIUM]        = { -ENODATA,   "critical medium" },
        [BLK_STS_PROTECTION]    = { -EILSEQ,    "protection" },
        [BLK_STS_RESOURCE]      = { -ENOMEM,    "kernel resource" },
index c2730b116dc680eac04df43a81c81a3826c5da16..535a26ceb20508980beff2a168231aad97933a05 100644 (file)
@@ -279,7 +279,7 @@ static blk_status_t nvme_error_status(u16 status)
        case NVME_SC_INVALID_PI:
                return BLK_STS_PROTECTION;
        case NVME_SC_RESERVATION_CONFLICT:
-               return BLK_STS_NEXUS;
+               return BLK_STS_RESV_CONFLICT;
        case NVME_SC_HOST_PATH_ERROR:
                return BLK_STS_TRANSPORT;
        case NVME_SC_ZONE_TOO_MANY_ACTIVE:
index a9c2a8d76c453d7fe0078e77f972ec905693636c..ca0df87fa8f4800e1ee777a54abb46d5461380de 100644 (file)
@@ -2723,7 +2723,12 @@ static void __dasd_cleanup_cqr(struct dasd_ccw_req *cqr)
        else if (status == 0) {
                switch (cqr->intrc) {
                case -EPERM:
-                       error = BLK_STS_NEXUS;
+                       /*
+                        * DASD doesn't implement SCSI/NVMe reservations, but it
+                        * implements a locking scheme similar to them. We
+                        * return this error when we no longer have the lock.
+                        */
+                       error = BLK_STS_RESV_CONFLICT;
                        break;
                case -ENOLINK:
                        error = BLK_STS_TRANSPORT;
index b7c569a42aa477551597ff0629fc6c04888277fb..e1468483ac7e26b97e7ade2de32797dc35c2ba76 100644 (file)
@@ -599,7 +599,7 @@ static blk_status_t scsi_result_to_blk_status(int result)
        case SCSIML_STAT_OK:
                break;
        case SCSIML_STAT_RESV_CONFLICT:
-               return BLK_STS_NEXUS;
+               return BLK_STS_RESV_CONFLICT;
        case SCSIML_STAT_NOSPC:
                return BLK_STS_NOSPC;
        case SCSIML_STAT_MED_ERROR:
index 99be590f952f6e69d47900b970f05f0195e98798..2b2452086a2fe02ba6a119b39e436331608ec1bc 100644 (file)
@@ -96,7 +96,7 @@ typedef u16 blk_short_t;
 #define BLK_STS_NOSPC          ((__force blk_status_t)3)
 #define BLK_STS_TRANSPORT      ((__force blk_status_t)4)
 #define BLK_STS_TARGET         ((__force blk_status_t)5)
-#define BLK_STS_NEXUS          ((__force blk_status_t)6)
+#define BLK_STS_RESV_CONFLICT  ((__force blk_status_t)6)
 #define BLK_STS_MEDIUM         ((__force blk_status_t)7)
 #define BLK_STS_PROTECTION     ((__force blk_status_t)8)
 #define BLK_STS_RESOURCE       ((__force blk_status_t)9)
@@ -184,7 +184,7 @@ static inline bool blk_path_error(blk_status_t error)
        case BLK_STS_NOTSUPP:
        case BLK_STS_NOSPC:
        case BLK_STS_TARGET:
-       case BLK_STS_NEXUS:
+       case BLK_STS_RESV_CONFLICT:
        case BLK_STS_MEDIUM:
        case BLK_STS_PROTECTION:
                return false;