mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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:
committed by
Brian Behlendorf
parent
bc9cef11fd
commit
c24fa4b19a
@@ -68,7 +68,7 @@ zfs_allocatable_devs(nvlist_t *nv)
|
||||
* Are there special vdevs?
|
||||
*/
|
||||
boolean_t
|
||||
zfs_special_devs(nvlist_t *nv)
|
||||
zfs_special_devs(nvlist_t *nv, char *type)
|
||||
{
|
||||
char *bias;
|
||||
uint_t c;
|
||||
@@ -84,7 +84,11 @@ zfs_special_devs(nvlist_t *nv)
|
||||
&bias) == 0) {
|
||||
if (strcmp(bias, VDEV_ALLOC_BIAS_SPECIAL) == 0 ||
|
||||
strcmp(bias, VDEV_ALLOC_BIAS_DEDUP) == 0) {
|
||||
return (B_TRUE);
|
||||
if (type != NULL && strcmp(bias, type) == 0) {
|
||||
return (B_TRUE);
|
||||
} else if (type == NULL) {
|
||||
return (B_TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user