Skip to content

Commit 220e887

Browse files
tbzatekigaw
authored andcommitted
nbft: Fix (struct nbft_info_subsystem_ns).num_hfis off-by-one
The num_hfis field only reflected the number of Secondary HFI Associations, resulting in the last parsed HFI being ignored by users (nvme-cli). According to the NVM Express Boot Specification, Revision 1.0, the Primary HFI Descriptor Index in the Subsystem Namespace (SSNS) Descriptor contains this note: "If multiple HFIs are associated with this record, subsequent interfaces should be populated in the Secondary HFI Associations field." As both the primary and secondary HFIs are parsed into a single array, it makes sense to reflect the proper number of elements. Signed-off-by: Tomas Bzatek <[email protected]>
1 parent 768ff7e commit 220e887

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/nvme/nbft.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ static int read_ssns(struct nbft_info *nbft,
274274
ret = -EINVAL;
275275
goto fail;
276276
}
277+
ssns->num_hfis = 1;
277278
for (i = 0; i < le16_to_cpu(raw_ssns->secondary_hfi_assoc_obj.length); i++) {
278279
ssns->hfis[i + 1] = hfi_from_index(nbft, ss_hfi_indexes[i]);
279280
if (ss_hfi_indexes[i] && !ssns->hfis[i + 1])

0 commit comments

Comments
 (0)