summaryrefslogtreecommitdiff
path: root/lib/libzfs/libzfs_pool.c
diff options
context:
space:
mode:
authorNed Bass <bass6@llnl.gov>2012-02-29 18:08:20 +0000
committerBrian Behlendorf <behlendorf1@llnl.gov>2012-03-05 17:49:50 +0000
commit613d88eda89945bb0011ddc05d3bd064bf1a8e1b (patch)
tree15d24445dc675b198b50e47800e49c803264598d /lib/libzfs/libzfs_pool.c
parentec2626ad3f695a2ced3946c4197ef64cbcac4959 (diff)
Diffstat (limited to 'lib/libzfs/libzfs_pool.c')
-rw-r--r--lib/libzfs/libzfs_pool.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c
index 4b4d81f7b865..311def6b6279 100644
--- a/lib/libzfs/libzfs_pool.c
+++ b/lib/libzfs/libzfs_pool.c
@@ -672,10 +672,12 @@ zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp)
* 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
- * give 512b blocks. When the block size is larger by a power of 2
- * we will still be 1m aligned.
+ * 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 NEW_START_BLOCK 2048
+#define PARTITION_END_ALIGNMENT 2048
/*
* Validate the given pool name, optionally putting an extended error message in
@@ -3786,6 +3788,7 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name)
if (start_block == MAXOFFSET_T)
start_block = NEW_START_BLOCK;
slice_size -= start_block;
+ slice_size = P2ALIGN(slice_size, PARTITION_END_ALIGNMENT);
vtoc->efi_parts[0].p_start = start_block;
vtoc->efi_parts[0].p_size = slice_size;