Skip to contentSkip to conversation

xfs/291: fix spurious ENOSPC errors

PATCH In review Dave Chinner 2 participants 3 messages Jan 22, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs/291: fix spurious ENOSPC errors

From: Dave Chinner <[email protected]>

xfs/291 tries to fill the filesystem almost full, so if the log size changes with mkfs defaults then it's free space calculations are not longer valid and so it throws lots of ENOSPC errors during a run. This is not fatal for this test, but it does increase the runtime of it and fill the 291.full file with unnecessary errors.

The number of frag files it creates is also too many for a 512 byte inode filesystem (by about 900) so reduce the number of inodes initially created so the test works ofr 512 byte inodes. With 512 byte inodes, the free space histogram looks like this after the frag phase:

from to extents blocks pct

      1       1   10730   10730 100.00

And for 256 byte inodes:

from to extents blocks pct

      1       1   12388   12388 100.00

So these changes do not affect the intended operation of the test.

---
 tests/xfs/291 | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
tests/xfs/291 +6 -3
index d5a9b08..0f3f051 100755
@@ -46,7 +46,7 @@ _supported_os IRIX Linux
 # real QA test starts here
 rm -f $seqres.full
 _require_scratch
-_scratch_mkfs_xfs -n size=16k -d size=128m >> $seqres.full 2>&1
+_scratch_mkfs_xfs -n size=16k -l size=5m -d size=128m >> $seqres.full 2>&1
 _scratch_mount
 
 # First we cause very badly fragmented freespace, then
@@ -54,13 +54,16 @@ _scratch_mount
 # should come out very fragmented as a result
 
 # Step 1: Cause badly fragmented free space
+# 
+# XXX: this needs to be factored to match what generic/204 does to support
+# different inode sizes without ENOSPC
 mkdir $SCRATCH_MNT/fragdir
-for I in `seq 0 27200`; do
+for I in `seq 0 26200`; do
         (echo data > $SCRATCH_MNT/fragdir/f$I) >> $seqres.full 2>&1
 done
 sync
 
-for I in `seq 0 2 27200`; do
+for I in `seq 0 2 26200`; do
         rm -f $SCRATCH_MNT/fragdir/f$I >> $seqres.full 2>&1
 done
 sync
Signature · 6 lines
1.8.4.rc3

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Dave Chinner

From: Dave Chinner <[email protected]>

xfs/291 tries to fill the filesystem almost full, so if the log size changes with mkfs defaults then it's free space calculations are not longer valid and so it throws lots of ENOSPC errors during a run. This is not fatal for this test, but it does increase the runtime of it and fill the 291.full file with unnecessary errors.

Hm so you've set the log size to 5m (-l size=5m) but how does that interact with any "-l size=XXX" set in MKFS_OPTS ?

(It's certainly no worse than what I had in my original test; I just wonder if we should ignore MKFS_OPTS altogether in this test, and completely manually specify all options?)

((but I guess that would restrict this test too much, wouldn't it))

Fine for now, I suppose:

-Eric

Quoted 44 lines

The number of frag files it creates is also too many for a 512 byte inode filesystem (by about 900) so reduce the number of inodes initially created so the test works ofr 512 byte inodes. With 512 byte inodes, the free space histogram looks like this after the frag phase:

from to extents blocks pct

      1       1   10730   10730 100.00

And for 256 byte inodes:

from to extents blocks pct

      1       1   12388   12388 100.00

So these changes do not affect the intended operation of the test.

---
 tests/xfs/291 | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
tests/xfs/291 +4 -2
index d5a9b08..0f3f051 100755
@@ -46,7 +46,7 @@ _supported_os IRIX Linux
 # real QA test starts here
 rm -f $seqres.full
 _require_scratch
-_scratch_mkfs_xfs -n size=16k -d size=128m >> $seqres.full 2>&1
+_scratch_mkfs_xfs -n size=16k -l size=5m -d size=128m >> $seqres.full 2>&1
 _scratch_mount
 
 # First we cause very badly fragmented freespace, then
@@ -54,13 +54,16 @@ _scratch_mount
 # should come out very fragmented as a result
 
 # Step 1: Cause badly fragmented free space
+# 
+# XXX: this needs to be factored to match what generic/204 does to support
+# different inode sizes without ENOSPC
 mkdir $SCRATCH_MNT/fragdir
-for I in `seq 0 27200`; do

tests/xfs/291 _scratch_mount · line 69

Quoted 10 lines
tests/xfs/291 +2 -1
+for I in `seq 0 26200`; do
         (echo data > $SCRATCH_MNT/fragdir/f$I) >> $seqres.full 2>&1
 done
 sync
 
-for I in `seq 0 2 27200`; do
+for I in `seq 0 2 26200`; do
         rm -f $SCRATCH_MNT/fragdir/f$I >> $seqres.full 2>&1
 done
 sync

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw
Quoted 11 lines · Eric Sandeen
Quoted 7 lines · Dave Chinner

From: Dave Chinner <[email protected]>

xfs/291 tries to fill the filesystem almost full, so if the log size changes with mkfs defaults then it's free space calculations are not longer valid and so it throws lots of ENOSPC errors during a run. This is not fatal for this test, but it does increase the runtime of it and fill the 291.full file with unnecessary errors.

Hm so you've set the log size to 5m (-l size=5m) but how does that interact with any "-l size=XXX" set in MKFS_OPTS ?

see _scratch_mkfs_xfs:

        # a mkfs failure may be caused by conflicts between
        # $MKFS_OPTIONS and $extra_mkfs_options
        if [ $mkfs_status -ne 0 -a ! -z "$extra_mkfs_options" ]; then
                (
                echo -n "** mkfs failed with extra mkfs options "
                echo "added to \"$MKFS_OPTIONS\" by test $seq **"
                echo -n "** attempting to mkfs using only test $seq "
                echo "options: $extra_mkfs_options **"
                ) >> $seqres.full
                # running mkfs again. overwrite previous mkfs output files
                _scratch_mkfs_xfs_opts $extra_mkfs_options \
                        2>$tmp_dir.mkfserr 1>$tmp_dir.mkfsstd
                local mkfs_status=$?
        fi

So, it will drop the MKFS_OPTIONS and just use the test specific options if there is a conflict/failure.

Quoted 3 lines

(It's certainly no worse than what I had in my original test; I just wonder if we should ignore MKFS_OPTS altogether in this test, and completely manually specify all options?)

That's effectively what it already does automatically.... :)

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs