OSDN Git Service

nvmet: never fail double namespace enablement
authorMax Gurtovoy <maxg@mellanox.com>
Tue, 2 Apr 2019 11:52:47 +0000 (14:52 +0300)
committerChristoph Hellwig <hch@lst.de>
Fri, 5 Apr 2019 06:07:58 +0000 (08:07 +0200)
commite84c2091a45228b62867ec0565898ef5404706a2
treeaa13398b8e5af6589c508b70349f66f39404936b
parent70479b71bc80ae6f63c8d6644cc76dff99f79686
nvmet: never fail double namespace enablement

In case we create N namespaces while N < NVMET_MAX_NAMESPACES, we can
perform "echo 1 > <nsid>/enable" as much as we want. In case N ==
NVMET_MAX_NAMESPACES we fail. Make sure we have the same flow for any N.

Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/core.c