Allow pool names that are not reserved but only start with reserved #7208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
zpool(8) says "The pool names mirror, raidz, spare and log are
reserved,", but the command actually avoids entire patterns which
start with "mirror"/"raidz"/"spare" by using strncmp(3) without
terminating null considered. It does right for "log" by not using
strncmp(3) with size of 3 (should be 4 or strcmp(3)).
(or fix zpool(8) man page if this is really intended behavior.)
e.g. zpool(8) avoids "spare<something>".
# zpool create spareribs /dev/sdb
cannot create 'spareribs': name is reserved
pool name may have been omitted
Description
Fixes zpool_name_valid() used for sanity checks of zpool name.
strncmp(3) size should contain termination null string.
Motivation and Context
Allow pool names that are not reserved but only start with reserved names.
How Has This Been Tested?
By running for e.g. zpool create command.
Types of changes
Checklist:
Signed-off-by
.