summaryrefslogtreecommitdiff
path: root/sys/cam/nvme/nvme_da.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cam/nvme/nvme_da.c')
-rw-r--r--sys/cam/nvme/nvme_da.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
index 367c943f0dced..892dee5a9959d 100644
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -943,7 +943,11 @@ ndaregister(struct cam_periph *periph, void *arg)
disk->d_hba_subdevice = cpi.hba_subdevice;
snprintf(disk->d_attachment, sizeof(disk->d_attachment),
"%s%d", cpi.dev_name, cpi.unit_number);
- disk->d_stripesize = disk->d_sectorsize;
+ if (((nsd->nsfeat >> NVME_NS_DATA_NSFEAT_NPVALID_SHIFT) &
+ NVME_NS_DATA_NSFEAT_NPVALID_MASK) != 0 && nsd->npwg != 0)
+ disk->d_stripesize = ((nsd->npwg + 1) * disk->d_sectorsize);
+ else
+ disk->d_stripesize = nsd->noiob * disk->d_sectorsize;
disk->d_stripeoffset = 0;
disk->d_devstat = devstat_new_entry(periph->periph_name,
periph->unit_number, disk->d_sectorsize,