Re: [PATCH 3/4] tests: new test to check quota after directory optimization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mar 28, 2024, at 11:29 AM, Luis Henriques (SUSE) <luis.henriques@xxxxxxxxx> wrote:
> 
> This new test validates e2fsck by verifying that quota data is updated
> after a directory optimization is performed.  It mimics fstest ext4/014
> by including a filesystem image where a file is created inside a new
> directory on the filesystem root and then root block 0 is wiped:
> 
>  # debugfs -w -R 'zap -f / 0' f_testnew/image

I appreciate the test case, and I hate to be difficult, but IMHO this
test case is not ideal.  It is *still* reporting quota inconsistency
at the end, so it is difficult to see whether the patch is actually
improving anything or not?

This is because the image is testing a number of different things at
once (repairing the root inode, superblock, etc).  IMHO, it would be
better to have this test be specific to the directory shrink issue
(e.g. a large directory is created, many files are deleted from it,
then optimized), and ideally have a non-root user, group, and project
involved so that it is verifying that all of the quotas are updated.

Cheers, Andreas

> 
> Signed-off-by: Luis Henriques (SUSE) <luis.henriques@xxxxxxxxx>
> ---
> tests/f_quota_shrinkdir/expect.1 |  40 +++++++++++++++++++++++++++++++
> tests/f_quota_shrinkdir/expect.2 |   7 ++++++
> tests/f_quota_shrinkdir/image.gz | Bin 0 -> 11453 bytes
> tests/f_quota_shrinkdir/name     |   1 +
> 4 files changed, 48 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/image.gz
> 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 000000000000..812fe44b887d
> --- /dev/null
> +++ b/tests/f_quota_shrinkdir/expect.1
> @@ -0,0 +1,40 @@
> +Pass 1: Checking inodes, blocks, and sizes
> +Pass 2: Checking directory structure
> +Directory inode 2, block #0, offset 0: directory corrupted
> +Salvage? yes
> +
> +Missing '.' in directory inode 2.
> +Fix? yes
> +
> +Missing '..' in directory inode 2.
> +Fix? yes
> +
> +Pass 3: Checking directory connectivity
> +'..' in / (2) is <The NULL inode> (0), should be / (2).
> +Fix? yes
> +
> +Unconnected directory inode 11 (was in /)
> +Connect to /lost+found? yes
> +
> +/lost+found not found.  Create? yes
> +
> +Unconnected directory inode 12 (was in /)
> +Connect to /lost+found? yes
> +
> +Pass 3A: Optimizing directories
> +Pass 4: Checking reference counts
> +Inode 11 ref count is 3, should be 2.  Fix? yes
> +
> +Inode 12 ref count is 3, should be 2.  Fix? yes
> +
> +Pass 5: Checking group summary information
> +[QUOTA WARNING] Usage inconsistent for ID 0:actual (4096, 5) != expected (14336, 4)
> +Update quota info for quota type 0? yes
> +
> +[QUOTA WARNING] Usage inconsistent for ID 0:actual (4096, 5) != expected (14336, 4)
> +Update quota info for quota type 1? yes
> +
> +
> +test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
> +test_filesys: 14/256 files (14.3% non-contiguous), 1146/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 000000000000..814f84a54fd6
> --- /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: 14/256 files (14.3% non-contiguous), 1146/8192 blocks
> +Exit status is 0
> diff --git a/tests/f_quota_shrinkdir/image.gz b/tests/f_quota_shrinkdir/image.gz
> new file mode 100644
> index 0000000000000000000000000000000000000000..753774f6a11f8a60fdbdf2ce205e64a36d753893
> GIT binary patch
> literal 11453
> zcmeI#YgAL|xd335ai~RPTIz*^A*;1VkEMb$7%yPVayrU5$Q=SCgrEpWB1A45hF}tu
> z3Y~H*WdsERqH+nj!C*iFAtIxUM=oR8*&De9N+r(Tgb2(g5J+~%uCD$#tH+*yUCWdG
> z>s#OZ=l!1V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0dqMi5ixgSuiGrKFq6lyktB*no-3>+BBJ
> zN?nmG%xpSoZsv!CLB;4kAk=)HPo>D2pay%UtmlWSWm-@HFwAZIFtwZl5>bClXYw&C
> zEYwu?!E*<9z4H}aUnGoPxA|As{!Yh}=2y1l^!%UZC^qsXH&G??lfrNUz*W^whI5)c
> zkbZ8es&10T5x2u$h{UsVGQ!Z50cRmqT#iaU$s{&9KzT?nR${uylMG6W;eALc5XEa6
> zl-nW0z&T$133`oq2;Pb01A&alRKy23!|QO9%E2)7trHX@f+DK{L$P5~gt?0!7zVqe
> z6{b+Lk{=9105)b~n7b_j0trP^gSum|i9R6h8Hqj^beB~7gjGVjzeD_m;`0N6rL2?#
> z5gDR7)_1h}GU-d!Dy^0(xxso#tD{OaER1#+k|<c8Nf{`pR76cEAh|t~1Q?axiQz^`
> zmgck~IWfp6TLbF>t&%yRb_uA|%qmVLM$k1j=t%{T7#xiDV1M9VBunZwz3egWC*-f%
> z#CkLkd&NDg4=9%QX^OBF?#JYo>JTqYDY_p6M?0#i{_=Rx1C3DlkUQ&P8R>4ic!C|L
> z56pt16dC&9HHfbe5CU3R>4b3GLZ_j3x;p>a;j+inv5==>v81f;Qp-wL?hb;Q^OH*3
> zd2sK@d(GeeN9&g8+Snq8f^~szOXZ97%ibiG<HL{HIiXc}-t`+xc=PKN3vox(>`L~V
> zb@H2asgCrK^7%^m!OS0iKLf+c<`zR8_ZIa}0??e3hjCO>w&|bcVcoL|SOu&CRspMk
> zRlq7>6|f3e1*`&A0jq#jz$#!BunJfOtO8a6tAJI&D)4U?m=cWU*!=WO8YgjP`<{S}
> Z|MrZm3H(16$j;kv=2v{eh7H*p{tBVyta$(c
> 
> literal 0
> HcmV?d00001
> 
> diff --git a/tests/f_quota_shrinkdir/name b/tests/f_quota_shrinkdir/name
> new file mode 100644
> index 000000000000..8772ae5c814b
> --- /dev/null
> +++ b/tests/f_quota_shrinkdir/name
> @@ -0,0 +1 @@
> +update quota on directory optimization


Cheers, Andreas





Attachment: signature.asc
Description: Message signed with OpenPGP


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux