Re: [PATCH 1/1] generic: test fsnotify filesystem error reporting

Darrick J. Wong
2026-03-03T16:49:02Z

On Tue, Mar 03, 2026 at 06:54:29AM -0800, Christoph Hellwig wrote:
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Copyright 2021, Collabora Ltd.
> > + */
>
> Where is this coming from?
>
> > +#ifndef __GLIBC__
> > +#include <asm-generic/int-ll64.h>
> > +#endif
>
> And what is this for? Looks pretty whacky.
>
> > +case "$FSTYP" in
> > +xfs)
> > + # added as a part of xfs health monitoring
> > + _require_xfs_io_command healthmon
> > + # no out of place writes
> > + _require_no_xfs_always_cow
> > + ;;
> > +ext4)
> > + # added at the same time as uevents
> > + modprobe fs-$FSTYP
> > + test -e /sys/fs/ext4/features/uevents || \
> > + _notrun "$FSTYP does not support fsnotify ioerrors"
> > + ;;
> > +*)
> > + _notrun "$FSTYP does not support fsnotify ioerrors"
> > + ;;
> > +esac
>
> Please abstract this out into a documented helper in common/

Ok. I'm not sure how to check for feature support on ext4 anymore since
the uevents patch didn't get merged, and then I clearly forgot to rip
that out of this helper here.

> > +#
> > +# The dm-error map added by this test doesn't work on zoned devices because
> > +# table sizes need to be aligned to the zone size, and even for zoned on
> > +# conventional this test will get confused because of the internal RT device.
> > +#
> > +# That check requires a mounted file system, so do a dummy mount before setting
> > +# up DM.
> > +#
> > +_scratch_mount
> > +test $FSTYP = xfs && _require_xfs_scratch_non_zoned
> > +_scratch_unmount
>
> Hmm, this is a bit sad. Can we align the map? Or should we carve in
> and add proper error injection to the block code, which has been
> somewhere on my todo list forever because dm-error and friends are
> so painful to setup. Maybe I need to expedite that.

I think it's theoretically possible to figure out that there's a zone
size and then round outwards the error-target part of the dm table to
align with a zone. I have a lot more doubts about whether or not doing
that in bash/awk is a good idea though. It'd be a lot easier if either
the block layer did error injection or if someone just fixes those
limitations in dm itself.

--D