All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] shared/005,7: add check whether debugfs succeeds to set a negative i_size or not
@ 2017-02-13 11:21 Xiao Yang
  2017-02-20  2:13 ` Xiao Yang
  0 siblings, 1 reply; 13+ messages in thread
From: Xiao Yang @ 2017-02-13 11:21 UTC (permalink / raw)
  To: fstests; +Cc: Xiao Yang

shared/005 and shared/007 work abnornamlly on RHEL6.8GA and
RHEL6.9Beta because debugfs fails to set i_size to -1 or -512
and reports "exceeds field size maximum".  When debugfs fails
to set a negative i_size, we can skip these cases which don't
trigger the kernel bug.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 tests/shared/005 | 7 +++++++
 tests/shared/007 | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/tests/shared/005 b/tests/shared/005
index 296de17..37912d6 100755
--- a/tests/shared/005
+++ b/tests/shared/005
@@ -67,6 +67,13 @@ $DEBUGFS_PROG -w -R "sif /a size -1" $SCRATCH_DEV >> $seqres.full 2>&1
 
 echo "Remount, try to append"
 _scratch_mount
+
+#check whether debugfs succeeds to set i_size to -1 or not
+i_size=$(stat -c "%s" $testdir/a)
+if [ $i_size -ne -1 ]; then
+	_notrun "Could not set i_size to -1 successfully, skip test."
+fi
+
 dd if=/dev/zero of=$testdir/a bs=512 count=1 oflag=append conv=notrunc >> $seqres.full 2>&1 || echo "Write did not succeed (ok)."
 sync
 
diff --git a/tests/shared/007 b/tests/shared/007
index 0729ab8..06055a0 100755
--- a/tests/shared/007
+++ b/tests/shared/007
@@ -69,6 +69,13 @@ $DEBUGFS_PROG -w -R "sif /a size 0xFFFFFFFFFFFFFE00" $SCRATCH_DEV >> $seqres.ful
 
 echo "Remount, try to append"
 _scratch_mount
+
+#check whether debugfs succeeds to set i_size to -512 or not
+i_size=$(stat -c "%s" $testdir/a)
+if [ $i_size -ne -512 ]; then
+	_notrun "Could not set i_size to -512 successfully, skip test."
+fi
+
 dd if=/dev/zero of=$testdir/a bs=512 count=1 oflag=direct,append conv=notrunc >> $seqres.full 2>&1 || echo "Write did not succeed (ok)."
 sync
 
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-02-23  3:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-13 11:21 [PATCH] shared/005,7: add check whether debugfs succeeds to set a negative i_size or not Xiao Yang
2017-02-20  2:13 ` Xiao Yang
2017-02-20  2:36   ` Eryu Guan
2017-02-20  5:02     ` [PATCH] shared/005,7: fix making sure debugfs sets negative i_size && add strict check for dd Xiao Yang
2017-02-22  4:20       ` Eryu Guan
2017-02-22  4:56         ` Xiao Yang
2017-02-22  6:53           ` Eryu Guan
2017-02-22  8:17             ` [PATCH v2] shared/005,7: fix making sure debugfs sets negative i_size Xiao Yang
2017-02-20  9:37     ` [PATCH] xfs/133,4: make sure xfs_db sets negative i_size && add strict check for dd Xiao Yang
2017-02-22  9:31       ` [PATCH v2] xfs/133,4: make sure xfs_db sets negative i_size Xiao Yang
2017-02-22 10:49         ` Eryu Guan
2017-02-23  3:23           ` Xiao Yang
2017-02-23  3:35           ` [PATCH v3] " Xiao Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.