Manually merge part of vendor import r238583 from Illumos.

Illumos changeset: 13680:2bd022a765e2
Illumos ZFS issue:

    2671 zpool import should not fail if vdev ashift has increased

MFC after:	3 days
This commit is contained in:
Xin LI 2013-07-18 00:22:42 +00:00
parent ba41c3c13f
commit c92bc5e996
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=253441
2 changed files with 10 additions and 6 deletions

View File

@ -3997,7 +3997,7 @@ print_dedup_stats(nvlist_t *config)
/* /*
* If the pool was faulted then we may not have been able to * If the pool was faulted then we may not have been able to
* obtain the config. Otherwise, if have anything in the dedup * obtain the config. Otherwise, if we have anything in the dedup
* table continue processing the stats. * table continue processing the stats.
*/ */
if (nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS, if (nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS,

View File

@ -1258,12 +1258,16 @@ vdev_open(vdev_t *vd)
vd->vdev_ashift = MAX(ashift, vd->vdev_ashift); vd->vdev_ashift = MAX(ashift, vd->vdev_ashift);
} else { } else {
/* /*
* Make sure the alignment requirement hasn't increased. * Detect if the alignment requirement has increased.
* We don't want to make the pool unavailable, just
* issue a warning instead.
*/ */
if (ashift > vd->vdev_top->vdev_ashift) { if (ashift > vd->vdev_top->vdev_ashift &&
vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, vd->vdev_ops->vdev_op_leaf) {
VDEV_AUX_BAD_LABEL); cmn_err(CE_WARN,
return (EINVAL); "Disk, '%s', has a block alignment that is "
"larger than the pool's alignment\n",
vd->vdev_path);
} }
vd->vdev_max_asize = max_asize; vd->vdev_max_asize = max_asize;
} }