From: "Darrick J. Wong" <djwong@kernel.org>
To: Zorro Lang <zlang@redhat.com>
Cc: hch@lst.de, fstests@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 01/13] xfs: test health monitoring code
Date: Mon, 9 Mar 2026 11:03:09 -0700 [thread overview]
Message-ID: <20260309180309.GA6069@frogsfrogsfrogs> (raw)
In-Reply-To: <20260309172114.4pi7d4y4n2pprfzm@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com>
On Tue, Mar 10, 2026 at 01:21:14AM +0800, Zorro Lang wrote:
> On Mon, Mar 02, 2026 at 04:41:07PM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > Add some functionality tests for the new health monitoring code.
> >
> > Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> > ---
> > doc/group-names.txt | 1 +
> > tests/xfs/1885 | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++
> > tests/xfs/1885.out | 5 +++++
> > 3 files changed, 59 insertions(+)
> > create mode 100755 tests/xfs/1885
> > create mode 100644 tests/xfs/1885.out
> >
> >
> > diff --git a/doc/group-names.txt b/doc/group-names.txt
> > index 10b49e50517797..158f84d36d3154 100644
> > --- a/doc/group-names.txt
> > +++ b/doc/group-names.txt
> > @@ -117,6 +117,7 @@ samefs overlayfs when all layers are on the same fs
> > scrub filesystem metadata scrubbers
> > seed btrfs seeded filesystems
> > seek llseek functionality
> > +selfhealing self healing filesystem code
> > selftest tests with fixed results, used to validate testing setup
> > send btrfs send/receive
> > shrinkfs decreasing the size of a filesystem
> > diff --git a/tests/xfs/1885 b/tests/xfs/1885
> > new file mode 100755
> > index 00000000000000..1d75ef19c7c9d9
> > --- /dev/null
> > +++ b/tests/xfs/1885
> > @@ -0,0 +1,53 @@
> > +#! /bin/bash
> > +# SPDX-License-Identifier: GPL-2.0
> > +# Copyright (c) 2024-2026 Oracle. All Rights Reserved.
> > +#
> > +# FS QA Test 1885
> > +#
> > +# Make sure that healthmon handles module refcount correctly.
> > +#
> > +. ./common/preamble
> > +_begin_fstest auto selfhealing
>
> I found this test is quick enough, how about add it into "quick" group.
OK.
> > +
> > +. ./common/filter
> > +. ./common/module
>
> Which helper is this "module" file being included for?
I think at one point I would rmmod/modprobe the module to force the
refcount leak issue, but discovered there's a sysfs knob for that...
> > +
> > +refcount_file="/sys/module/xfs/refcnt"
> > +test -e "$refcount_file" || _notrun "cannot find xfs module refcount"
>
> Or did you intend to add this part as a helper into common/module?
...so this probably should get refactored into a new helper.
> > +
> > +_require_test
> > +_require_xfs_io_command healthmon
> > +
> > +# Capture mod refcount without the test fs mounted
> > +_test_unmount
> > +init_refcount="$(cat "$refcount_file")"
> > +
> > +# Capture mod refcount with the test fs mounted
> > +_test_mount
> > +nomon_mount_refcount="$(cat "$refcount_file")"
> > +
> > +# Capture mod refcount with test fs mounted and the healthmon fd open.
> > +# Pause the xfs_io process so that it doesn't actually respond to events.
> > +$XFS_IO_PROG -c 'healthmon -c -v' $TEST_DIR >> $seqres.full &
> > +sleep 0.5
> > +kill -STOP %1
> > +mon_mount_refcount="$(cat "$refcount_file")"
> > +
> > +# Capture mod refcount with only the healthmon fd open.
> > +_test_unmount
> > +mon_nomount_refcount="$(cat "$refcount_file")"
> > +
> > +# Capture mod refcount after continuing healthmon (which should exit due to the
> > +# unmount) and killing it.
> > +kill -CONT %1
> > +kill %1
> > +wait
>
> We typically ensure that background processes are handled within the _cleanup function.
oops, will clean that up.
$XFS_IO_PROG -c 'healthmon -c -v' $TEST_DIR >> $seqres.full &
healer_pid=$!
...
kill $healer_pid
etc. Thanks for pointing that out.
--D
> > +nomon_nomount_refcount="$(cat "$refcount_file")"
> > +
> > +_within_tolerance "mount refcount" "$nomon_mount_refcount" "$((init_refcount + 1))" 0 -v
> > +_within_tolerance "mount + healthmon refcount" "$mon_mount_refcount" "$((init_refcount + 2))" 0 -v
> > +_within_tolerance "healthmon refcount" "$mon_nomount_refcount" "$((init_refcount + 1))" 0 -v
> > +_within_tolerance "end refcount" "$nomon_nomount_refcount" "$init_refcount" 0 -v
> > +
> > +status=0
> > +exit
>
> _exit 0
>
> > diff --git a/tests/xfs/1885.out b/tests/xfs/1885.out
> > new file mode 100644
> > index 00000000000000..f152cef0525609
> > --- /dev/null
> > +++ b/tests/xfs/1885.out
> > @@ -0,0 +1,5 @@
> > +QA output created by 1885
> > +mount refcount is in range
> > +mount + healthmon refcount is in range
> > +healthmon refcount is in range
> > +end refcount is in range
> >
>
next prev parent reply other threads:[~2026-03-09 18:03 UTC|newest]
Thread overview: 111+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-03 0:25 [PATCHBOMB v8] xfsprogs: autonomous self healing of filesystems Darrick J. Wong
2026-03-03 0:33 ` [PATCHSET " Darrick J. Wong
2026-03-03 0:34 ` [PATCH 01/26] libfrog: add a function to grab the path from an open fd and a file handle Darrick J. Wong
2026-03-03 15:44 ` Christoph Hellwig
2026-03-03 0:34 ` [PATCH 02/26] libfrog: create healthmon event log library functions Darrick J. Wong
2026-03-03 15:44 ` Christoph Hellwig
2026-03-03 0:34 ` [PATCH 03/26] libfrog: add support code for starting systemd services programmatically Darrick J. Wong
2026-03-03 15:45 ` Christoph Hellwig
2026-03-03 15:59 ` Darrick J. Wong
2026-03-05 2:39 ` Darrick J. Wong
2026-03-05 13:57 ` Christoph Hellwig
2026-03-03 0:34 ` [PATCH 04/26] libfrog: hoist a couple of service helper functions Darrick J. Wong
2026-03-03 15:45 ` Christoph Hellwig
2026-03-03 0:35 ` [PATCH 05/26] man2: document the healthmon ioctl Darrick J. Wong
2026-03-03 15:46 ` Christoph Hellwig
2026-03-03 0:35 ` [PATCH 06/26] man2: document the media verification ioctl Darrick J. Wong
2026-03-03 15:46 ` Christoph Hellwig
2026-03-03 0:35 ` [PATCH 07/26] xfs_io: monitor filesystem health events Darrick J. Wong
2026-03-03 15:46 ` Christoph Hellwig
2026-03-03 0:35 ` [PATCH 08/26] xfs_io: add a media verify command Darrick J. Wong
2026-03-03 15:46 ` Christoph Hellwig
2026-03-03 0:36 ` [PATCH 09/26] xfs_healer: create daemon to listen for health events Darrick J. Wong
2026-03-03 15:47 ` Christoph Hellwig
2026-03-03 0:36 ` [PATCH 10/26] xfs_healer: enable repairing filesystems Darrick J. Wong
2026-03-03 15:47 ` Christoph Hellwig
2026-03-03 0:36 ` [PATCH 11/26] xfs_healer: use getparents to look up file names Darrick J. Wong
2026-03-03 15:48 ` Christoph Hellwig
2026-03-03 0:36 ` [PATCH 12/26] xfs_healer: create a per-mount background monitoring service Darrick J. Wong
2026-03-03 15:48 ` Christoph Hellwig
2026-03-03 0:37 ` [PATCH 13/26] xfs_healer: create a service to start the per-mount healer service Darrick J. Wong
2026-03-03 15:49 ` Christoph Hellwig
2026-03-03 16:52 ` Darrick J. Wong
2026-03-03 16:54 ` Christoph Hellwig
2026-03-03 17:06 ` Darrick J. Wong
2026-03-03 0:37 ` [PATCH 14/26] xfs_healer: don't start service if kernel support unavailable Darrick J. Wong
2026-03-03 15:49 ` Christoph Hellwig
2026-03-03 0:37 ` [PATCH 15/26] xfs_healer: use the autofsck fsproperty to select mode Darrick J. Wong
2026-03-03 15:50 ` Christoph Hellwig
2026-03-03 0:38 ` [PATCH 16/26] xfs_healer: run full scrub after lost corruption events or targeted repair failure Darrick J. Wong
2026-03-03 15:50 ` Christoph Hellwig
2026-03-03 0:38 ` [PATCH 17/26] xfs_healer: use getmntent to find moved filesystems Darrick J. Wong
2026-03-03 15:51 ` Christoph Hellwig
2026-03-03 17:26 ` Darrick J. Wong
2026-03-04 13:03 ` Christoph Hellwig
2026-03-04 16:30 ` Darrick J. Wong
2026-03-05 14:00 ` Christoph Hellwig
2026-03-05 17:55 ` Darrick J. Wong
2026-03-03 0:38 ` [PATCH 18/26] xfs_healer: validate that repair fds point to the monitored fs Darrick J. Wong
2026-03-03 15:52 ` Christoph Hellwig
2026-03-03 0:38 ` [PATCH 19/26] xfs_healer: add a manual page Darrick J. Wong
2026-03-03 15:52 ` Christoph Hellwig
2026-03-03 0:39 ` [PATCH 20/26] xfs_scrub: use the verify media ioctl during phase 6 if possible Darrick J. Wong
2026-03-03 15:53 ` Christoph Hellwig
2026-03-03 16:59 ` Darrick J. Wong
2026-03-03 0:39 ` [PATCH 21/26] xfs_scrub: perform media scanning of the log region Darrick J. Wong
2026-03-03 15:54 ` Christoph Hellwig
2026-03-03 0:39 ` [PATCH 22/26] xfs_io: add listmount command Darrick J. Wong
2026-03-03 15:56 ` Christoph Hellwig
2026-03-03 17:08 ` Darrick J. Wong
2026-03-03 0:39 ` [PATCH 23/26] xfs_io: print systemd service names Darrick J. Wong
2026-03-03 15:57 ` Christoph Hellwig
2026-03-03 17:29 ` Darrick J. Wong
2026-03-04 13:04 ` Christoph Hellwig
2026-03-04 16:35 ` Darrick J. Wong
2026-03-05 13:55 ` Christoph Hellwig
2026-03-05 22:00 ` Darrick J. Wong
2026-03-06 14:20 ` Christoph Hellwig
2026-03-06 15:58 ` Darrick J. Wong
2026-03-03 0:40 ` [PATCH 24/26] mkfs: enable online repair if all backrefs are enabled Darrick J. Wong
2026-03-03 15:58 ` Christoph Hellwig
2026-03-03 17:32 ` Darrick J. Wong
2026-03-05 22:22 ` Darrick J. Wong
2026-03-03 0:40 ` [PATCH 25/26] debian: enable xfs_healer on the root filesystem by default Darrick J. Wong
2026-03-03 15:58 ` Christoph Hellwig
2026-03-03 17:14 ` Darrick J. Wong
2026-03-04 13:01 ` Christoph Hellwig
2026-03-05 22:10 ` Darrick J. Wong
2026-03-05 22:18 ` Darrick J. Wong
2026-03-03 0:40 ` [PATCH 26/26] debian/control: listify the build dependencies Darrick J. Wong
2026-03-03 15:58 ` Christoph Hellwig
2026-03-03 17:09 ` Darrick J. Wong
2026-03-03 0:33 ` [PATCHSET v8 1/2] fstests: test generic file IO error reporting Darrick J. Wong
2026-03-03 0:40 ` [PATCH 1/1] generic: test fsnotify filesystem " Darrick J. Wong
2026-03-03 9:21 ` Amir Goldstein
2026-03-03 14:51 ` Christoph Hellwig
2026-03-03 14:56 ` Amir Goldstein
2026-03-04 10:10 ` Jan Kara
2026-03-03 14:54 ` Christoph Hellwig
2026-03-03 16:06 ` Gabriel Krisman Bertazi
2026-03-03 16:12 ` Christoph Hellwig
2026-03-03 16:38 ` Darrick J. Wong
2026-03-03 16:49 ` Darrick J. Wong
2026-03-03 16:53 ` Christoph Hellwig
2026-03-03 17:59 ` Darrick J. Wong
2026-03-03 0:33 ` [PATCHSET v8 2/2] fstests: autonomous self healing of filesystems Darrick J. Wong
2026-03-03 0:41 ` [PATCH 01/13] xfs: test health monitoring code Darrick J. Wong
2026-03-09 17:21 ` Zorro Lang
2026-03-09 18:03 ` Darrick J. Wong [this message]
2026-03-03 0:41 ` [PATCH 02/13] xfs: test for metadata corruption error reporting via healthmon Darrick J. Wong
2026-03-03 0:41 ` [PATCH 03/13] xfs: test io " Darrick J. Wong
2026-03-03 0:41 ` [PATCH 04/13] xfs: set up common code for testing xfs_healer Darrick J. Wong
2026-03-03 0:42 ` [PATCH 05/13] xfs: test xfs_healer's event handling Darrick J. Wong
2026-03-03 0:42 ` [PATCH 06/13] xfs: test xfs_healer can fix a filesystem Darrick J. Wong
2026-03-03 0:42 ` [PATCH 07/13] xfs: test xfs_healer can report file I/O errors Darrick J. Wong
2026-03-03 0:42 ` [PATCH 08/13] xfs: test xfs_healer can report file media errors Darrick J. Wong
2026-03-03 0:43 ` [PATCH 09/13] xfs: test xfs_healer can report filesystem shutdowns Darrick J. Wong
2026-03-03 0:43 ` [PATCH 10/13] xfs: test xfs_healer can initiate full filesystem repairs Darrick J. Wong
2026-03-03 0:43 ` [PATCH 11/13] xfs: test xfs_healer can follow mount moves Darrick J. Wong
2026-03-03 0:43 ` [PATCH 12/13] xfs: test xfs_healer wont repair the wrong filesystem Darrick J. Wong
2026-03-03 0:44 ` [PATCH 13/13] xfs: test xfs_healer background service Darrick J. Wong
2026-03-03 0:47 ` [PATCH 14/13] xfs: test xfs_healer startup service 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=20260309180309.GA6069@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=zlang@redhat.com \
/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