From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: guaneryu@gmail.com, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH 04/12] generic/032: fix unwritten extent checks
Date: Tue, 19 Mar 2019 17:45:01 -0700 [thread overview]
Message-ID: <155304270155.31707.5574383689968895450.stgit@magnolia> (raw)
In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia>
From: Darrick J. Wong <darrick.wong@oracle.com>
Fix the unwritten extent detector in this test to ignore post-eof
allocations because those are harmless.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
tests/generic/032 | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/tests/generic/032 b/tests/generic/032
index affde4b7..38352a21 100755
--- a/tests/generic/032
+++ b/tests/generic/032
@@ -69,18 +69,21 @@ do
# preallocate the first 64k and overwite, writing past 64k to contend
# with writeback
+ file_len=0x100000
$XFS_IO_PROG \
-c "falloc 0 0x10000" \
- -c "pwrite 0 0x100000" \
+ -c "pwrite 0 $file_len" \
-c "fsync" \
$SCRATCH_MNT/file >> $seqres.full 2>&1
- # Check for unwritten extents. We should have none since we wrote over
- # the entire preallocated region and ran fsync.
- $XFS_IO_PROG -c "fiemap -v" $SCRATCH_MNT/file | \
- tee -a $seqres.full | \
- _filter_fiemap | grep unwritten
- [ $? == 0 ] && _fail "Unwritten extents found!"
+ # Check for unwritten extents. We should have none before EOF since we
+ # wrote over the entire preallocated region and ran fsync.
+ eof_sector=$(( file_len / 512 ))
+ $XFS_IO_PROG -c 'fiemap -v' $SCRATCH_MNT/file | \
+ _filter_fiemap | \
+ tr '[.]:' ' ' | \
+ awk "{if (\$2 < $eof_sector) {print \$0}}" | \
+ grep -q unwritten && _fail "Unwritten extents found!"
done
echo $iters iterations
next prev parent reply other threads:[~2019-03-20 0:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-20 0:44 [PATCH 00/12] fstests: various fixes Darrick J. Wong
2019-03-20 0:44 ` [PATCH 01/12] check: improve test list randomization Darrick J. Wong
2019-03-20 0:44 ` [PATCH 02/12] check: really " Darrick J. Wong
2019-03-20 0:44 ` [PATCH 03/12] generic/042: fix stale disk contents check Darrick J. Wong
2019-03-20 0:45 ` Darrick J. Wong [this message]
2019-03-20 0:45 ` [PATCH 05/12] generic/454: stop the test if we run out of space Darrick J. Wong
2019-03-20 0:45 ` [PATCH 06/12] ext4/023: don't require scrub for ext4 populated image creation Darrick J. Wong
2019-03-20 0:45 ` [PATCH 07/12] common/populate: refactor _scratch_populate_cached Darrick J. Wong
2019-03-20 0:45 ` [PATCH 08/12] common/populate: support multiple cached images Darrick J. Wong
2019-03-20 0:45 ` [PATCH 09/12] clonerange: test remapping the rainbow Darrick J. Wong
2019-03-20 0:45 ` [PATCH 10/12] xfs: test xfs_copy and xfs_mdrestore on the populate images Darrick J. Wong
2019-03-24 2:36 ` Eryu Guan
2019-03-24 6:32 ` Darrick J. Wong
2019-03-24 6:48 ` [PATCH v2 " Darrick J. Wong
2019-03-20 0:45 ` [PATCH 11/12] check: wipe scratch devices between tests Darrick J. Wong
2019-03-20 7:06 ` Amir Goldstein
2019-03-21 4:15 ` Darrick J. Wong
2019-03-23 13:29 ` Eryu Guan
2019-03-25 23:48 ` Darrick J. Wong
2019-03-26 16:24 ` Amir Goldstein
2019-03-20 0:46 ` [PATCH 12/12] misc: fix broken _require_scratch usage Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=155304270155.31707.5574383689968895450.stgit@magnolia \
--to=darrick.wong@oracle.com \
--cc=fstests@vger.kernel.org \
--cc=guaneryu@gmail.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox