diff --git a/SOURCES/bz1437009-mkfs_gfs2_Disable_rgrp_alignment_when_dev_topology_is_unsuitable.patch b/SOURCES/bz1437009-mkfs_gfs2_Disable_rgrp_alignment_when_dev_topology_is_unsuitable.patch new file mode 100644 index 0000000..aedbc8b --- /dev/null +++ b/SOURCES/bz1437009-mkfs_gfs2_Disable_rgrp_alignment_when_dev_topology_is_unsuitable.patch @@ -0,0 +1,35 @@ +commit c419b886b7520e1a92a984352baa0e122ff050e9 +Author: Andrew Price +Date: Thu Jan 26 11:05:42 2017 +0000 + + mkfs.gfs2: 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. + + Resolves: rhbz#1437009 + + Signed-off-by: Andrew Price + +diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c +index 4436f93..c3497a8 100644 +--- a/gfs2/mkfs/main_mkfs.c ++++ b/gfs2/mkfs/main_mkfs.c +@@ -590,8 +590,14 @@ static lgfs2_rgrps_t rgs_init(struct mkfs_opts *opts, struct gfs2_sbd *sdp) + al_off = opts->sunit / sdp->bsize; + } + } else if (opts->align) { +- if ((opts->dev.minimum_io_size > opts->dev.physical_sector_size) && +- (opts->dev.optimal_io_size > opts->dev.physical_sector_size)) { ++ if (opts->dev.optimal_io_size <= opts->dev.physical_sector_size || ++ opts->dev.minimum_io_size <= opts->dev.physical_sector_size || ++ (opts->dev.optimal_io_size % opts->dev.minimum_io_size) != 0) { ++ /* 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 alignment */ ++ opts->align = 0; ++ } else { + al_base = opts->dev.optimal_io_size / sdp->bsize; + al_off = opts->dev.minimum_io_size / sdp->bsize; + } diff --git a/SOURCES/bz1437125-gfs2_grow_Disable_rgrp_alignment_when_dev_topology_is_unsuitable.patch b/SOURCES/bz1437125-gfs2_grow_Disable_rgrp_alignment_when_dev_topology_is_unsuitable.patch new file mode 100644 index 0000000..50452da --- /dev/null +++ b/SOURCES/bz1437125-gfs2_grow_Disable_rgrp_alignment_when_dev_topology_is_unsuitable.patch @@ -0,0 +1,32 @@ +commit 64688d3f3a4fb2134cbb9f7fd2d1d500df893aac +Author: Andrew Price +Date: Tue Mar 28 21:32:42 2017 +0100 + + 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. + + Resolves: rhbz#1437125 + + Signed-off-by: Andrew Price + +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; + } diff --git a/SPECS/gfs2-utils.spec b/SPECS/gfs2-utils.spec index ba8a3bf..07d2a2d 100644 --- a/SPECS/gfs2-utils.spec +++ b/SPECS/gfs2-utils.spec @@ -12,7 +12,7 @@ Name: gfs2-utils Version: 3.1.9 -Release: 3%{?dist} +Release: 3%{?dist}.1 License: GPLv2+ and LGPLv2+ Group: System Environment/Kernel Summary: Utilities for managing the global file system (GFS2) @@ -45,6 +45,8 @@ Patch0: bz1348703-fsck_gfs2_undo_functions_can_stop_too_early_on_duplicates.patc Patch1: bz1350597-fsck_gfs2_link_count_checking_wrong_inode_s_formal_inode_number.patch Patch2: bz1350600-fsck_gfs2_check_formal_inode_number_when_links_go_from_1_to_2.patch Patch3: bz1326508-gfs2_5_Clarify_the_availability_of_the_loccookie_option.patch +Patch4: bz1437009-mkfs_gfs2_Disable_rgrp_alignment_when_dev_topology_is_unsuitable.patch +Patch5: bz1437125-gfs2_grow_Disable_rgrp_alignment_when_dev_topology_is_unsuitable.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -54,6 +56,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %patch1 -p1 -b .bz1350597-fsck_gfs2_link_count_checking_wrong_inode_s_formal_inode_number %patch2 -p1 -b .bz1350600-fsck_gfs2_check_formal_inode_number_when_links_go_from_1_to_2 %patch3 -p1 -b .bz1326508-gfs2_5_Clarify_the_availability_of_the_loccookie_option +%patch4 -p1 -b .bz1437009-mkfs_gfs2_Disable_rgrp_alignment_when_dev_topology_is_unsuitable +%patch5 -p1 -b .bz1437125-gfs2_grow_Disable_rgrp_alignment_when_dev_topology_is_unsuitable %build ./autogen.sh @@ -99,6 +103,12 @@ file systems. %{_prefix}/lib/udev/rules.d/82-gfs2-withdraw.rules %changelog +* Wed Mar 29 2017 Andrew Price - 3.1.9-3.1 +- mkfs.gfs2: Disable rgrp alignment when dev topology is unsuitable + Resolves: rhbz#1437009 +- gfs2_grow: Disable rgrp alignment when dev topology is unsuitable + Resolves: rhbz#1437125 + * Wed Jul 20 2016 Andrew Price - 3.1.9-3 - gfs2(5): Clarify the availability of the loccookie option Resolves: rhbz#1326508