lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <176169820536.1433624.5204379993641116218.stgit@frogsfrogsfrogs>
Date: Tue, 28 Oct 2025 18:28:14 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: djwong@...nel.org, zlang@...hat.com
Cc: neal@...pa.dev, fstests@...r.kernel.org, linux-ext4@...r.kernel.org,
 linux-fsdevel@...r.kernel.org, joannelkoong@...il.com, bernd@...ernd.com
Subject: [PATCH 30/33] ext4/009: fix ENOSPC errors

From: Darrick J. Wong <djwong@...nel.org>

This test periodically fails with:

    --- tests/ext4/009.out      2025-04-30 16:20:44.428030637 -0700
    +++ /var/tmp/fstests/ext4/009.out.bad       2025-09-12 15:30:44.929374431 -0700
    @@ -9,4 +9,5 @@
     + repair fs
     + mount image (2)
     + modify files (2)
    +fallocate: No space left on device
     + check fs (2)
    ...

This can happen if the amount of space requested by fallocate exceeds
the number of reserved blocks in the filesystem.  Reduce the fallocation
requests a little bit to prevent this.

Signed-off-by: "Darrick J. Wong" <djwong@...nel.org>
---
 tests/ext4/009 |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)


diff --git a/tests/ext4/009 b/tests/ext4/009
index 71e59f90e4b844..867e0cdefd4223 100755
--- a/tests/ext4/009
+++ b/tests/ext4/009
@@ -45,7 +45,8 @@ for i in `seq 1 $((nr_groups * 8))`; do
 done
 blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")"
 freeblks="$(stat -f -c '%a' "${SCRATCH_MNT}")"
-$XFS_IO_PROG -f -c "falloc 0 $((blksz * freeblks))" "${SCRATCH_MNT}/bigfile2" >> $seqres.full
+fallocblks=$((freeblks * 95 / 100))
+$XFS_IO_PROG -f -c "falloc 0 $((blksz * fallocblks))" "${SCRATCH_MNT}/bigfile2" >> $seqres.full
 umount "${SCRATCH_MNT}"
 
 echo "+ make some files"
@@ -67,7 +68,9 @@ _scratch_mount
 
 echo "+ modify files"
 b_bytes="$(stat -c '%B' "${SCRATCH_MNT}/bigfile")"
-$XFS_IO_PROG -f -c "falloc 0 $((blksz * freeblks))" "${SCRATCH_MNT}/bigfile" >> $seqres.full 2> /dev/null
+freeblks="$(stat -f -c '%a' "${SCRATCH_MNT}")"
+fallocblks=$((freeblks * 95 / 100))
+$XFS_IO_PROG -f -c "falloc 0 $((blksz * fallocblks))" "${SCRATCH_MNT}/bigfile" >> $seqres.full 2> /dev/null
 after="$(stat -c '%b' "${SCRATCH_MNT}/bigfile")"
 echo "$((after * b_bytes))" lt "$((blksz * freeblks / 4))" >> $seqres.full
 test "$((after * b_bytes))" -lt "$((blksz * freeblks / 4))" || _fail "falloc should fail"
@@ -80,7 +83,9 @@ echo "+ mount image (2)"
 _scratch_mount
 
 echo "+ modify files (2)"
-$XFS_IO_PROG -f -c "falloc 0 $((blksz * freeblks))" "${SCRATCH_MNT}/bigfile" >> $seqres.full
+freeblks="$(stat -f -c '%a' "${SCRATCH_MNT}")"
+fallocblks=$((freeblks * 95 / 100))
+$XFS_IO_PROG -f -c "falloc 0 $((blksz * fallocblks))" "${SCRATCH_MNT}/bigfile" >> $seqres.full
 umount "${SCRATCH_MNT}"
 
 echo "+ check fs (2)"


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ