aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs/libzfs_pool.c
diff options
context:
space:
mode:
authorSara Hartse <[email protected]>2018-05-31 10:36:37 -0700
committerBrian Behlendorf <[email protected]>2018-05-31 10:36:37 -0700
commit74d42600d8d391dab5c57e87e81f97e0ca07b7b2 (patch)
tree8a32fc9cfbcc8a61e5fc0f6e00757dd2adb73b6d /lib/libzfs/libzfs_pool.c
parentd1f06ec5bccae26639b7bb6bd3925f9998848f86 (diff)
zpool reopen should detect expanded devices
Update bdev_capacity to have wholedisk vdevs query the size of the underlying block device (correcting for the size of the efi parition and partition alignment) and therefore detect expanded space. Correct vdev_get_stats_ex so that the expandsize is aligned to metaslab size and new space is only reported if it is large enough for a new metaslab. Reviewed by: Don Brady <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Reviewed by: John Wren Kennedy <[email protected]> Signed-off-by: sara hartse <[email protected]> External-issue: LX-165 Closes #7546 Issue #7582
Diffstat (limited to 'lib/libzfs/libzfs_pool.c')
-rw-r--r--lib/libzfs/libzfs_pool.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c
index d082a5f66..935b42993 100644
--- a/lib/libzfs/libzfs_pool.c
+++ b/lib/libzfs/libzfs_pool.c
@@ -22,7 +22,7 @@
/*
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2017 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2018 by Delphix. All rights reserved.
* Copyright 2016 Igor Kozhukhov <[email protected]>
* Copyright (c) 2017 Datto Inc.
* Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
@@ -44,6 +44,7 @@
#include <sys/systeminfo.h>
#include <sys/vtoc.h>
#include <sys/zfs_ioctl.h>
+#include <sys/vdev_disk.h>
#include <dlfcn.h>
#include "zfs_namecheck.h"
@@ -926,17 +927,6 @@ zpool_prop_get_feature(zpool_handle_t *zhp, const char *propname, char *buf,
}
/*
- * Don't start the slice at the default block of 34; many storage
- * devices will use a stripe width of 128k, other vendors prefer a 1m
- * alignment. It is best to play it safe and ensure a 1m alignment
- * given 512B blocks. When the block size is larger by a power of 2
- * we will still be 1m aligned. Some devices are sensitive to the
- * partition ending alignment as well.
- */
-#define NEW_START_BLOCK 2048
-#define PARTITION_END_ALIGNMENT 2048
-
-/*
* Validate the given pool name, optionally putting an extended error message in
* 'buf'.
*/