Fix "zpool add -n" for dedup, special and log devices

For dedup, special and log devices "zpool add -n" does not print
correctly their vdev type:

~# zpool add -n pool dedup /tmp/dedup special /tmp/special log /tmp/log
would update 'pool' to the following configuration:
	pool
	  /tmp/normal
	  /tmp/dedup
	  /tmp/special
	  /tmp/log

This could lead storage administrators to modify their ZFS pools to
unexpected and unintended vdev configurations.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #9783 
Closes #9390
This commit is contained in:
loli10K
2020-01-07 00:40:06 +01:00
committed by Brian Behlendorf
parent bc9cef11fd
commit c24fa4b19a
5 changed files with 75 additions and 37 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ extern "C" {
#endif
extern boolean_t zfs_allocatable_devs(nvlist_t *);
extern boolean_t zfs_special_devs(nvlist_t *);
extern boolean_t zfs_special_devs(nvlist_t *, char *);
extern void zpool_get_load_policy(nvlist_t *, zpool_load_policy_t *);
extern int zfs_zpl_version_map(int spa_version);