From 278c73cf18480e7d73139c7e2194358374ab7cbe Mon Sep 17 00:00:00 2001 From: wangziliang Date: Mon, 24 Jun 2024 08:05:43 +0000 Subject: [PATCH] backport 2 patch from community --- ...o-check-quota-after-directory-optimi.patch | 73 ++++++++++++++++++ ...o-check-quota-after-a-bad-inode-deal.patch | 73 ++++++++++++++++++ binary-for-test.tar | Bin 0 -> 30720 bytes e2fsprogs.spec | 11 ++- 4 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 0016-tests-new-test-to-check-quota-after-directory-optimi.patch create mode 100644 0017-tests-new-test-to-check-quota-after-a-bad-inode-deal.patch create mode 100644 binary-for-test.tar 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 0000000..7108a8e --- /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 0000000..0b1d280 --- /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 GIT binary patch literal 30720 zcmeI3dsGv5qQ|W->Q$jzZ$U+*-EQmcS{_ORH5#bef)x>YLjnW@L^48D7?5Cyij`Uf zYHdNmfQUlgL2v*QLO^^}5fI5_l&3BVc1B*}00xq|LAQ5%clXpi=l0ywZD;;S=FD$q zGQZF7H^2GK$>*C86`v4qw}ZI{WG93(<9F_ji31{I_S(h7hDS%)MssHT0*k$Ias23` z8Png!}_77N7B?W6rm+QAKql@zJ(jUAtqxdt-LY>`&*d z|90D*4GPN4EXw#tD_M>d@9Yog1hh{LbzSDFo zt$wS%(?Zu);FWem$>(%pW2|Fi@|V|Xsh7JL_=b(y#DOgQw(*KZY1r4f^&<`ig)_2h z2n$P^?kd(JsJ}@x4yhX5qx3+|(1ckQ@6J);sUifZYFCX3Xl~jo?aDDB7f`qJBBg>^ z*cmTkw6~{qs=w#4?)YfoRYU9ZmfPQ}uex-UyC&`m>CjX{A+av2qusiz-X)Z*T?12Z zQi<1I!Qp3%4VQ}Y_S>^|w(iNkzTn6a^MM4da%d6ZZ;*{!*>z#C&~}^ zzW`>>P5Xd#Gfz|^i($3r#o6zb-VU?h*c9jh-=erT(JSC56t||J_=T=AhouYp9G?vn zsP0iNO>Y-HqnNqxV^*+T`4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Ts zpq)1U8OWPZq>Z0D(#1MOugnoY0=}SM@E3gtd`E};#UDT%sTZK7gX0P}X~?()L_@(L zg=bgQ3tLvf>{2h^W+pL#)3A5&+wEr@C7G;VP9Ux3r9As7t=v)W2AkuLIa_Fz%LB6I zD>OOy6^=LUQh~RpREoyn&p58Mib`2DT!F2@JKIYN0$Su2n)yISyR1ZeF)y?OF@+)q zeAgn!@`7H7wkkoQJcyz+hTZ`AkC`{M>2%~R&w({H>o?tjUsbudCttVL-@i?jn941X z7w)*7Fjw1%KISA(=U1+4F5n^#s459%$i)b<2i(u!#uhBX&T%4C!mTnV>@1GwiqK9$@;Ul zLZ()ZB6z;yVk#pSel(qmQ;WsuIG(PH&a&H z#WG*jWq$SLPKl2X*WWLr)`SMTX^w-ws&k=qJ8?1g2>*%`W#w~S`#s;WCAT5}37;ILKlX3;ou4?n02;|iREt%dO~ zW14(Mp} z!bb1tVnh6Mk+;Aoy-fBZcbScs>f-h1Wiqw42OR=E7G9g1c6_OH9>sqVaFAa1KD+_i zZR33cXr)Wc&_y{iCHzlcB5-=KRsx}eU^ZPj7=&q5Xg64>U`rVotOL~w9_`HX zKr@kvaRyujt&a_~gsDh&}@+n+KQj#?4rq*Gd%@1*irl(XD{u1 z0i6N2p+DfqI6GoPT13%EJbDT8pveoEb^;5nF+=PjjiIRi;jNM5_2a8&){>TAeGmJk zFYv(H+V=w1j-NeV67LxNxc!LvVs+fvtFw|~7JWGLBs()`wtY`|w%M`H_C4Eu8chc! zt~SQaQq`ee!d|_1%DRu4MKnw`Iy>K=aJj`>Mx;MS9s-t2LX!4>cyirhtB@*(j6~fx z^G>+#@XV*A=&~G2g1mp}Dv;; - 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 -- Gitee