|
|
744fcf |
commit ae565c82568a8b8068c225d8534c68c9989ccbe3
|
|
|
744fcf |
Author: Andrew Price <anprice@redhat.com>
|
|
|
744fcf |
Date: Tue Mar 28 21:32:42 2017 +0100
|
|
|
744fcf |
|
|
|
744fcf |
gfs2_grow: Disable rgrp alignment when dev topology is unsuitable
|
|
|
744fcf |
|
|
|
744fcf |
If optimal_io_size is not a multiple of minimum_io_size then the values
|
|
|
744fcf |
are not reliable swidth and sunit values, so disable rgrp stripe
|
|
|
744fcf |
alignment in that case.
|
|
|
744fcf |
|
|
|
744fcf |
Resolves: rhbz#1436772
|
|
|
744fcf |
|
|
|
744fcf |
Signed-off-by: Andrew Price <anprice@redhat.com>
|
|
|
744fcf |
|
|
|
744fcf |
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
|
|
|
744fcf |
index 173466c..66ba057 100644
|
|
|
744fcf |
--- a/gfs2/mkfs/main_grow.c
|
|
|
744fcf |
+++ b/gfs2/mkfs/main_grow.c
|
|
|
744fcf |
@@ -169,8 +169,12 @@ static lgfs2_rgrps_t rgrps_init(struct gfs2_sbd *sdp)
|
|
|
744fcf |
unsigned long min_io_sz = blkid_topology_get_minimum_io_size(tp);
|
|
|
744fcf |
unsigned long opt_io_sz = blkid_topology_get_optimal_io_size(tp);
|
|
|
744fcf |
unsigned long phy_sector_sz = blkid_topology_get_physical_sector_size(tp);
|
|
|
744fcf |
+ /* If optimal_io_size is not a multiple of minimum_io_size then
|
|
|
744fcf |
+ the values are not reliable swidth and sunit values, so don't
|
|
|
744fcf |
+ attempt rgrp alignment */
|
|
|
744fcf |
if ((min_io_sz > phy_sector_sz) &&
|
|
|
744fcf |
- (opt_io_sz > phy_sector_sz)) {
|
|
|
744fcf |
+ (opt_io_sz > phy_sector_sz) &&
|
|
|
744fcf |
+ (opt_io_sz % min_io_sz == 0)) {
|
|
|
744fcf |
al_base = opt_io_sz / sdp->bsize;
|
|
|
744fcf |
al_off = min_io_sz / sdp->bsize;
|
|
|
744fcf |
}
|