[Cluster-devel] [PATCH] gfs2_grow: Disable rgrp alignment when dev topology is unsuitable

Andrew Price anprice at redhat.com
Wed Mar 29 09:50:46 UTC 2017


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.

Signed-off-by: Andrew Price <anprice at redhat.com>
---
 gfs2/mkfs/main_grow.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index 173466c..66ba057 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -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;
 			}
-- 
2.9.3




More information about the Cluster-devel mailing list