]> granicus.if.org Git - zfs/commitdiff
Exclude log device ashift from normal class
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 29 May 2019 18:35:50 +0000 (11:35 -0700)
committerGitHub <noreply@github.com>
Wed, 29 May 2019 18:35:50 +0000 (11:35 -0700)
When opening a log device during import its allocation bias will
not yet have been set by vdev_load().  This results in the log
device's ashift being incorrectly applied to the maximum ashift
of the vdevs in the normal class.  Which in turn prevents the
removal of any top-level devices due to the ashift check in the
spa_vdev_remove_top_check() function.

This issue is resolved by including vdev_islog in the check since
it will be set correctly during vdev_open().

Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8735

module/zfs/vdev.c

index 085ae687315041ec5a3291a487cce882a6afc68e..1c4812cd86d926888b17538fa328fa7d746ddf41 100644 (file)
@@ -1852,13 +1852,10 @@ vdev_open(vdev_t *vd)
 
        /*
         * Track the min and max ashift values for normal data devices.
-        *
-        * DJB - TBD these should perhaps be tracked per allocation class
-        * (e.g. spa_min_ashift is used to round up post compression buffers)
         */
        if (vd->vdev_top == vd && vd->vdev_ashift != 0 &&
            vd->vdev_alloc_bias == VDEV_BIAS_NONE &&
-           vd->vdev_aux == NULL) {
+           vd->vdev_islog == 0 && 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)