From 57f932d5c23c80bf9415876ea277e780ce51873f Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 09 2020 19:32:55 +0000 Subject: import gfs2-utils-3.2.0-8.el8 --- diff --git a/SOURCES/bz1839219-mkfs_gfs2_Don_t_use_i_o_limits_hints_4K_for_block_size.patch b/SOURCES/bz1839219-mkfs_gfs2_Don_t_use_i_o_limits_hints_4K_for_block_size.patch new file mode 100644 index 0000000..f4884ff --- /dev/null +++ b/SOURCES/bz1839219-mkfs_gfs2_Don_t_use_i_o_limits_hints_4K_for_block_size.patch @@ -0,0 +1,41 @@ +commit b33f8871a821b7f0461dec89f0066a9cb6aa1c71 +Author: Andrew Price +Date: Wed May 27 12:31:58 2020 +0100 + + mkfs.gfs2: Don't use i/o limits hints <4K for block size + + Some devices report an optimal_io_size less than 4K. Currently mkfs.gfs2 + uses the non-zero value to choose the block size, which is almost + certainly a bad choice when it's less than 4K. Update choose_blocksize() + to avoid using device topology hints for the block size choice when + they're less than the default block size (4K). Test case included. + + Resolves: rhbz#1839219 + Signed-off-by: Andrew Price + +diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c +index 846b341f..412d4701 100644 +--- a/gfs2/mkfs/main_mkfs.c ++++ b/gfs2/mkfs/main_mkfs.c +@@ -505,7 +505,7 @@ static unsigned choose_blocksize(struct mkfs_opts *opts) + } + if (!opts->got_bsize && got_topol) { + if (dev->optimal_io_size <= getpagesize() && +- dev->optimal_io_size >= dev->minimum_io_size) ++ dev->optimal_io_size >= GFS2_DEFAULT_BSIZE) + bsize = dev->optimal_io_size; + else if (dev->physical_sector_size <= getpagesize() && + dev->physical_sector_size >= GFS2_DEFAULT_BSIZE) +diff --git a/tests/mkfs.at b/tests/mkfs.at +index 57785a0d..4c8b2249 100644 +--- a/tests/mkfs.at ++++ b/tests/mkfs.at +@@ -112,6 +112,8 @@ AT_CLEANUP + AT_SETUP([Device i/o limits handling]) + AT_KEYWORDS(mkfs.gfs2 mkfs) + AT_CHECK([$GFS_MKFS -p lock_nolock -o test_topology=0:0:0:0:0 $GFS_TGT], 0, [ignore], [ignore]) ++AT_CHECK([$GFS_MKFS -p lock_nolock -o test_topology=0:512:512:512:512 $GFS_TGT], 0, [ignore], [ignore]) ++AT_CHECK([gfs2_edit -p sb field sb_bsize $GFS_TGT | tr -d '\n' ], 0, [4096], [ignore]) + AT_CHECK([$GFS_MKFS -p lock_nolock -o test_topology=7168:512:0:33553920:512 $GFS_TGT], 0, [ignore], [ignore]) + AT_CHECK([$GFS_MKFS -p lock_nolock -o test_topology=7168:512:8192:33553920:512 $GFS_TGT], 0, [ignore], [Warning: device is not properly aligned. This may harm performance. + ]) diff --git a/SPECS/gfs2-utils.spec b/SPECS/gfs2-utils.spec index 274ce31..b43e78e 100644 --- a/SPECS/gfs2-utils.spec +++ b/SPECS/gfs2-utils.spec @@ -12,7 +12,7 @@ Name: gfs2-utils Version: 3.2.0 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2+ and LGPLv2+ Group: System Environment/Kernel Summary: Utilities for managing the global file system (GFS2) @@ -39,6 +39,8 @@ Patch2: bz1659490-gfs2_utils_Wrong_hash_value_used_to_clean_journals.patch Patch3: bz1698858-mkfs_gfs2_Improve_alignment_of_first_resource_group.patch Patch4: bz1757115-gfs2_5_General_updates_and_layout_improvements.patch Patch5: bz1693000-fsck_gfs2_8_Manpage_updates.patch +Patch6: bz1839219-mkfs_gfs2_Don_t_use_i_o_limits_hints_4K_for_block_size.patch + %prep %setup -q -n gfs2-utils-%{version} @@ -48,6 +50,7 @@ Patch5: bz1693000-fsck_gfs2_8_Manpage_updates.patch %patch3 -p1 -b .bz1698858-mkfs_gfs2_Improve_alignment_of_first_resource_group %patch4 -p1 -b .bz1757115-gfs2_5_General_updates_and_layout_improvements %patch5 -p1 -b .bz1693000-fsck_gfs2_8_Manpage_updates +%patch6 -p1 -b .bz1839219-mkfs_gfs2_Don_t_use_i_o_limits_hints_4K_for_block_size %build ./autogen.sh @@ -87,6 +90,10 @@ modifying, and correcting inconsistencies in GFS2 file systems. %{_prefix}/lib/udev/rules.d/82-gfs2-withdraw.rules %changelog +* Tue Jun 02 2020 Andrew Price - 3.2.0-8 +- mkfs.gfs2: Don't use i/o limits hints <4K for block size + Resolves: rhbz#1839219 + * Fri Oct 18 2019 Andrew Price - 3.2.0-7 - fsck.gfs2(8): Manpage updates Resolves: rhbz#1693000