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
Support OPAL 2 self-encrypting NVMe disk drives (fix #2475) #2488
Conversation
usr/share/rear/lib/opal-functions.sh
Outdated
|
||
case "$device" in | ||
(*/nvme*) | ||
echo "$device"n[0-9] # consider all namespace block devices (NOTE: relies on nullglob) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"$device"n[0-9]
matches only up to namespace number 9 i.e. /dev/nvme...n9
so e.g. /dev/nvme0n10
and higher namespace numbers are ignored.
To be more on the safe side I suggest
# consider all namespace block devices up to /dev/nvme...n99 (NOTE: relies on nullglob)
echo "$device"n[1-9] "$device"n[1-9][0-9]
I think more than 9 namespaces might happen in practice
while more than 99 namespaces never happen in real world.
But the latter is probably only wishful thinking because
https://nvmexpress.org/wp-content/uploads/NVM-Express-1_4-2019.06.10-Ratified.pdf
reads (excerpts)
... namespace ID (NSID) ...
6.1.2 Valid and Invalid NSIDs
...
Any NSID is valid, except if that NSID is 0h or greater than the
Number of Namespaces field reported in the Identify Controller
data structure (refer to Figure 247).
NSID FFFFFFFFh is a broadcast value that is used to specify
all namespaces.
so it seems any number up to FFFFFFFFh could appear in real world.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next question is how namespaces > 9 block device nodes are shown:
As decimal numbers like /dev/nvme0n12
or as hex numbers like /dev/nvme0nc or /dev/nvme0nC or /dev/nvme0n0c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, I have not seen namespace IDs beyond 1 being used in the wild. But I don't mind if we extend the scheme.
The kernel will use decimal digits:
sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance);
@jsmeix Have a nice weekend, too! |
Yes, there are some well hidded 'secrets' (like the global Right now I adapted the "Beware of the emptiness" section in
|
@OliverO2 I would like to make you aware that at least in my PBA environment the shell options nullglob and extglob are NOT set (contrary to the situation in the booted OS). Thus the shell was complaining about incorrect syntax. |
@enzolis |
With the successful test report by @enzolis and the fix for missing 'nullglob extglob' options I'd consider this patch ready to merge. |
@rear/contributors |
This patch enables support for OPAL 2 self-encrypting NVMe disk drives.
I will amend this PR and/or propose merging it as soon as testing results come in (cf. progress in #2475).