]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
generic: increase file size to match CoW delayed allocation for XFS 64k bs
authorPankaj Raghav <p.raghav@samsung.com>
Thu, 24 Oct 2024 11:23:11 +0000 (13:23 +0200)
committerZorro Lang <zlang@kernel.org>
Fri, 25 Oct 2024 16:59:36 +0000 (00:59 +0800)
generic/305,326,328 have been failing for 32k and 64k blocksizes.

We do the following in the test 305 and 326 (highlighting only the part
that is related to failure):

- create a 1M test-1/file1
- reflink test-1/file2 and test-1/file3 based on test-1/file1
- Overwrite first half of test-1/file2 to do a CoW operation
- Expect the size of the test-1 dir to be 3M

The test is failing for 32k and 64k blocksizes as the number of blocks
(direct + delayed) is higher than number of blocks allocated for
blocksizes < 32k in XFS, resulting in size of test-1 to be more than 3M.
Though generic/328 has a different IO pattern, the reason for failure is
the same.

This is the failure output :
    --- tests/generic/305.out   2024-06-05 11:52:27.430262812 +0000
    +++ /root/results//64k_4ks/generic/305.out.bad      2024-10-23 10:56:57.643986870 +0000
    @@ -11,7 +11,7 @@
     CoW one of the files
     root 0 0 0
     nobody 0 0 0
    -fsgqa 3072 0 0
    +fsgqa 4608 0 0
     Remount the FS to see if accounting changes
     root 0 0 0

In these tests, XFS is doing a delayed allocation of
XFS_DEFAULT_COWEXTSIZE_HINT(32). Increase the size of the file so that
the CoW write(sz/2) matches the maximum size of the delayed allocation
for the max blocksize of 64k. This will ensure that all parts of the
delayed extents are converted to real extents for all blocksizes.

Even though this is not the most complete solution to fix these tests,
the objective of these tests are to test quota and not the effect of delayed
allocations.

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/305
tests/generic/305.out
tests/generic/326
tests/generic/326.out
tests/generic/328
tests/generic/328.out

index c89bd821f820a1e7035ca72425428b5b378eb5c0..6ccbb3d07c70c24823800f35fc05b8c3689c5794 100755 (executable)
@@ -32,7 +32,7 @@ quotaon $SCRATCH_MNT 2> /dev/null
 testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
-sz=1048576
+sz=4194304
 echo "Create the original files"
 $XFS_IO_PROG -f -c "pwrite -S 0x61 -b $sz 0 $sz" $testdir/file1 >> $seqres.full
 _cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
index fbd4e2419321c4c437175809b516a4ac3a6b1440..1c348d1e22fa5e0a9c6ca91eabaa5bc1bd490842 100644 (file)
@@ -1,22 +1,22 @@
 QA output created by 305
 Format and mount
 Create the original files
-root 3072 0 0
+root 12288 0 0
 nobody 0 0 0
 fsgqa 0 0 0
 Change file ownership
 root 0 0 0
 nobody 0 0 0
-fsgqa 3072 0 0
+fsgqa 12288 0 0
 CoW one of the files
 root 0 0 0
 nobody 0 0 0
-fsgqa 3072 0 0
+fsgqa 12288 0 0
 Remount the FS to see if accounting changes
 root 0 0 0
 nobody 0 0 0
-fsgqa 3072 0 0
+fsgqa 12288 0 0
 Chown one of the files
 root 0 0 0
-nobody 1024 0 0
-fsgqa 2048 0 0
+nobody 4096 0 0
+fsgqa 8192 0 0
index 1783fbf238e3bf0bca5f5c0e3e872030288b1306..321e7dc6a8e54c614bcfc1b6f652b2c48ca3bd46 100755 (executable)
@@ -33,7 +33,7 @@ quotaon $SCRATCH_MNT 2> /dev/null
 testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
-sz=1048576
+sz=4194304
 echo "Create the original files"
 $XFS_IO_PROG -f -c "pwrite -S 0x61 -b $sz 0 $sz" $testdir/file1 >> $seqres.full
 _cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
index de7f20b5ee705bf24865d1456076f8a76b7ff980..4ccb3250079657888663c866287901226404095f 100644 (file)
@@ -1,22 +1,22 @@
 QA output created by 326
 Format and mount
 Create the original files
-root 3072 0 0
+root 12288 0 0
 nobody 0 0 0
 fsgqa 0 0 0
 Change file ownership
 root 0 0 0
 nobody 0 0 0
-fsgqa 3072 0 0
+fsgqa 12288 0 0
 CoW one of the files
 root 0 0 0
 nobody 0 0 0
-fsgqa 3072 0 0
+fsgqa 12288 0 0
 Remount the FS to see if accounting changes
 root 0 0 0
 nobody 0 0 0
-fsgqa 3072 0 0
+fsgqa 12288 0 0
 Chown one of the files
 root 0 0 0
-nobody 1024 0 0
-fsgqa 2048 0 0
+nobody 4096 0 0
+fsgqa 8192 0 0
index 0c8e19866645a25e38f9a928456174e53aa5953e..25e1f2a021872f0aa6c7a5b93f6b933096762530 100755 (executable)
@@ -32,7 +32,7 @@ quotaon $SCRATCH_MNT 2> /dev/null
 testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
-sz=1048576
+sz=4194304
 echo "Create the original files"
 $XFS_IO_PROG -f -c "pwrite -S 0x61 -b $sz 0 $sz" $testdir/file1 >> $seqres.full
 chown $qa_user $testdir/file1
index b7fe9f8cfcf00f562e453e8fe659e590c36bfd03..0167637e61c043b096a9b7366c5729c71d49fd44 100644 (file)
@@ -2,24 +2,26 @@ QA output created by 328
 Format and mount
 Create the original files
 root 0 0 0
-fsgqa 3072 0 0
+fsgqa 12288 0 0
 Set hard quota to prevent rewrite
 root 0 0 0
-fsgqa 3072 0 1024
+fsgqa 12288 0 1024
 Try to dio write the whole file
 pwrite: Disk quota exceeded
 root 0 0 0
-fsgqa 3072 0 1024
+fsgqa 12288 0 1024
 Try to write the whole file
 pwrite: Disk quota exceeded
 root 0 0 0
-fsgqa 3072 0 1024
+fsgqa 12288 0 1024
 Set hard quota to allow rewrite
 root 0 0 0
-fsgqa 3072 0 8192
+fsgqa 12288 0 8192
 Try to dio write the whole file
+pwrite: Disk quota exceeded
 root 0 0 0
-fsgqa 3072 0 8192
+fsgqa 12288 0 8192
 Try to write the whole file
+pwrite: Disk quota exceeded
 root 0 0 0
-fsgqa 3072 0 8192
+fsgqa 12288 0 8192