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

nvme: don't pad strings with zeros #790

Open
rmustacc opened this issue Oct 11, 2024 · 0 comments
Open

nvme: don't pad strings with zeros #790

rmustacc opened this issue Oct 11, 2024 · 0 comments

Comments

@rmustacc
Copy link

In #789 it was noted that we were trying to workaround cases where the virtual NVMe devices are padding the model, serial, and firmware revision entries of the identify controller data structure with the value 0x0 which turns it into a NUL character. This isn't quite correct per the NVMe spec. Instead, these fields are expected to be padded with strings and spaces. This means that the defaults that we're using which zero fill these fields (and any other strings) are incorrect and we should really be filling them with spaces. This is defined in Conventions section (§1.5) of the NVMe specification. While this wasn't explicit in NVMe 1.0 and NVMe 1.1, in NVMe 1.2 it makes it clear with: The string is left justified and shall be padded with spaces (ASCII character 20h) to the right if necessary. It's wroth noting that this is the same convention used in many other places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant