OSDN Git Service

hw/block/nvme: error if drive less than a zone size
authorMinwoo Im <minwoo.im.dev@gmail.com>
Fri, 15 Jan 2021 12:19:20 +0000 (21:19 +0900)
committerKlaus Jensen <k.jensen@samsung.com>
Mon, 8 Feb 2021 20:15:54 +0000 (21:15 +0100)
commit044f1876b0b00a970e65b99d9be21925cdd7dc6b
tree5cd61f6e8902a8f497a39670565de5fd84d7062d
parent38001f73403808dde35c523695ee895587bcc6ba
hw/block/nvme: error if drive less than a zone size

If a user assigns a backing device with less capacity than the size of a
single zone, the namespace capacity will be reported as zero and the
kernel will silently fail to allocate the namespace.

This patch errors out in case that the backing device cannot accomodate
at least a single zone.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
[k.jensen: small fixup in the error and commit message]
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
hw/block/nvme-ns.c