git: e271f9327f46 - stable/15 - nda: fix setting of unmappedio flag
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 25 Nov 2025 23:00:04 UTC
The branch stable/15 has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=e271f9327f46250c9043c29c86e943d53080bf2a
commit e271f9327f46250c9043c29c86e943d53080bf2a
Author: Chuck Silvers <chs@FreeBSD.org>
AuthorDate: 2025-11-25 22:30:19 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-11-25 22:59:13 +0000
nda: fix setting of unmappedio flag
The upstream refactoring of ndaregister() to split out ndasetgeom()
accidentally used an uninitialed variable to decide whether or not
to set DISKFLAG_UNMAPPED_BIO. Fix this by moving that portion of
ndasetgeom() back up to ndaregister(). The check for PIM_UNMAPPED
is not really needed because nvme devices always have that set,
so it cannot change in the other path that ndasetgeom() is now called.
Reviewed by: imp
Fixes: dffd882d12d2a71aca464f48209ec9ae6f393b15
Sponsored by: Netflix
MFC After: 1 minute
(cherry picked from commit 2b4dbad2db5766294ee97bb96228ec6826a9e7c3)
---
sys/cam/nvme/nvme_da.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
index 2eb43809f4b1..d409961cea65 100644
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -647,7 +647,6 @@ static void
ndasetgeom(struct nda_softc *softc, struct cam_periph *periph)
{
struct disk *disk = softc->disk;
- struct ccb_pathinq cpi;
const struct nvme_namespace_data *nsd;
const struct nvme_controller_data *cd;
uint8_t flbas_fmt, lbads, vwc_present;
@@ -666,10 +665,6 @@ ndasetgeom(struct nda_softc *softc, struct cam_periph *periph)
vwc_present = NVMEV(NVME_CTRLR_DATA_VWC_PRESENT, cd->vwc);
if (vwc_present)
disk->d_flags |= DISKFLAG_CANFLUSHCACHE;
- if ((cpi.hba_misc & PIM_UNMAPPED) != 0) {
- disk->d_flags |= DISKFLAG_UNMAPPED_BIO;
- softc->unmappedio = 1;
- }
}
static void
@@ -943,6 +938,10 @@ ndaregister(struct cam_periph *periph, void *arg)
maxio = maxphys; /* for safety */
disk->d_maxsize = maxio;
ndasetgeom(softc, periph);
+ if ((cpi.hba_misc & PIM_UNMAPPED) != 0) {
+ disk->d_flags |= DISKFLAG_UNMAPPED_BIO;
+ softc->unmappedio = 1;
+ }
/*
* d_ident and d_descr are both far bigger than the length of either