summaryrefslogtreecommitdiff
path: root/usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c')
-rw-r--r--usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c b/usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c
index 82c296a669..6a25af90f9 100644
--- a/usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c
+++ b/usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c
@@ -23,6 +23,7 @@
* Copyright (c) 2012 by Delphix. All rights reserved.
* Copyright 2016 Nexenta Systems, Inc. All rights reserved.
* Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
+ * Copyright 2022 Oxide Computer Company
*/
/*
@@ -564,6 +565,13 @@ zfsdle_vdev_online(zpool_handle_t *zhp, void *data)
char *path, fullpath[MAXPATHLEN];
uint64_t wholedisk = 0ULL;
+ /*
+ * If the /dev path of the device is invalid because the disk
+ * has been moved to a new location, we need to try to refresh
+ * that path before onlining the device.
+ */
+ zpool_vdev_refresh_path(g_zfshdl, zhp, tgt);
+
verify(nvlist_lookup_string(tgt, ZPOOL_CONFIG_PATH,
&path) == 0);
verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_WHOLE_DISK,