From c494aa7f578d5cb844b770f679bd46495242edad Mon Sep 17 00:00:00 2001 From: George Wilson Date: Fri, 18 Sep 2020 14:13:47 -0500 Subject: vdev_ashift should only be set once == Motivation and Context The new vdev ashift optimization prevents the removal of devices when a zfs configuration is comprised of disks which have different logical and physical block sizes. This is caused because we set 'spa_min_ashift' in vdev_open and then later call 'vdev_ashift_optimize'. This would result in an inconsistency between spa's ashift calculations and that of the top-level vdev. In addition, the optimization logical ignores the overridden ashift value that would be provided by '-o ashift='. == Description This change reworks the vdev ashift optimization so that it's only set the first time the device is configured. It still allows the physical and logical ahsift values to be set every time the device is opened but those values are only consulted on first open. Reviewed-by: Matthew Ahrens Reviewed-by: Brian Behlendorf Reviewed-by: Cedric Berger Signed-off-by: George Wilson External-Issue: DLPX-71831 Closes #10932 --- module/zfs/spa.c | 1 - 1 file changed, 1 deletion(-) (limited to 'module/zfs/spa.c') diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 8c662f6b0..532f04b91 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -5762,7 +5762,6 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_t *props, for (int c = 0; error == 0 && c < rvd->vdev_children; c++) { vdev_t *vd = rvd->vdev_child[c]; - vdev_ashift_optimize(vd); vdev_metaslab_set_size(vd); vdev_expand(vd, txg); } -- cgit v1.2.3