Skip to content

Commit

Permalink
Allow pool names that look like Solaris disk names
Browse files Browse the repository at this point in the history
Nothing bad happens if a prefix of your pool name matches a disk name.
This is a bit of a silly restriction at this point.

Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org>
Closes #11781 
Closes #11813
  • Loading branch information
Ryan Moeller authored Apr 1, 2021
1 parent 032a213 commit c05eec3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions module/zcommon/zfs_namecheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,6 @@ pool_namecheck(const char *pool, namecheck_err_t *why, char *what)
return (-1);
}

if (pool[0] == 'c' && (pool[1] >= '0' && pool[1] <= '9')) {
if (why)
*why = NAME_ERR_DISKLIKE;
return (-1);
}

return (0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ do
done

log_note "Verify invalid pool names fail"
set -A POOLNAME "c0t0d0s0" "c0t0d0" "c0t0d19" "c0t50000E0108D279d0" \
set -A POOLNAME \
"mirror" "raidz" ",," ",,,,,,,,,,,,,,,,,,,,,,,,," \
"2222222222222222222" "mirror_pool" "raidz_pool" \
"mirror-pool" "raidz-pool" "spare" "spare_pool" \
Expand Down

0 comments on commit c05eec3

Please sign in to comment.