Comment 17 for bug 1811785

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

libndctl: sizeof_namespace_index: nmem10: label area (1024) too small to host (256 byte) labels

This issue is fixed by:

commit 9c6aae5
Author: Dan Williams <email address hidden>
Date: Tue Jan 15 01:51:45 2019

    ndctl/init-labels: Fix label slot accounting per UEFI 2.7

    Quoting from Linux kernel commit 9e694d9c18dd "libnvdimm, label: change
    nvdimm_num_label_slots per UEFI 2.7":

        sizeof_namespace_index() fails when NVDIMM devices have the minimum
        1024 bytes label storage area. nvdimm_num_label_slots() returns 3
        slots while the area is only big enough for 2 slots.

        Change nvdimm_num_label_slots() to calculate a number of label slots
        according to UEFI 2.7 spec.

    Without this fix attempts to initialize labels on a small (1K) label
    area results in the following:

    libndctl: sizeof_namespace_index: nmem2: label area (1024) too small to host (128 byte) labels
    libndctl: sizeof_namespace_index: nmem2: label area (1024) too small to host (256 byte) labels

    Based on an original patch by Toshi Kani
    Fixes: bdaec95463ca ("ndctl: introduce ndctl_dimm_{validate_labels,init_labels}")
    Reported-by: Sujith Pandel <email address hidden>
    Link: https://github.com/pmem/ndctl/issues/78
    Signed-off-by: Dan Williams <email address hidden>
    Signed-off-by: Vishal Verma <email address hidden>

Upstream.