aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Hutter <[email protected]>2016-11-04 13:34:13 -0700
committerBrian Behlendorf <[email protected]>2016-11-04 13:34:13 -0700
commit1ad9de6d08f8c0261094d322a4507a5cbbb53e66 (patch)
treeaa5c712bdc7749b1f159d4c621fc8b440451feae
parent7f3194932d22c667026aff1b263ceaa1ebd012ee (diff)
Allow autoreplace even when enclosure LED sysfs entries don't exist
The previous autoreplace code assumed that if you were using autoreplace, then you also had the enclosure SES driver loaded. This could lead to autoreplace not working if the SES driver wasn't loaded, or if it wasn't creating the proper enclosure_device symlinks (which has happened). This patch removes that assumption. Reviewed by: Don Brady <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes #5363
-rw-r--r--cmd/zed/agents/zfs_mod.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/zed/agents/zfs_mod.c b/cmd/zed/agents/zfs_mod.c
index a073956b2..70548571a 100644
--- a/cmd/zed/agents/zfs_mod.c
+++ b/cmd/zed/agents/zfs_mod.c
@@ -404,8 +404,8 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
nvlist_add_string(newvd, ZPOOL_CONFIG_DEVID, new_devid) != 0 ||
(physpath != NULL && nvlist_add_string(newvd,
ZPOOL_CONFIG_PHYS_PATH, physpath) != 0) ||
- nvlist_add_string(newvd, ZPOOL_CONFIG_VDEV_ENC_SYSFS_PATH,
- enc_sysfs_path) != 0 ||
+ (enc_sysfs_path != NULL && nvlist_add_string(newvd,
+ ZPOOL_CONFIG_VDEV_ENC_SYSFS_PATH, enc_sysfs_path) != 0) ||
nvlist_add_uint64(newvd, ZPOOL_CONFIG_WHOLE_DISK, wholedisk) != 0 ||
nvlist_add_string(nvroot, ZPOOL_CONFIG_TYPE, VDEV_TYPE_ROOT) != 0 ||
nvlist_add_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN, &newvd,