Skip to content

Commit c05eec3

Browse files
author
Ryan Moeller
authored
Allow pool names that look like Solaris disk names
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
1 parent 032a213 commit c05eec3

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

module/zcommon/zfs_namecheck.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,6 @@ pool_namecheck(const char *pool, namecheck_err_t *why, char *what)
450450
return (-1);
451451
}
452452

453-
if (pool[0] == 'c' && (pool[1] >= '0' && pool[1] <= '9')) {
454-
if (why)
455-
*why = NAME_ERR_DISKLIKE;
456-
return (-1);
457-
}
458-
459453
return (0);
460454
}
461455

tests/zfs-tests/tests/functional/pool_names/pool_names_002_neg.ksh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ do
106106
done
107107

108108
log_note "Verify invalid pool names fail"
109-
set -A POOLNAME "c0t0d0s0" "c0t0d0" "c0t0d19" "c0t50000E0108D279d0" \
109+
set -A POOLNAME \
110110
"mirror" "raidz" ",," ",,,,,,,,,,,,,,,,,,,,,,,,," \
111111
"2222222222222222222" "mirror_pool" "raidz_pool" \
112112
"mirror-pool" "raidz-pool" "spare" "spare_pool" \

0 commit comments

Comments
 (0)