]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
create-ns: align the namespaces to 1Mib boundaries when using SI suffixes
authorMaurizio Lombardi <mlombard@redhat.com>
Thu, 5 Oct 2023 15:17:23 +0000 (17:17 +0200)
committerDaniel Wagner <wagi@monom.org>
Mon, 5 Feb 2024 14:54:22 +0000 (15:54 +0100)
commit3d1243e1bf22bde9b3cf5f492f99f6bbff94f4b1
tree18d35c23d62bf50c737f9b6d7df508ac1e5030e3
parent36e25357ed75301258d71cced0380225bfa26aa5
create-ns: align the namespaces to 1Mib boundaries when using SI suffixes

Some controllers refuse to create namespaces with a size not aligned to
a 1 MiB boundary, this happens when using the -S and -C options.

$ nvme create-ns /dev/nvme0 -S 80M -C 80M -f 0
NVMe status: Invalid Field in Command: A reserved coded value or
an unsupported value in a defined field(0x2)

Fix this problem by modifying create_ns() parse_lba_num_si() to align
the values to 1 MiB boundaries. If granularity is supported, we will
use the specified values, if they are smaller than 1 MiB.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Documentation/nvme-create-ns.txt
nvme.c