Linux XFS filesystem development
 help / color / mirror / Atom feed
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 1/7] generic/{279, 28[1-3]}: hide SIGBUS reporting from golden output
Date: Tue, 03 Jul 2018 21:50:53 -0700	[thread overview]
Message-ID: <153067985383.28393.15559670747546571392.stgit@magnolia> (raw)
In-Reply-To: <153067984748.28393.1595618163831671652.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

These four tests check that mmap'd cow writes fail when the filesystem
goes down.  For regular filesystems the msync reports EIO, but if quotas
are enabled on xfs the write itself terminates xfs_io with a SIGBUS.  We
don't care how the write fails, so don't let the SIGBUS report escape to
the golden output.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/generic/279 |    6 ++++++
 tests/generic/281 |    6 ++++++
 tests/generic/282 |    9 ++++++++-
 tests/generic/283 |   14 ++++++++++----
 4 files changed, 30 insertions(+), 5 deletions(-)


diff --git a/tests/generic/279 b/tests/generic/279
index 1355c641..af699144 100755
--- a/tests/generic/279
+++ b/tests/generic/279
@@ -66,8 +66,14 @@ md5sum $testdir/file2 | _filter_scratch
 echo "CoW and unmount"
 sync
 _dmerror_load_error_table
+# Insulate ourselves against bash reporting the SIGBUS when we try to modify
+# the metadata.
+cat > $tmp.run << ENDL
+ulimit -c 0
 $XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" \
 	-c "msync -s 0 $filesize" $testdir/file2 >> $seqres.full 2>&1
+ENDL
+bash $tmp.run 2> /dev/null
 _dmerror_load_working_table
 _dmerror_unmount
 _dmerror_mount
diff --git a/tests/generic/281 b/tests/generic/281
index 75c4b39a..75deab7c 100755
--- a/tests/generic/281
+++ b/tests/generic/281
@@ -66,8 +66,14 @@ md5sum $testdir/file2 | _filter_scratch
 echo "CoW and unmount"
 sync
 _dmerror_load_error_table
+# Insulate ourselves against bash reporting the SIGBUS when we try to modify
+# the metadata.
+cat > $tmp.run << ENDL
+ulimit -c 0
 $XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" \
 	-c "msync -s 0 $filesize" $testdir/file2 >> $seqres.full 2>&1
+ENDL
+bash $tmp.run 2> /dev/null
 
 echo "Clean up the mess"
 _dmerror_unmount
diff --git a/tests/generic/282 b/tests/generic/282
index aea7ce58..44ffe278 100755
--- a/tests/generic/282
+++ b/tests/generic/282
@@ -66,7 +66,14 @@ md5sum $testdir/file2 | _filter_scratch
 echo "CoW and unmount"
 sync
 _dmerror_load_error_table
-$XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" $testdir/file2 >> $seqres.full 2>&1
+# Insulate ourselves against bash reporting the SIGBUS when we try to modify
+# the metadata.
+cat > $tmp.run << ENDL
+ulimit -c 0
+$XFS_IO_PROG -f -c "mmap -rw 0 $filesize" \
+	-c "mwrite -S 0x63 0 $filesize" $testdir/file2 >> $seqres.full 2>&1
+ENDL
+bash $tmp.run 2> /dev/null
 _dmerror_load_working_table
 rm -rf $testdir/file2 >> $seqres.full 2>&1
 _dmerror_unmount
diff --git a/tests/generic/283 b/tests/generic/283
index 79caddb5..84a1666a 100755
--- a/tests/generic/283
+++ b/tests/generic/283
@@ -67,10 +67,16 @@ md5sum $testdir/file2 | _filter_scratch
 echo "CoW and unmount"
 sync
 _dmerror_load_error_table
-urk=$($XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" \
-	-c "msync -s 0 $filesize" $testdir/file2 2>&1)
-echo $urk >> $seqres.full
-echo "$urk" | grep -q "error" || _fail "mwrite did not fail"
+# Insulate ourselves against bash reporting the SIGBUS when we try to modify
+# the metadata.
+cat > $tmp.run << ENDL
+ulimit -c 0
+$XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" \
+	-c "msync -s 0 $filesize" $testdir/file2 2>&1
+ENDL
+bash $tmp.run > $tmp.output 2>&1
+cat $tmp.output >> $seqres.full
+grep -q error $tmp.output || _fail "mwrite did not fail"
 _dmerror_load_working_table
 
 echo "Rewrite"


  reply	other threads:[~2018-07-04  4:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04  4:50 [PATCH 0/7] fstests: fix quota failures on xfs Darrick J. Wong
2018-07-04  4:50 ` Darrick J. Wong [this message]
2018-07-04  4:51 ` [PATCH 2/7] misc: force the exact quota options coded into the test Darrick J. Wong
2018-07-14 10:14   ` Eryu Guan
2018-07-04  4:51 ` [PATCH 3/7] xfs/001: update to handle v5 filesystems Darrick J. Wong
2018-07-04  4:51 ` [PATCH 4/7] xfs: filter out mount options that don't work on v4 filesystems Darrick J. Wong
2018-07-14 11:41   ` Eryu Guan
2018-11-01 22:51     ` Darrick J. Wong
2018-07-04  4:51 ` [PATCH 5/7] xfs/288: update for v5 filesystem support in xfs_db Darrick J. Wong
2018-07-04  4:51 ` [PATCH 6/7] generic/338: don't check fs after crashing it Darrick J. Wong
2018-07-04  4:51 ` [PATCH 7/7] misc: filter out quota regeneration messages Darrick J. Wong
2018-07-14 11:49 ` [PATCH 0/7] fstests: fix quota failures on xfs Eryu Guan
2018-07-16 14:28   ` 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=153067985383.28393.15559670747546571392.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