diff options
author | Arkadiusz Bubała <[email protected]> | 2017-10-26 21:26:09 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-10-26 12:26:09 -0700 |
commit | d3f2cd7e3b70679f127dd471ea6d37ece27463f2 (patch) | |
tree | c83555f629c501dd5742272c62888caa785b7468 /cmd/zed/agents | |
parent | 3ad59c015dce45965fa309a0364a46c6f8bdda9f (diff) |
Added no_scrub_restart flag to zpool reopen
Added -n flag to zpool reopen that allows a running scrub
operation to continue if there is a device with Dirty Time Log.
By default if a component device has a DTL and zpool reopen
is executed all running scan operations will be restarted.
Added functional tests for `zpool reopen`
Tests covers following scenarios:
* `zpool reopen` without arguments,
* `zpool reopen` with pool name as argument,
* `zpool reopen` while scrubbing,
* `zpool reopen -n` while scrubbing,
* `zpool reopen -n` while resilvering,
* `zpool reopen` with bad arguments.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tom Caputi <[email protected]>
Signed-off-by: Arkadiusz Bubała <[email protected]>
Closes #6076
Closes #6746
Diffstat (limited to 'cmd/zed/agents')
-rw-r--r-- | cmd/zed/agents/zfs_mod.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/zed/agents/zfs_mod.c b/cmd/zed/agents/zfs_mod.c index a906decab..5fa74d0ce 100644 --- a/cmd/zed/agents/zfs_mod.c +++ b/cmd/zed/agents/zfs_mod.c @@ -23,6 +23,7 @@ * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2016, 2017, Intel Corporation. + * Copyright (c) 2017 Open-E, Inc. All Rights Reserved. */ /* @@ -722,6 +723,8 @@ zfsdle_vdev_online(zpool_handle_t *zhp, void *data) (void) strlcpy(fullpath, path, sizeof (fullpath)); if (wholedisk) { char *spath = zfs_strip_partition(fullpath); + boolean_t scrub_restart = B_TRUE; + if (!spath) { zed_log_msg(LOG_INFO, "%s: Can't alloc", __func__); @@ -736,7 +739,7 @@ zfsdle_vdev_online(zpool_handle_t *zhp, void *data) * device so that the kernel can update the size * of the expanded device. */ - (void) zpool_reopen(zhp); + (void) zpool_reopen_one(zhp, &scrub_restart); } if (zpool_get_prop_int(zhp, ZPOOL_PROP_AUTOEXPAND, NULL)) { |