Skip to contentSkip to conversation

generic/645: notrun if FS doesn't have enough free inodes/blocks

PATCH In review Ojaswin Mujoo 3 participants 3 messages Jul 30 – Jul 31

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 generic/645: notrun if FS doesn't have enough free inodes/blocks

When running generic/645 with ext4 using 64k block size + bigalloc, the test fails with ENOSPC because the filesystem runs out of inodes before the test completes.

The test creates approximately 10,001 files, however, in this particular configuration a standard 5G FS only has around ~5100 inodes resulting in the ENOSPC failure.

Parse vfstest output to notrun the test incase we encounter this ENOSPC instead of reporting it as a failure.

---

* Changes since v1 [1] *

- Instead of using a helper, check for ENOSPC in vfstest output (Thanks for Darrick for suggestion)

[1] https://lore.kernel.org/fstests/[email protected]/

 tests/generic/645 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
tests/generic/645 +7 -1
index d6eb75e6..6498efe1 100755
@@ -22,7 +22,13 @@ _wants_kernel_commit dacfd001eaf2 \
 echo "Silence is golden"
 
 $here/src/vfs/vfstest --test-nested-userns \
-	--device "$TEST_DEV" --mount "$TEST_DIR" --fstype "$FSTYP"
+	--device "$TEST_DEV" --mount "$TEST_DIR" --fstype "$FSTYP" \
+	> $tmp.vfstest 2>&1
 
+if grep -q "No space left on device" $tmp.vfstest; then
+	_notrun "$TEST_DEV ran out of free blocks/inodes"
+fi
+
+cat $tmp.vfstest
 status=$?
 exit
Signature · 1 line
2.55.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 8 lines · Ojaswin Mujoo

When running generic/645 with ext4 using 64k block size + bigalloc, the test fails with ENOSPC because the filesystem runs out of inodes before the test completes.

The test creates approximately 10,001 files, however, in this particular configuration a standard 5G FS only has around ~5100 inodes resulting in the ENOSPC failure.

Quoted 5 lines

Parse vfstest output to notrun the test incase we encounter this ENOSPC instead of reporting it as a failure.

Looks good to me,

--D

Quoted 34 lines

---

* Changes since v1 [1] *

- Instead of using a helper, check for ENOSPC in vfstest output (Thanks for Darrick for suggestion)

[1] https://lore.kernel.org/fstests/[email protected]/

 tests/generic/645 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
tests/generic/645 +7 -1
index d6eb75e6..6498efe1 100755
@@ -22,7 +22,13 @@ _wants_kernel_commit dacfd001eaf2 \
 echo "Silence is golden"
 
 $here/src/vfs/vfstest --test-nested-userns \
-	--device "$TEST_DEV" --mount "$TEST_DIR" --fstype "$FSTYP"
+	--device "$TEST_DEV" --mount "$TEST_DIR" --fstype "$FSTYP" \
+	> $tmp.vfstest 2>&1
 
+if grep -q "No space left on device" $tmp.vfstest; then
+	_notrun "$TEST_DEV ran out of free blocks/inodes"
+fi
+
+cat $tmp.vfstest
 status=$?
 exit
Signature · 1 line
2.55.0
Tested-by on v2 1/1
#2 lore raw
In reply to Ojaswin Mujoo
Quoted 8 lines · Ojaswin Mujoo

When running generic/645 with ext4 using 64k block size + bigalloc, the test fails with ENOSPC because the filesystem runs out of inodes before the test completes.

The test creates approximately 10,001 files, however, in this particular configuration a standard 5G FS only has around ~5100 inodes resulting in the ENOSPC failure.

Quoted 7 lines

Parse vfstest output to notrun the test incase we encounter this ENOSPC instead of reporting it as a failure.

---

Tested with ext4 + 64k block size + bigalloc on a 9G filesystem. generic/645 now correctly notruns instead of failing with ENOSPC.

Quoted 29 lines

* Changes since v1 [1] *

- Instead of using a helper, check for ENOSPC in vfstest output (Thanks for Darrick for suggestion)

[1] https://lore.kernel.org/fstests/[email protected]/

  tests/generic/645 | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
tests/generic/645 +7 -1
index d6eb75e6..6498efe1 100755
@@ -22,7 +22,13 @@ _wants_kernel_commit dacfd001eaf2 \
  echo "Silence is golden"
 
  $here/src/vfs/vfstest --test-nested-userns \
-	--device "$TEST_DEV" --mount "$TEST_DIR" --fstype "$FSTYP"
+	--device "$TEST_DEV" --mount "$TEST_DIR" --fstype "$FSTYP" \
+	> $tmp.vfstest 2>&1
 
+if grep -q "No space left on device" $tmp.vfstest; then
+	_notrun "$TEST_DEV ran out of free blocks/inodes"
+fi
+
+cat $tmp.vfstest
  status=$?
  exit
Signature · 2 lines
Regards,
Disha