If a hostnqn intended to be masked with a namespace is not present at subsystem host list(when not "All hosts"), initiator having this hostnqn can never discover and connect to namespace above.
So we need to fail ns_add_host when
- subsystem containing this namespace is not visible to "All Hosts"(subsystem list has some hostnqns)
- hostnqn with ns_add_host command is not present in subsystem list above
Subystem_a has host list of "host_nqn_a, host_nqn_b"
ns_a is part of Subystem_a and is restrictive
When host_nqn_c is added part of masking to ns_a, initiator with host_nqn_c can never see this ns as subsystem is not masked with host_nqn_c