nvmet: track and limit the number of namespaces per subsystem
authorChristoph Hellwig <hch@lst.de>
Sun, 13 May 2018 17:00:13 +0000 (19:00 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 27 Jul 2018 17:13:01 +0000 (19:13 +0200)
commit793c7cfce02ce88b7bd67d43834c052d16c096e3
treebc15ed260d3d74b37c81dff0a78ed417fffda1be
parent4ee43280488b0f6cbd74702725a32f47d03d690b
nvmet: track and limit the number of namespaces per subsystem

TP 4004 introduces a new 'Maximum Number of Allocated Namespaces' field
in the Identify controller data to help the host size resources.  Put
an upper limit on the supported namespaces to be able to support this
value as supporting 32-bits worth of namespaces would lead to very
large buffers.  The limit is completely arbitrary at this point.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
drivers/nvme/target/admin-cmd.c
drivers/nvme/target/core.c
drivers/nvme/target/nvmet.h