From a9effb6e42e9600195226ffe50642bce00f9d062 Mon Sep 17 00:00:00 2001 From: Joseph Qi Date: Mon, 15 May 2023 19:29:09 +0800 Subject: [PATCH] support resize2fs on bigalloc filesystem Remove bigalloc warning for online resizing, also fix a resize2fs bug as well. Signed-off-by: Joseph Qi --- ...ee-blocks-count-sanity-check-for-64-.patch | 33 +++++++++++++++++++ ...-bigalloc-warning-for-online-resizin.patch | 31 +++++++++++++++++ e2fsprogs.spec | 10 +++++- 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 0004-resize2fs-fix-free-blocks-count-sanity-check-for-64-.patch create mode 100644 0005-resize2fs-remove-bigalloc-warning-for-online-resizin.patch diff --git a/0004-resize2fs-fix-free-blocks-count-sanity-check-for-64-.patch b/0004-resize2fs-fix-free-blocks-count-sanity-check-for-64-.patch new file mode 100644 index 0000000..83667e0 --- /dev/null +++ b/0004-resize2fs-fix-free-blocks-count-sanity-check-for-64-.patch @@ -0,0 +1,33 @@ +From 502f4f4962f8045157450eb259262bf7adc96ebd Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Thu, 2 Nov 2017 09:36:37 -0400 +Subject: [PATCH] resize2fs: fix free blocks count sanity check for 64-bit file + systems + +The sanity check that the free blocks count is not insane could fail +with a false positive on 64-bit file systems. Fix it. + +Reported-by: Ian Astle +Signed-off-by: Theodore Ts'o +Signed-off-by: Joseph Qi +--- + resize/main.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/resize/main.c b/resize/main.c +index ab7375c1..09853dbf 100644 +--- a/resize/main.c ++++ b/resize/main.c +@@ -440,7 +440,8 @@ int main (int argc, char ** argv) + !print_min_size) + checkit = 1; + +- if ((fs->super->s_free_blocks_count > fs->super->s_blocks_count) || ++ if ((ext2fs_free_blocks_count(fs->super) > ++ ext2fs_blocks_count(fs->super)) || + (fs->super->s_free_inodes_count > fs->super->s_inodes_count)) + checkit = 1; + +-- +2.24.4 + diff --git a/0005-resize2fs-remove-bigalloc-warning-for-online-resizin.patch b/0005-resize2fs-remove-bigalloc-warning-for-online-resizin.patch new file mode 100644 index 0000000..eb02fce --- /dev/null +++ b/0005-resize2fs-remove-bigalloc-warning-for-online-resizin.patch @@ -0,0 +1,31 @@ +From f52be3cc9bd0789c06ff6601656c8f32a3e52bb8 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Tue, 27 Feb 2018 01:27:10 -0500 +Subject: [PATCH] resize2fs: remove bigalloc warning for online resizing + +The kernel supports online resizing of bigalloc file systems. There's +no real point to have a scary messaging when doing an online resize of +bigalloc file systems, since all of the heavy lifting is done by the +kernel. + +Signed-off-by: Theodore Ts'o +Signed-off-by: Joseph Qi +--- + resize/main.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/resize/main.c b/resize/main.c +index 09853dbf..d8fe7330 100644 +--- a/resize/main.c ++++ b/resize/main.c +@@ -605,7 +605,6 @@ int main (int argc, char ** argv) + exit(0); + } + if (mount_flags & EXT2_MF_MOUNTED) { +- bigalloc_check(fs, force); + retval = online_resize_fs(fs, mtpt, &new_size, flags); + } else { + bigalloc_check(fs, force); +-- +2.24.4 + diff --git a/e2fsprogs.spec b/e2fsprogs.spec index 4cabead..296d4e9 100644 --- a/e2fsprogs.spec +++ b/e2fsprogs.spec @@ -1,7 +1,7 @@ Summary: Utilities for managing ext2, ext3, and ext4 filesystems Name: e2fsprogs Version: 1.43.5 -Release: 8.3%{?dist} +Release: 8.4%{?dist} # License tags based on COPYING file distinctions for various components License: GPLv2 @@ -15,6 +15,8 @@ Patch2: e2fsprogs-1.43.5-build-fix.patch Patch100: 0001-e2fsck-abort-if-there-is-a-corrupted-directory-block.patch Patch101: 0002-libsupport-add-checks-to-prevent-buffer-overrun-bugs.patch Patch102: 0003-e2fsck-clarify-overflow-link-count-error-message.patch +Patch103: 0004-resize2fs-fix-free-blocks-count-sanity-check-for-64-.patch +Patch104: 0005-resize2fs-remove-bigalloc-warning-for-online-resizin.patch Url: http://e2fsprogs.sourceforge.net/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -159,6 +161,8 @@ It was originally inspired by the Multics SubSystem library. %patch100 -p1 %patch101 -p1 %patch102 -p1 +%patch103 -p1 +%patch104 -p1 %build %configure CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ @@ -340,6 +344,10 @@ exit 0 %{_libdir}/pkgconfig/ss.pc %changelog +* Mon May 15 2023 Joseph Qi - 1.43.5-8.4 +- resize2fs: fix free blocks count sanity check for 64-bit file system +- resize2fs: remove bigalloc warning for online resizing + * Thu Sep 9 2021 Hang Zhao <1209176326@qq.com> - 1.43.5-8.3 - Update to e2fsprogs-1.43.5-8.3.al7 -- Gitee