[PATCH 1/3] nvmet: make the subsystem type configurable

Christoph Hellwig hch at lst.de
Thu Apr 7 22:46:44 PDT 2022


On Thu, Apr 07, 2022 at 06:55:09PM +0200, Hannes Reinecke wrote:
>>> +	down_read(&nvmet_config_sem);
>>> +	list_for_each_entry(p, &nvmet_ports_list, global_entry) {
>>> +		list_for_each_entry(s, &p->subsystems, entry) {
>>> +			if (s->subsys == subsys) {
>>> +				up_read(&nvmet_config_sem);
>>> +				return -EACCES;
>>> +			}
>>> +		}
>>> +	}
>>> +	up_read(&nvmet_config_sem);
>>
>> Does this scale?  Do we want a flag in the subsystem instead?
>>
> Hmm. Seeing that it's a synchronous userspace operation I don't really 
> care; worst case the 'ln -s' call takes a bit longer.
> But okay, I'll have a look.

Well, it is quadratic behavior, wich we generally avoid.  Something
like a counter of enabled ports in the subsystem should easily remove
the need for it.



More information about the Linux-nvme mailing list