From 895d39aa832a6d90cb15263f8bbe41509baa3867 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Thu, 1 Apr 2021 11:49:41 -0400 Subject: [PATCH] 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 Reviewed-by: Brian Behlendorf Reviewed-by: George Melikov Signed-off-by: Ryan Moeller Closes #11781 Closes #11813 --- module/zcommon/zfs_namecheck.c | 6 ------ .../tests/functional/pool_names/pool_names_002_neg.ksh | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/module/zcommon/zfs_namecheck.c b/module/zcommon/zfs_namecheck.c index 0011a971ca..7ecce451b4 100644 --- a/module/zcommon/zfs_namecheck.c +++ b/module/zcommon/zfs_namecheck.c @@ -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); } diff --git a/tests/zfs-tests/tests/functional/pool_names/pool_names_002_neg.ksh b/tests/zfs-tests/tests/functional/pool_names/pool_names_002_neg.ksh index 0c96e1999e..0b40f7cd27 100755 --- a/tests/zfs-tests/tests/functional/pool_names/pool_names_002_neg.ksh +++ b/tests/zfs-tests/tests/functional/pool_names/pool_names_002_neg.ksh @@ -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" \