From f0402cb21544de5cbfac8ea4f013803c7f4d1394 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 10 2020 09:48:20 +0000 Subject: import gfs2-utils-3.1.10-11.el7_9.1 --- diff --git a/SOURCES/bz1853625-mkfs_gfs2_Don_t_use_i_o_limits_hints_4K_for_block_size.patch b/SOURCES/bz1853625-mkfs_gfs2_Don_t_use_i_o_limits_hints_4K_for_block_size.patch new file mode 100644 index 0000000..048e5ea --- /dev/null +++ b/SOURCES/bz1853625-mkfs_gfs2_Don_t_use_i_o_limits_hints_4K_for_block_size.patch @@ -0,0 +1,41 @@ +commit 8b4170f90c6fa805c3fb82ffc3d53b81c7cb1d65 +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#1853625 + Signed-off-by: Andrew Price + +diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c +index 24e5a850..e69a5341 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 68195e93..2d237a56 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 75d0d4b..72a0a2c 100644 --- a/SPECS/gfs2-utils.spec +++ b/SPECS/gfs2-utils.spec @@ -12,7 +12,7 @@ Name: gfs2-utils Version: 3.1.10 -Release: 11%{?dist} +Release: 11%{?dist}.1 License: GPLv2+ and LGPLv2+ Group: System Environment/Kernel Summary: Utilities for managing the global file system (GFS2) @@ -32,7 +32,7 @@ BuildRequires: check-devel URL: https://pagure.io/gfs2-utils %if 0%{?rhel} > 0 -ExclusiveArch: x86_64 s390x ppc64le %{ix86} aarch64 +ExclusiveArch: x86_64 s390x ppc64le %endif # The source for this package was pulled from the upstream git tree. @@ -63,7 +63,7 @@ Patch17: bz1487726-6-fsck_gfs2_Retain_context_for_indirect_pointers_in_check_met Patch18: bz1487726-7-fsck_gfs2_Clear_bad_indirect_block_pointers_when_bitmap_meets_expectations.patch Patch19: bz1837640-1-gfs2_jadd_Handle_out_of_space_issues.patch Patch20: bz1837640-2-gfs2_jadd_error_handling_overhaul.patch - +Patch21: bz1853625-mkfs_gfs2_Don_t_use_i_o_limits_hints_4K_for_block_size.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -90,6 +90,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %patch18 -p1 -b .bz1487726-7-fsck_gfs2_Clear_bad_indirect_block_pointers_when_bitmap_meets_expectations %patch19 -p1 -b .bz1837640-1-gfs2_jadd_Handle_out_of_space_issues %patch20 -p1 -b .bz1837640-2-gfs2_jadd_error_handling_overhaul +%patch21 -p1 -b .bz1853625-mkfs_gfs2_Don_t_use_i_o_limits_hints_4K_for_block_size %build ./autogen.sh @@ -135,6 +136,10 @@ file systems. %{_prefix}/lib/udev/rules.d/82-gfs2-withdraw.rules %changelog +* Thu Oct 01 2020 Andrew Price - 3.1.10-11.1 +- mkfs.gfs2: Don't use i/o limits hints <4K for block size + Resolves: rhbz#1853625 + * Mon Jun 08 2020 Andrew Price - 3.1.10-11 - gfs2_jadd: Handle out-of-space issues - gfs2_jadd: error handling overhaul