summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorYuri Pankov <yuri.pankov@nexenta.com>2014-02-26 14:01:40 +0100
committerGordon Ross <gwr@nexenta.com>2014-11-04 12:31:34 -0500
commitacd07c6b871cfa70bc42c9278037a17c430897b6 (patch)
tree492acbbce17f7ce7e7558a98348e0f2eff51726e /usr/src
parent2f5a01126fee81fbe9fff04d4412c2834e3944b8 (diff)
downloadillumos-joyent-acd07c6b871cfa70bc42c9278037a17c430897b6.tar.gz
4449 Offlined vdevs are online after reboot
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com> Reviewed by: Dan McDonald <danmcd@omniti.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Approved by: Gordon Ross <gwr@nexenta.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c10
1 files changed, 7 insertions, 3 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 f05aeeabfa..8fff5c748a 100644
--- a/usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c
+++ b/usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
- * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -152,6 +152,7 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t isdisk)
vdev_state_t newstate;
nvlist_t *nvroot, *newvd;
uint64_t wholedisk = 0ULL;
+ uint64_t offline = 0ULL;
char *physpath = NULL;
char rawpath[PATH_MAX], fullpath[PATH_MAX];
size_t len;
@@ -161,6 +162,7 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t isdisk)
(void) nvlist_lookup_string(vdev, ZPOOL_CONFIG_PHYS_PATH, &physpath);
(void) nvlist_lookup_uint64(vdev, ZPOOL_CONFIG_WHOLE_DISK, &wholedisk);
+ (void) nvlist_lookup_uint64(vdev, ZPOOL_CONFIG_OFFLINE, &offline);
/*
* We should have a way to online a device by guid. With the current
@@ -174,9 +176,11 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t isdisk)
* Attempt to online the device. It would be nice to online this by
* GUID, but the current interface only supports lookup by path.
*/
- if (zpool_vdev_online(zhp, fullpath,
+ if (offline ||
+ (zpool_vdev_online(zhp, fullpath,
ZFS_ONLINE_CHECKREMOVE | ZFS_ONLINE_UNSPARE, &newstate) == 0 &&
- (newstate == VDEV_STATE_HEALTHY || newstate == VDEV_STATE_DEGRADED))
+ (newstate == VDEV_STATE_HEALTHY ||
+ newstate == VDEV_STATE_DEGRADED)))
return;
/*