public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] fstests: xfs EIO error handling test
  2016-08-19 17:51 [PATCH 1/2] common/rc: add functions to check or write objects under /sys/fs/$FSTYP Zorro Lang
@ 2016-08-19 17:51 ` Zorro Lang
  0 siblings, 0 replies; 4+ messages in thread
From: Zorro Lang @ 2016-08-19 17:51 UTC (permalink / raw)
  To: fstests; +Cc: Zorro Lang, xfs

Besides fail_at_unmount, all EIO error handling can stop umount
hanging on IO error too.

This case test EIO/max_retries and EIO/retry_timeout_seconds as
below:

1) fail_at_unmount=0 && \
   EIO/max_retries=1 && \
   EIO/retry_timeout_seconds=0

2) fail_at_unmount=0 && \
   EIO/max_retries=-1 && \
   EIO/retry_timeout_seconds=1

Make sure when fail_at_unmount=0, umount won't hang there.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 tests/xfs/263     | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/263.out |  21 +++++++++
 tests/xfs/group   |   1 +
 3 files changed, 148 insertions(+)
 create mode 100755 tests/xfs/263
 create mode 100644 tests/xfs/263.out

diff --git a/tests/xfs/263 b/tests/xfs/263
new file mode 100755
index 0000000..2df139c
--- /dev/null
+++ b/tests/xfs/263
@@ -0,0 +1,126 @@
+#! /bin/bash
+# FS QA Test 263
+#
+# Test XFS EIO error handling configuration. Stop XFS from retrying
+# to writeback forever when hit EIO.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 Red Hat, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+	_dmerror_cleanup
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/dmerror
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs xfs
+_supported_os Linux
+_require_dm_target error
+_require_scratch
+_require_fs_sysfs error/fail_at_unmount
+_require_fs_sysfs error/metadata/EIO/max_retries
+_require_fs_sysfs error/metadata/EIO/retry_timeout_seconds
+
+_scratch_mkfs >> $seqres.full 2>&1
+_dmerror_init
+
+do_test()
+{
+	local attr="$1"
+	local num=0
+
+	_dmerror_mount
+	reset_xfs_sysfs_error_handling $DMERROR_DEV
+	# Disable fail_at_unmount before test EIO error handling
+	_set_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount 0
+	echo -n "error/fail_at_unmount="
+	_get_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount
+
+	_set_fs_sysfs_attr $DMERROR_DEV $attr 1
+	num=`_get_fs_sysfs_attr $DMERROR_DEV $attr`
+	echo "$attr=$num"
+	# _fail the test if we fail to set $attr to 1, because the test
+	# probably will hang in such case and block subsequent tests.
+	if [ "$num" != "1" ]; then
+		_fail "Failed to set $attr: 1"
+	fi
+
+	# start a metadata-intensive workload, but no data allocation operation.
+	# Because uncompleted new space allocation I/Os may cause XFS to shutdown
+	# after loading error table.
+	$FSSTRESS_PROG -z -n 5000 -p 10 \
+		       -f creat=10 \
+		       -f resvsp=1 \
+		       -f truncate=1 \
+		       -f punch=1 \
+		       -f chown=5 \
+		       -f mkdir=5 \
+		       -f rmdir=1 \
+		       -f mknod=1 \
+		       -f unlink=1 \
+		       -f symlink=1 \
+		       -f rename=1 \
+		       -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1
+
+	# Loading error table without "--nolockfs" option. Because "--nolockfs"
+	# won't freeze fs, then some running I/Os may cause XFS to shutdown
+	# prematurely. That's not what we want to test.
+	_dmerror_load_error_table lockfs
+	_dmerror_unmount
+
+	# Mount again to replay log after loading working table, so we have a
+	# consistent XFS after test.
+	_dmerror_load_working_table
+	_dmerror_mount
+	_dmerror_unmount
+}
+
+#### Test EIO/max_retries ####
+# Set EIO/max_retries a limited number(>-1), then even if fail_at_unmount=0,
+# the test won't hang.
+echo "=== Test EIO/max_retries ==="
+do_test error/metadata/EIO/max_retries
+
+#### Test EIO/retry_timeout_seconds ####
+# Set EIO/retry_timeout_seconds to a limited number(>0), then even if
+# fail_at_unmount=0, the test won't hang.
+echo "=== Test EIO/retry_timeout_seconds ==="
+do_test error/metadata/EIO/retry_timeout_seconds
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/263.out b/tests/xfs/263.out
new file mode 100644
index 0000000..714350f
--- /dev/null
+++ b/tests/xfs/263.out
@@ -0,0 +1,21 @@
+QA output created by 263
+=== Test EIO/max_retries ===
+error/fail_at_unmount=1
+error/metadata/default/max_retries=-1
+error/metadata/default/retry_timeout_seconds=0
+error/metadata/EIO/max_retries=-1
+error/metadata/EIO/retry_timeout_seconds=0
+error/metadata/ENOSPC/max_retries=-1
+error/metadata/ENOSPC/retry_timeout_seconds=0
+error/fail_at_unmount=0
+error/metadata/EIO/max_retries=1
+=== Test EIO/retry_timeout_seconds ===
+error/fail_at_unmount=1
+error/metadata/default/max_retries=-1
+error/metadata/default/retry_timeout_seconds=0
+error/metadata/EIO/max_retries=-1
+error/metadata/EIO/retry_timeout_seconds=0
+error/metadata/ENOSPC/max_retries=-1
+error/metadata/ENOSPC/retry_timeout_seconds=0
+error/fail_at_unmount=0
+error/metadata/EIO/retry_timeout_seconds=1
diff --git a/tests/xfs/group b/tests/xfs/group
index 6905a62..ec3c022 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -260,6 +260,7 @@
 260 auto quick quota
 261 auto quick quota
 262 auto quick quota
+263 auto quick mount
 265 auto clone
 266 dump ioctl auto quick
 267 dump ioctl tape
-- 
2.7.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* [PATCH 1/2] xfs/006: move code about resetting error handling to common/rc
@ 2016-08-19 17:56 Zorro Lang
  2016-08-19 17:56 ` [PATCH 2/2] fstests: xfs EIO error handling test Zorro Lang
  2016-08-22  6:12 ` [PATCH 1/2] xfs/006: move code about resetting error handling to common/rc Eryu Guan
  0 siblings, 2 replies; 4+ messages in thread
From: Zorro Lang @ 2016-08-19 17:56 UTC (permalink / raw)
  To: fstests; +Cc: Zorro Lang, xfs

Nearly 1/3 code is used to reset the xfs error handling attributes,
This part can be picked up, and used for other cases. So move them
to a new function reset_xfs_sysfs_error_handling() in common/rc.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 common/rc         | 37 +++++++++++++++++++++++++++++++++++++
 tests/xfs/006     | 27 +++++++--------------------
 tests/xfs/006.out |  1 +
 3 files changed, 45 insertions(+), 20 deletions(-)

diff --git a/common/rc b/common/rc
index 3fb0600..b038d8e 100644
--- a/common/rc
+++ b/common/rc
@@ -3888,6 +3888,43 @@ _get_fs_sysfs_attr()
 	cat /sys/fs/${FSTYP}/${dname}/${attr}
 }
 
+
+# Reset all xfs error handling attributes, set them to original
+# status.
+#
+# Only one argument, and it's necessary:
+#  - dev: device name, e.g. $SCRATCH_DEV
+#
+# Note: this function only works for XFS
+reset_xfs_sysfs_error_handling()
+{
+	local dev=$1
+
+	if [ ! -b "$dev" -o "$FSTYP" != "xfs" ];then
+		_fail "Usage: reset_xfs_sysfs_error_handling <device>"
+	fi
+
+	_set_fs_sysfs_attr $dev error/fail_at_unmount 1
+	echo -n "error/fail_at_unmount="
+	_get_fs_sysfs_attr $dev error/fail_at_unmount
+
+	# Make sure all will be configured to retry forever by default, except
+	# for ENODEV, which is an unrecoverable error, so it will be configured
+	# to not retry on error by default.
+	for e in default EIO ENOSPC; do
+		_set_fs_sysfs_attr $dev \
+				   error/metadata/${e}/max_retries -1
+		echo -n "error/metadata/${e}/max_retries="
+		_get_fs_sysfs_attr $dev error/metadata/${e}/max_retries
+
+		_set_fs_sysfs_attr $dev \
+				   error/metadata/${e}/retry_timeout_seconds 0
+		echo -n "error/metadata/${e}/retry_timeout_seconds="
+		_get_fs_sysfs_attr $dev \
+				   error/metadata/${e}/retry_timeout_seconds
+	done
+}
+
 # Skip if we are running an older binary without the stricter input checks.
 # Make multiple checks to be sure that there is no regression on the one
 # selected feature check, which would skew the result.
diff --git a/tests/xfs/006 b/tests/xfs/006
index 8910026..58f9348 100755
--- a/tests/xfs/006
+++ b/tests/xfs/006
@@ -57,31 +57,18 @@ _scratch_mkfs > $seqres.full 2>&1
 _dmerror_init
 _dmerror_mount
 
-# Enable fail_at_unmount, so XFS stops retrying on errors at unmount
-# time. _fail the test if we fail to set it to 1, because the test
-# probably will hang in such case and block subsequent tests.
-_set_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount 1
+# Make sure all error handling attributes are original status
+reset_xfs_sysfs_error_handling $DMERROR_DEV
+
+# Make sure fail_at_unmount is enabled, so XFS stops retrying on
+# errors at unmount time. _fail the test if we fail to set it to 1,
+# because the test probably will hang in such case and block
+# subsequent tests.
 attr=`_get_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount`
 if [ "$attr" != "1" ]; then
 	_fail "Failed to set error/fail_at_unmount: $attr"
 fi
 
-# Make sure all will be configured to retry forever by default, except
-# for ENODEV, which is an unrecoverable error, so it will be configured
-# to not retry on error by default.
-for e in default EIO ENOSPC; do
-	_set_fs_sysfs_attr $DMERROR_DEV \
-			   error/metadata/${e}/max_retries -1
-	echo -n "error/metadata/${e}/max_retries="
-	_get_fs_sysfs_attr $DMERROR_DEV error/metadata/${e}/max_retries
-
-	_set_fs_sysfs_attr $DMERROR_DEV \
-			   error/metadata/${e}/retry_timeout_seconds 0
-	echo -n "error/metadata/${e}/retry_timeout_seconds="
-	_get_fs_sysfs_attr $DMERROR_DEV \
-			   error/metadata/${e}/retry_timeout_seconds
-done
-
 # start a metadata-intensive workload, but no data allocation operation.
 # Because uncompleted new space allocation I/Os may cause XFS to shutdown
 # after loading error table.
diff --git a/tests/xfs/006.out b/tests/xfs/006.out
index 393f411..3260b3a 100644
--- a/tests/xfs/006.out
+++ b/tests/xfs/006.out
@@ -1,4 +1,5 @@
 QA output created by 006
+error/fail_at_unmount=1
 error/metadata/default/max_retries=-1
 error/metadata/default/retry_timeout_seconds=0
 error/metadata/EIO/max_retries=-1
-- 
2.7.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* [PATCH 2/2] fstests: xfs EIO error handling test
  2016-08-19 17:56 [PATCH 1/2] xfs/006: move code about resetting error handling to common/rc Zorro Lang
@ 2016-08-19 17:56 ` Zorro Lang
  2016-08-22  6:12 ` [PATCH 1/2] xfs/006: move code about resetting error handling to common/rc Eryu Guan
  1 sibling, 0 replies; 4+ messages in thread
From: Zorro Lang @ 2016-08-19 17:56 UTC (permalink / raw)
  To: fstests; +Cc: Zorro Lang, xfs

Besides fail_at_unmount, all EIO error handling can stop umount
hanging on IO error too.

This case test EIO/max_retries and EIO/retry_timeout_seconds as
below:

1) fail_at_unmount=0 && \
   EIO/max_retries=1 && \
   EIO/retry_timeout_seconds=0

2) fail_at_unmount=0 && \
   EIO/max_retries=-1 && \
   EIO/retry_timeout_seconds=1

Make sure when fail_at_unmount=0, umount won't hang there.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 tests/xfs/263     | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/263.out |  21 +++++++++
 tests/xfs/group   |   1 +
 3 files changed, 148 insertions(+)
 create mode 100755 tests/xfs/263
 create mode 100644 tests/xfs/263.out

diff --git a/tests/xfs/263 b/tests/xfs/263
new file mode 100755
index 0000000..2df139c
--- /dev/null
+++ b/tests/xfs/263
@@ -0,0 +1,126 @@
+#! /bin/bash
+# FS QA Test 263
+#
+# Test XFS EIO error handling configuration. Stop XFS from retrying
+# to writeback forever when hit EIO.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 Red Hat, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+	_dmerror_cleanup
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/dmerror
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs xfs
+_supported_os Linux
+_require_dm_target error
+_require_scratch
+_require_fs_sysfs error/fail_at_unmount
+_require_fs_sysfs error/metadata/EIO/max_retries
+_require_fs_sysfs error/metadata/EIO/retry_timeout_seconds
+
+_scratch_mkfs >> $seqres.full 2>&1
+_dmerror_init
+
+do_test()
+{
+	local attr="$1"
+	local num=0
+
+	_dmerror_mount
+	reset_xfs_sysfs_error_handling $DMERROR_DEV
+	# Disable fail_at_unmount before test EIO error handling
+	_set_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount 0
+	echo -n "error/fail_at_unmount="
+	_get_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount
+
+	_set_fs_sysfs_attr $DMERROR_DEV $attr 1
+	num=`_get_fs_sysfs_attr $DMERROR_DEV $attr`
+	echo "$attr=$num"
+	# _fail the test if we fail to set $attr to 1, because the test
+	# probably will hang in such case and block subsequent tests.
+	if [ "$num" != "1" ]; then
+		_fail "Failed to set $attr: 1"
+	fi
+
+	# start a metadata-intensive workload, but no data allocation operation.
+	# Because uncompleted new space allocation I/Os may cause XFS to shutdown
+	# after loading error table.
+	$FSSTRESS_PROG -z -n 5000 -p 10 \
+		       -f creat=10 \
+		       -f resvsp=1 \
+		       -f truncate=1 \
+		       -f punch=1 \
+		       -f chown=5 \
+		       -f mkdir=5 \
+		       -f rmdir=1 \
+		       -f mknod=1 \
+		       -f unlink=1 \
+		       -f symlink=1 \
+		       -f rename=1 \
+		       -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1
+
+	# Loading error table without "--nolockfs" option. Because "--nolockfs"
+	# won't freeze fs, then some running I/Os may cause XFS to shutdown
+	# prematurely. That's not what we want to test.
+	_dmerror_load_error_table lockfs
+	_dmerror_unmount
+
+	# Mount again to replay log after loading working table, so we have a
+	# consistent XFS after test.
+	_dmerror_load_working_table
+	_dmerror_mount
+	_dmerror_unmount
+}
+
+#### Test EIO/max_retries ####
+# Set EIO/max_retries a limited number(>-1), then even if fail_at_unmount=0,
+# the test won't hang.
+echo "=== Test EIO/max_retries ==="
+do_test error/metadata/EIO/max_retries
+
+#### Test EIO/retry_timeout_seconds ####
+# Set EIO/retry_timeout_seconds to a limited number(>0), then even if
+# fail_at_unmount=0, the test won't hang.
+echo "=== Test EIO/retry_timeout_seconds ==="
+do_test error/metadata/EIO/retry_timeout_seconds
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/263.out b/tests/xfs/263.out
new file mode 100644
index 0000000..714350f
--- /dev/null
+++ b/tests/xfs/263.out
@@ -0,0 +1,21 @@
+QA output created by 263
+=== Test EIO/max_retries ===
+error/fail_at_unmount=1
+error/metadata/default/max_retries=-1
+error/metadata/default/retry_timeout_seconds=0
+error/metadata/EIO/max_retries=-1
+error/metadata/EIO/retry_timeout_seconds=0
+error/metadata/ENOSPC/max_retries=-1
+error/metadata/ENOSPC/retry_timeout_seconds=0
+error/fail_at_unmount=0
+error/metadata/EIO/max_retries=1
+=== Test EIO/retry_timeout_seconds ===
+error/fail_at_unmount=1
+error/metadata/default/max_retries=-1
+error/metadata/default/retry_timeout_seconds=0
+error/metadata/EIO/max_retries=-1
+error/metadata/EIO/retry_timeout_seconds=0
+error/metadata/ENOSPC/max_retries=-1
+error/metadata/ENOSPC/retry_timeout_seconds=0
+error/fail_at_unmount=0
+error/metadata/EIO/retry_timeout_seconds=1
diff --git a/tests/xfs/group b/tests/xfs/group
index 6905a62..ec3c022 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -260,6 +260,7 @@
 260 auto quick quota
 261 auto quick quota
 262 auto quick quota
+263 auto quick mount
 265 auto clone
 266 dump ioctl auto quick
 267 dump ioctl tape
-- 
2.7.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH 1/2] xfs/006: move code about resetting error handling to common/rc
  2016-08-19 17:56 [PATCH 1/2] xfs/006: move code about resetting error handling to common/rc Zorro Lang
  2016-08-19 17:56 ` [PATCH 2/2] fstests: xfs EIO error handling test Zorro Lang
@ 2016-08-22  6:12 ` Eryu Guan
  1 sibling, 0 replies; 4+ messages in thread
From: Eryu Guan @ 2016-08-22  6:12 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests, xfs

On Sat, Aug 20, 2016 at 01:56:31AM +0800, Zorro Lang wrote:
> Nearly 1/3 code is used to reset the xfs error handling attributes,
> This part can be picked up, and used for other cases. So move them
> to a new function reset_xfs_sysfs_error_handling() in common/rc.
> 
> Signed-off-by: Zorro Lang <zlang@redhat.com>

These two patches look good to me, both xfs/006 and the new EIO test
passed on 4.8-rc2 and RHEL7 kernel, test hung as expected if I set
max_retries or retry_timeout_seconds to 0. Just some nitpicks below:

> ---
>  common/rc         | 37 +++++++++++++++++++++++++++++++++++++
>  tests/xfs/006     | 27 +++++++--------------------
>  tests/xfs/006.out |  1 +
>  3 files changed, 45 insertions(+), 20 deletions(-)
> 
> diff --git a/common/rc b/common/rc
> index 3fb0600..b038d8e 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -3888,6 +3888,43 @@ _get_fs_sysfs_attr()
>  	cat /sys/fs/${FSTYP}/${dname}/${attr}
>  }
>  
> +
> +# Reset all xfs error handling attributes, set them to original
> +# status.
> +#
> +# Only one argument, and it's necessary:
                                 ^^^^^^^^^ mandatory?

> +#  - dev: device name, e.g. $SCRATCH_DEV
> +#
> +# Note: this function only works for XFS
> +reset_xfs_sysfs_error_handling()

Usually we name common helpers with a "_" as prefix.

I can fix them at commit time, if there's no new review comments from
others.

Thanks,
Eryu

> +{
> +	local dev=$1
> +
> +	if [ ! -b "$dev" -o "$FSTYP" != "xfs" ];then
> +		_fail "Usage: reset_xfs_sysfs_error_handling <device>"
> +	fi
> +
> +	_set_fs_sysfs_attr $dev error/fail_at_unmount 1
> +	echo -n "error/fail_at_unmount="
> +	_get_fs_sysfs_attr $dev error/fail_at_unmount
> +
> +	# Make sure all will be configured to retry forever by default, except
> +	# for ENODEV, which is an unrecoverable error, so it will be configured
> +	# to not retry on error by default.
> +	for e in default EIO ENOSPC; do
> +		_set_fs_sysfs_attr $dev \
> +				   error/metadata/${e}/max_retries -1
> +		echo -n "error/metadata/${e}/max_retries="
> +		_get_fs_sysfs_attr $dev error/metadata/${e}/max_retries
> +
> +		_set_fs_sysfs_attr $dev \
> +				   error/metadata/${e}/retry_timeout_seconds 0
> +		echo -n "error/metadata/${e}/retry_timeout_seconds="
> +		_get_fs_sysfs_attr $dev \
> +				   error/metadata/${e}/retry_timeout_seconds
> +	done
> +}
> +
>  # Skip if we are running an older binary without the stricter input checks.
>  # Make multiple checks to be sure that there is no regression on the one
>  # selected feature check, which would skew the result.
> diff --git a/tests/xfs/006 b/tests/xfs/006
> index 8910026..58f9348 100755
> --- a/tests/xfs/006
> +++ b/tests/xfs/006
> @@ -57,31 +57,18 @@ _scratch_mkfs > $seqres.full 2>&1
>  _dmerror_init
>  _dmerror_mount
>  
> -# Enable fail_at_unmount, so XFS stops retrying on errors at unmount
> -# time. _fail the test if we fail to set it to 1, because the test
> -# probably will hang in such case and block subsequent tests.
> -_set_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount 1
> +# Make sure all error handling attributes are original status
> +reset_xfs_sysfs_error_handling $DMERROR_DEV
> +
> +# Make sure fail_at_unmount is enabled, so XFS stops retrying on
> +# errors at unmount time. _fail the test if we fail to set it to 1,
> +# because the test probably will hang in such case and block
> +# subsequent tests.
>  attr=`_get_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount`
>  if [ "$attr" != "1" ]; then
>  	_fail "Failed to set error/fail_at_unmount: $attr"
>  fi
>  
> -# Make sure all will be configured to retry forever by default, except
> -# for ENODEV, which is an unrecoverable error, so it will be configured
> -# to not retry on error by default.
> -for e in default EIO ENOSPC; do
> -	_set_fs_sysfs_attr $DMERROR_DEV \
> -			   error/metadata/${e}/max_retries -1
> -	echo -n "error/metadata/${e}/max_retries="
> -	_get_fs_sysfs_attr $DMERROR_DEV error/metadata/${e}/max_retries
> -
> -	_set_fs_sysfs_attr $DMERROR_DEV \
> -			   error/metadata/${e}/retry_timeout_seconds 0
> -	echo -n "error/metadata/${e}/retry_timeout_seconds="
> -	_get_fs_sysfs_attr $DMERROR_DEV \
> -			   error/metadata/${e}/retry_timeout_seconds
> -done
> -
>  # start a metadata-intensive workload, but no data allocation operation.
>  # Because uncompleted new space allocation I/Os may cause XFS to shutdown
>  # after loading error table.
> diff --git a/tests/xfs/006.out b/tests/xfs/006.out
> index 393f411..3260b3a 100644
> --- a/tests/xfs/006.out
> +++ b/tests/xfs/006.out
> @@ -1,4 +1,5 @@
>  QA output created by 006
> +error/fail_at_unmount=1
>  error/metadata/default/max_retries=-1
>  error/metadata/default/retry_timeout_seconds=0
>  error/metadata/EIO/max_retries=-1
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2016-08-22  6:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-19 17:56 [PATCH 1/2] xfs/006: move code about resetting error handling to common/rc Zorro Lang
2016-08-19 17:56 ` [PATCH 2/2] fstests: xfs EIO error handling test Zorro Lang
2016-08-22  6:12 ` [PATCH 1/2] xfs/006: move code about resetting error handling to common/rc Eryu Guan
  -- strict thread matches above, loose matches on Subject: below --
2016-08-19 17:51 [PATCH 1/2] common/rc: add functions to check or write objects under /sys/fs/$FSTYP Zorro Lang
2016-08-19 17:51 ` [PATCH 2/2] fstests: xfs EIO error handling test Zorro Lang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox