From: Andrew Price Date: Wed, 29 Mar 2017 10:50:46 +0100 Subject: [Cluster-devel] [PATCH] gfs2_grow: Disable rgrp alignment when dev topology is unsuitable Message-ID: <20170329095046.18549-1-anprice@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- 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