Skip to content

Commit 727506c

Browse files
amotintonyhutter
authored andcommitted
On the first vdev open ignore impossible ashift hints
If on the first open device's logical ashift is bigger than set by pool's ashift property, ignore the last as unusable instead of creating vdev that will fail most of I/Os due to misalignment. Reviewed-by: Rob Norris <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ameer Hamza <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes openzfs#16690
1 parent 73b3e8a commit 727506c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

module/zfs/vdev.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,10 +2178,11 @@ vdev_open(vdev_t *vd)
21782178
vd->vdev_max_asize = max_asize;
21792179

21802180
/*
2181-
* If the vdev_ashift was not overridden at creation time,
2181+
* If the vdev_ashift was not overridden at creation time
2182+
* (0) or the override value is impossible for the device,
21822183
* then set it the logical ashift and optimize the ashift.
21832184
*/
2184-
if (vd->vdev_ashift == 0) {
2185+
if (vd->vdev_ashift < vd->vdev_logical_ashift) {
21852186
vd->vdev_ashift = vd->vdev_logical_ashift;
21862187

21872188
if (vd->vdev_logical_ashift > ASHIFT_MAX) {

0 commit comments

Comments
 (0)