Skip to content
Snippets Groups Projects
Commit fe944851 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

nvmet: reject Namespace and Subsystems lookups without identifier


Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 22811226
No related branches found
No related tags found
No related merge requests found
......@@ -367,6 +367,8 @@ class Subsystem(CFSNode):
super(Subsystem, self).__init__()
if nqn is None:
if mode == 'lookup':
raise CFSError("Need NQN for lookup")
nqn = self._generate_nqn()
self.nqn = nqn
......@@ -456,6 +458,9 @@ class Namespace(CFSNode):
raise CFSError("Invalid parent class")
if nsid is None:
if mode == 'lookup':
raise CFSError("Need NSID for lookup")
nsids = [n.nsid for n in subsystem.namespaces]
for index in xrange(1, self.MAX_NSID + 1):
if index not in nsids:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment