summaryrefslogtreecommitdiffstats
path: root/module/zfs/vdev.c
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2015-05-19 22:14:01 -0600
committerBrian Behlendorf <[email protected]>2015-06-10 16:24:01 -0700
commitc3520e7f1f567bd4e6a28eff4867c70850e8a854 (patch)
treefa4841c8118ce6129ee4931d868dd015d60a7643 /module/zfs/vdev.c
parent9c43027b3f18769f2ace16eaa222ac8b301501f4 (diff)
Illumos 5818 - zfs {ref}compressratio is incorrect with 4k sector size
5818 zfs {ref}compressratio is incorrect with 4k sector size Reviewed by: Alex Reece <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Richard Elling <[email protected]> Reviewed by: Steven Hartland <[email protected]> Approved by: Albert Lee <[email protected]> References: https://www.illumos.org/issues/5818 https://github.com/illumos/illumos-gate/commit/81cd5c5 Ported-by: Don Brady <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #3432
Diffstat (limited to 'module/zfs/vdev.c')
-rw-r--r--module/zfs/vdev.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c
index d53537103..fe2ecdc72 100644
--- a/module/zfs/vdev.c
+++ b/module/zfs/vdev.c
@@ -22,7 +22,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
*/
#include <sys/zfs_context.h>
@@ -206,8 +206,9 @@ vdev_add_child(vdev_t *pvd, vdev_t *cvd)
size_t oldsize, newsize;
uint64_t id = cvd->vdev_id;
vdev_t **newchild;
+ spa_t *spa = cvd->vdev_spa;
- ASSERT(spa_config_held(cvd->vdev_spa, SCL_ALL, RW_WRITER) == SCL_ALL);
+ ASSERT(spa_config_held(spa, SCL_ALL, RW_WRITER) == SCL_ALL);
ASSERT(cvd->vdev_parent == NULL);
cvd->vdev_parent = pvd;
@@ -1337,6 +1338,17 @@ vdev_open(vdev_t *vd)
}
/*
+ * Track the min and max ashift values for normal data devices.
+ */
+ if (vd->vdev_top == vd && vd->vdev_ashift != 0 &&
+ !vd->vdev_islog && vd->vdev_aux == NULL) {
+ if (vd->vdev_ashift > spa->spa_max_ashift)
+ spa->spa_max_ashift = vd->vdev_ashift;
+ if (vd->vdev_ashift < spa->spa_min_ashift)
+ spa->spa_min_ashift = vd->vdev_ashift;
+ }
+
+ /*
* If a leaf vdev has a DTL, and seems healthy, then kick off a
* resilver. But don't do this if we are doing a reopen for a scrub,
* since this would just restart the scrub we are already doing.