Skip to contentSkip to conversation

gfs2_grow: Disable rgrp alignment when dev topology is unsuitable

PATCH New Andrew Price 1 participant 1 message Mar 29, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gfs2_grow: Disable rgrp alignment when dev topology is unsuitable

If optimal_io_size is not a multiple of minimum_io_size then the values are not reliable swidth and sunit values, so disable rgrp stripe alignment in that case.

---
 gfs2/mkfs/main_grow.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
gfs2/mkfs/main_grow.c +5 -1
index 173466c..66ba057 100644
@@ -169,8 +169,12 @@ static lgfs2_rgrps_t rgrps_init(struct gfs2_sbd *sdp)
 			unsigned long min_io_sz = blkid_topology_get_minimum_io_size(tp);
 			unsigned long opt_io_sz = blkid_topology_get_optimal_io_size(tp);
 			unsigned long phy_sector_sz = blkid_topology_get_physical_sector_size(tp);
+			/* If optimal_io_size is not a multiple of minimum_io_size then
+			   the values are not reliable swidth and sunit values, so don't
+			   attempt rgrp alignment */
 			if ((min_io_sz > phy_sector_sz) &&
-			    (opt_io_sz > phy_sector_sz)) {
+			    (opt_io_sz > phy_sector_sz) &&
+			    (opt_io_sz % min_io_sz == 0)) {
 					al_base = opt_io_sz / sdp->bsize;
 					al_off = min_io_sz / sdp->bsize;
 			}
Signature · 1 line
2.9.3