xfstests: create a test for xfs log grant head leak detection
PATCH v2 1/1 xfstests: create a test for xfs log grant head leak detection
Changes in the XFS logging code have lead to small leaks in the log grant heads that consume log space slowly over time. Such problems have gone undetected for an unnecessarily long time due to code complexity and potential for very subtle problems. Losing only a few bytes per logged item on a reasonably large enough fs (10s of GB) means only the most continuously stressful workloads will cause a severe enough failure (deadlock due to log reservation exhaustion) quickly enough to indicate something is seriously wrong.
Recent changes in XFS export the state of the various log heads through sysfs to aid in userspace/runtime analysis of the log. This test runs a workload against an XFS filesystem, quiesces the fs and verifies that the log reserve and write grant heads have not leaked any space with respect to the current head of the physical log.
---
v2:
- Rework the test to run a background fsstress and a foreground log check loop.
- Replace _get_device_name() with _short_dev().
- Create and use _require_xfs_sysfs().
- Added to log and metadata test groups.
- Assorted fixes for test output, filters and awk invocations.
v1: http://oss.sgi.com/archives/xfs/2014-06/msg00145.html
- Use updated attribute names and value format.
rfc: http://oss.sgi.com/archives/xfs/2014-05/msg00428.html
common/rc | 17 ++++++++ tests/xfs/011 | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/011.out | 2 + tests/xfs/group | 1 + 4 files changed, 136 insertions(+) create mode 100755 tests/xfs/011 create mode 100644 tests/xfs/011.out
common/rc +17 -0
@@ -1131,6 +1131,23 @@ _require_xfs_finobt() umount $SCRATCH_MNT } +# this test requires xfs sysfs attribute support +# +_require_xfs_sysfs() +{ + attr=$1 + sysfsdir=/sys/fs/xfs + testdev=`_short_dev $TEST_DEV` + + if [ ! -e $sysfsdir ]; then + _notrun "no kernel support for XFS sysfs attributes" + fi + + if [ ! -z $1 ] && [ ! -e $sysfsdir/$testdev/$attr ]; then + _notrun "sysfs attribute '$attr' is not supported" + fi +} + # this test requires that external log/realtime devices are not in use # _require_nonexternal()
tests/xfs/011 new file +116 -0
116 lines not on this page · raw message
tests/xfs/011.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 011 +Silence is golden.
tests/xfs/group +1 -0
@@ -8,6 +8,7 @@ 008 rw ioctl auto quick 009 rw ioctl auto prealloc quick 010 auto quick repair +011 auto freeze log metadata quick 012 rw auto quick 013 auto metadata stress 016 rw auto quick
Signature · 1 line
1.8.3.1