xfs
[Top] [All Lists]

[PATCH] xfstests 016: Do not discard blocks at the mkfs time

To: xfs <xfs@xxxxxxxxxxx>, Eric Sandeen <esandeen@xxxxxxxxxx>
Subject: [PATCH] xfstests 016: Do not discard blocks at the mkfs time
From: Boris Ranto <branto@xxxxxxxxxx>
Date: Wed, 26 Oct 2011 12:46:23 +0200
The test 016 fills scratch device with some data and then creates xfs fs
on the scratch device. Later, the test assumes that the previously
written data are still in there and checks for them at specific
locations. On ssd drive this will lead to failure since the blocks are
discarded by default when the mkfs command is run.
This simple patch that adds -K to stop the discarding (if the mkfs
command supports it) fixed the issue for me:

Signed-off-by: Boris Ranto <branto@xxxxxxxxxx>

diff --git a/016 b/016
index 9275ade..db76398 100755
--- a/016
+++ b/016
@@ -65,6 +65,8 @@ _init()
     $here/src/devzero -b 2048 -n 50 -v 198 $SCRATCH_DEV
     echo "*** mkfs"
     force_opts="-dsize=50m -lsize=$log_size"
+    # Do not discard blocks, we need them for further reads
+    _scratch_mkfs_xfs -N -K $force_opts >/dev/null 2>&1 &&
force_opts="-K $force_opts"
     echo mkfs_xfs $force_opts $SCRATCH_DEV >>$seq.full
     _scratch_mkfs_xfs $force_opts >$tmp.mkfs0 2>&1
     [ $? -ne 0 ] && \

<Prev in Thread] Current Thread [Next in Thread>