diff --git a/0016-tests-new-test-to-check-quota-after-directory-optimi.patch b/0016-tests-new-test-to-check-quota-after-directory-optimi.patch new file mode 100644 index 0000000000000000000000000000000000000000..7108a8e03007f4dd9ad28e599f3343b6d11cd616 --- /dev/null +++ b/0016-tests-new-test-to-check-quota-after-directory-optimi.patch @@ -0,0 +1,73 @@ +From 7805308b7a111c3943d92eab412b048d059ce108 Mon Sep 17 00:00:00 2001 +From: "Luis Henriques (SUSE)" +Date: Fri, 5 Apr 2024 15:24:04 +0100 +Subject: [PATCH 1/2] tests: new test to check quota after directory + optimization + +This new test validates e2fsck by verifying that quota data is updated after a +directory optimization is performed. This issue was initially found by fstest +ext4/014, and this test was based on it. It includes a filesystem image where +the lost+found directory is unlinked after a new link to it is created: + + # debugfs -w -R "ln lost+found foo" f_testnew/image + # debugfs -w -R "unlink lost+found" f_testnew/image + +Signed-off-by: Luis Henriques (SUSE) +Link: https://lore.kernel.org/r/20240405142405.12312-4-luis.henriques@linux.dev +Signed-off-by: Theodore Ts'o +--- + tests/f_quota_shrinkdir/expect.1 | 18 ++++++++++++++++++ + tests/f_quota_shrinkdir/expect.2 | 7 +++++++ + tests/f_quota_shrinkdir/name | 1 + + 3 files changed, 26 insertions(+) + create mode 100644 tests/f_quota_shrinkdir/expect.1 + create mode 100644 tests/f_quota_shrinkdir/expect.2 + create mode 100644 tests/f_quota_shrinkdir/name + +diff --git a/tests/f_quota_shrinkdir/expect.1 b/tests/f_quota_shrinkdir/expect.1 +new file mode 100644 +index 00000000..e4fc48ea +--- /dev/null ++++ b/tests/f_quota_shrinkdir/expect.1 +@@ -0,0 +1,18 @@ ++Pass 1: Checking inodes, blocks, and sizes ++Pass 2: Checking directory structure ++Pass 3: Checking directory connectivity ++/lost+found not found. Create? yes ++ ++Pass 3A: Optimizing directories ++Pass 4: Checking reference counts ++Pass 5: Checking group summary information ++[QUOTA WARNING] Usage inconsistent for ID 0:actual (3072, 3) != expected (13312, 2) ++Update quota info for quota type 0? yes ++ ++[QUOTA WARNING] Usage inconsistent for ID 0:actual (3072, 3) != expected (13312, 2) ++Update quota info for quota type 1? yes ++ ++ ++test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** ++test_filesys: 12/256 files (16.7% non-contiguous), 1145/8192 blocks ++Exit status is 1 +diff --git a/tests/f_quota_shrinkdir/expect.2 b/tests/f_quota_shrinkdir/expect.2 +new file mode 100644 +index 00000000..fcb2cb81 +--- /dev/null ++++ b/tests/f_quota_shrinkdir/expect.2 +@@ -0,0 +1,7 @@ ++Pass 1: Checking inodes, blocks, and sizes ++Pass 2: Checking directory structure ++Pass 3: Checking directory connectivity ++Pass 4: Checking reference counts ++Pass 5: Checking group summary information ++test_filesys: 12/256 files (16.7% non-contiguous), 1145/8192 blocks ++Exit status is 0 +diff --git a/tests/f_quota_shrinkdir/name b/tests/f_quota_shrinkdir/name +new file mode 100644 +index 00000000..8772ae5c +--- /dev/null ++++ b/tests/f_quota_shrinkdir/name +@@ -0,0 +1 @@ ++update quota on directory optimization +-- +2.27.0 + diff --git a/0017-tests-new-test-to-check-quota-after-a-bad-inode-deal.patch b/0017-tests-new-test-to-check-quota-after-a-bad-inode-deal.patch new file mode 100644 index 0000000000000000000000000000000000000000..0b1d2802dca4e9d94c6bb60433a18806331dce55 --- /dev/null +++ b/0017-tests-new-test-to-check-quota-after-a-bad-inode-deal.patch @@ -0,0 +1,73 @@ +From c6070404a2bed3ff675fc6500828ab6acee985f1 Mon Sep 17 00:00:00 2001 +From: "Luis Henriques (SUSE)" +Date: Fri, 5 Apr 2024 15:24:05 +0100 +Subject: [PATCH 2/2] tests: new test to check quota after a bad inode + deallocation + +This new test validates e2fsck by verifying that quota is updated after a bad +inode is deallocated. It mimics fstest ext4/019 by including a filesystem image +where a symbolic link was created to an existing file, using a long symlink +name. This symbolic link was then wiped with: + + # debugfs -w -R 'zap -f /testlink 0' f_testnew/image + +Signed-off-by: Luis Henriques (SUSE) +Reviewed-by: Andreas Dilger +Link: https://lore.kernel.org/r/20240405142405.12312-5-luis.henriques@linux.dev +Signed-off-by: Theodore Ts'o +--- + tests/f_quota_deallocate_inode/expect.1 | 18 ++++++++++++++++++ + tests/f_quota_deallocate_inode/expect.2 | 7 +++++++ + tests/f_quota_deallocate_inode/name | 1 + + 3 files changed, 26 insertions(+) + create mode 100644 tests/f_quota_deallocate_inode/expect.1 + create mode 100644 tests/f_quota_deallocate_inode/expect.2 + create mode 100644 tests/f_quota_deallocate_inode/name + +diff --git a/tests/f_quota_deallocate_inode/expect.1 b/tests/f_quota_deallocate_inode/expect.1 +new file mode 100644 +index 00000000..2b2f128d +--- /dev/null ++++ b/tests/f_quota_deallocate_inode/expect.1 +@@ -0,0 +1,18 @@ ++Pass 1: Checking inodes, blocks, and sizes ++Pass 2: Checking directory structure ++Symlink /testlink (inode #14) is invalid. ++Clear? yes ++ ++Pass 3: Checking directory connectivity ++Pass 4: Checking reference counts ++Pass 5: Checking group summary information ++[QUOTA WARNING] Usage inconsistent for ID 0:actual (15360, 4) != expected (16384, 5) ++Update quota info for quota type 0? yes ++ ++[QUOTA WARNING] Usage inconsistent for ID 0:actual (15360, 4) != expected (16384, 5) ++Update quota info for quota type 1? yes ++ ++ ++test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** ++test_filesys: 13/256 files (15.4% non-contiguous), 1157/8192 blocks ++Exit status is 1 +diff --git a/tests/f_quota_deallocate_inode/expect.2 b/tests/f_quota_deallocate_inode/expect.2 +new file mode 100644 +index 00000000..80231794 +--- /dev/null ++++ b/tests/f_quota_deallocate_inode/expect.2 +@@ -0,0 +1,7 @@ ++Pass 1: Checking inodes, blocks, and sizes ++Pass 2: Checking directory structure ++Pass 3: Checking directory connectivity ++Pass 4: Checking reference counts ++Pass 5: Checking group summary information ++test_filesys: 13/256 files (15.4% non-contiguous), 1157/8192 blocks ++Exit status is 0 +diff --git a/tests/f_quota_deallocate_inode/name b/tests/f_quota_deallocate_inode/name +new file mode 100644 +index 00000000..396887c1 +--- /dev/null ++++ b/tests/f_quota_deallocate_inode/name +@@ -0,0 +1 @@ ++update quota when deallocating bad inode +-- +2.27.0 + diff --git a/binary-for-test.tar b/binary-for-test.tar new file mode 100644 index 0000000000000000000000000000000000000000..cb3ca5a96f646250af9daa8c93f738cadaa2629e Binary files /dev/null and b/binary-for-test.tar differ diff --git a/e2fsprogs.spec b/e2fsprogs.spec index 3763542d64654c6ccff21db06b9db336747669a4..c779d4d94b9f8186d47da1ae9dd84f96a15aefd5 100644 --- a/e2fsprogs.spec +++ b/e2fsprogs.spec @@ -1,11 +1,12 @@ Name: e2fsprogs Version: 1.47.0 -Release: 6 +Release: 7 Summary: Second extended file system management tools License: GPLv2+ and LGPLv2 and MIT URL: http://e2fsprogs.sourceforge.net/ Source0: https://www.kernel.org/pub/linux/kernel/people/tytso/%{name}/v%{version}/%{name}-%{version}.tar.xz Source1: ext2_types-wrapper.h +Source2: binary-for-test.tar Patch1: 0001-e2fsprogs-set-hugefile-from-4T-to-1T-in-hugefile-tes.patch Patch2: 0002-e2fsck-exit-journal-recovery-when-find-EIO-ENOMEM-er.patch @@ -22,6 +23,8 @@ Patch12: 0012-debugfs-fix-infinite-loop-while-dumping-the-journal.patch Patch13: 0013-e4crypt-fix-spurious-Success-error-message.patch Patch14: 0014-e2fsck-update-quota-accounting-after-directory-optim.patch Patch15: 0015-e2fsck-update-quota-when-deallocating-a-bad-inode.patch +Patch16: 0016-tests-new-test-to-check-quota-after-directory-optimi.patch +Patch17: 0017-tests-new-test-to-check-quota-after-a-bad-inode-deal.patch BuildRequires: gcc pkgconfig texinfo BuildRequires: fuse-devel libblkid-devel libuuid-devel @@ -69,6 +72,7 @@ This packages includes man files for e2fsprogs. %prep %autosetup -n %{name}-%{version} -p1 +tar -xf %{SOURCE2} %build @@ -162,6 +166,11 @@ exit 0 %{_mandir}/man8/* %changelog +* Mon Jun 24 2024 wangziliang - 1.47.0-7 +- sync patch from community + tests: new test to check quota after directory optimization + tests: new test to check quota after a bad inode deallocation + * Fri Jun 21 2024 liuh - 1.47.0-6 - sync patch from community e2fsck: update quota when deallocating a bad inode