mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-27 18:34:22 +03:00
Fix don't zero_label when replace with spare
When replacing a disk with non-wholedisk spare, we shouldn't zero_label it. The wholedisk case already skip it. In fact, zero_label function will fail saying device busy because it's already opened exclusively, but since there's no error checking, the replace command will succeed, causing great confusion. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chunwei Chen <david.chen@osnexus.com> Closes #6369
This commit is contained in:
parent
d6bcf7ff5e
commit
83a5e4d6b9
@ -1227,7 +1227,8 @@ make_disks(zpool_handle_t *zhp, nvlist_t *nv)
|
||||
if (is_mpath_whole_disk(path))
|
||||
update_vdev_config_dev_strs(nv);
|
||||
|
||||
(void) zero_label(path);
|
||||
if (!is_spare(NULL, path))
|
||||
(void) zero_label(path);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user