Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Underscore is allowed in NQN and gw name which might cause issues with OMAP keys #426

Closed
gbregman opened this issue Feb 7, 2024 · 3 comments · Fixed by #475
Closed

Underscore is allowed in NQN and gw name which might cause issues with OMAP keys #426

gbregman opened this issue Feb 7, 2024 · 3 comments · Fixed by #475
Assignees

Comments

@gbregman
Copy link
Contributor

gbregman commented Feb 7, 2024

The NQN string contains a user part after the ":". While the part up to the ":" has rigid rules and we make sure the NQN conforms, there are no restrictions on the user part, as long as the length of the NQN is under the limit. This means we can create a subsystem which has "_" in its NQN. When we create OMAP keys we use "_" as the delimiter between the different parts. For example, a host key looks like:

host_<subsys-nqn>_<host-nqn>

if the subsystem NQN contains a "_" when we'll try to parse the host key we would get a partial subsystem NQN as we'll stop at the first "_".

We have a few options:

  • Not allowing a "_" in NQNs
  • Replace the "_" delimiter with a character not allowed anywhere in the NQN. Namely a non UTF-8 character.
  • Change the way we construct the OMAP key. We have several options to do that like escaping "_", introducing a length prefix for each component of the key and more

The first option is the simplest. In principle it might create issues with existing OMAP files which already contain an NQN with a "_" but I doubt this is real issue. The second options will break compatibility with existing OMAP file and we need to make sure the non UTF-8 character is handled properly on all levels. The third option will certainly break compatibility with existing OMAP files.

A similar issue we have with gateway names.

@gbregman gbregman self-assigned this Feb 7, 2024
@gbregman
Copy link
Contributor Author

gbregman commented Feb 7, 2024

@oritwas Do you have any suggestions?

@oritwas
Copy link
Member

oritwas commented Feb 11, 2024

We can always encode the NQN (using string encode in python) before we write to the OMAP and decode it when reading

@oritwas
Copy link
Member

oritwas commented Feb 11, 2024

Another option is to disallow underscore in the NQN

@gbregman gbregman changed the title Underscore is allowed in NQN which might cause issues with OMAP keys Underscore is allowed in NQN and gw name which might cause issues with OMAP keys Feb 11, 2024
gbregman added a commit to gbregman/ceph-nvmeof that referenced this issue Mar 3, 2024
Fixes ceph#426

Signed-off-by: Gil Bregman <gbregman@il.ibm.com>
gbregman added a commit to gbregman/ceph-nvmeof that referenced this issue Mar 3, 2024
Fixes ceph#426

Signed-off-by: Gil Bregman <gbregman@il.ibm.com>
gbregman added a commit to gbregman/ceph-nvmeof that referenced this issue Mar 3, 2024
Fixes ceph#426

Signed-off-by: Gil Bregman <gbregman@il.ibm.com>
gbregman added a commit to gbregman/ceph-nvmeof that referenced this issue Mar 5, 2024
Fixes ceph#426

Signed-off-by: Gil Bregman <gbregman@il.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
2 participants