Skip to content

Commit b3c58fc

Browse files
committed
Merge branch 'nvme-5.8' of git://git.infradead.org/nvme into block-5.8
Pull NVMe fixes from Christoph. * 'nvme-5.8' of git://git.infradead.org/nvme: nvme: fix a crash in nvme_mpath_add_disk nvme: fix identify error status silent ignore
2 parents e7eea44 + 72d4471 commit b3c58fc

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

drivers/nvme/host/core.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,10 +1116,16 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,
11161116
dev_warn(ctrl->device,
11171117
"Identify Descriptors failed (%d)\n", status);
11181118
/*
1119-
* Don't treat an error as fatal, as we potentially already
1120-
* have a NGUID or EUI-64.
1119+
* Don't treat non-retryable errors as fatal, as we potentially
1120+
* already have a NGUID or EUI-64. If we failed with DNR set,
1121+
* we want to silently ignore the error as we can still
1122+
* identify the device, but if the status has DNR set, we want
1123+
* to propagate the error back specifically for the disk
1124+
* revalidation flow to make sure we don't abandon the
1125+
* device just because of a temporal retry-able error (such
1126+
* as path of transport errors).
11211127
*/
1122-
if (status > 0 && !(status & NVME_SC_DNR))
1128+
if (status > 0 && (status & NVME_SC_DNR))
11231129
status = 0;
11241130
goto free_data;
11251131
}

drivers/nvme/host/multipath.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,10 +672,11 @@ void nvme_mpath_add_disk(struct nvme_ns *ns, struct nvme_id_ns *id)
672672
}
673673

674674
if (bdi_cap_stable_pages_required(ns->queue->backing_dev_info)) {
675-
struct backing_dev_info *info =
676-
ns->head->disk->queue->backing_dev_info;
675+
struct gendisk *disk = ns->head->disk;
677676

678-
info->capabilities |= BDI_CAP_STABLE_WRITES;
677+
if (disk)
678+
disk->queue->backing_dev_info->capabilities |=
679+
BDI_CAP_STABLE_WRITES;
679680
}
680681
}
681682

0 commit comments

Comments
 (0)