Re: [PATCH v2 4/6] generic/623: do not run with overlayfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 5, 2025 at 7:32 PM Zorro Lang <zlang@xxxxxxxxxx> wrote:
>
> On Tue, Jun 03, 2025 at 12:07:43PM +0200, Amir Goldstein wrote:
> > This test performs shutdown via xfs_io -c shutdown.
> >
> > Overlayfs tests can use _scratch_shutdown, but they cannot use
> > "-c shutdown" xfs_io command without jumping through hoops, so by
> > default we do not support it.
> >
> > Add this condition to _require_xfs_io_command and add the require
> > statement to test generic/623 so it wont run with overlayfs.
> >
> > Reported-by: André Almeida <andrealmeid@xxxxxxxxxx>
> > Tested-by: André Almeida <andrealmeid@xxxxxxxxxx>
> > Link: https://lore.kernel.org/linux-fsdevel/20250521-ovl_ro-v1-1-2350b1493d94@xxxxxxxxxx/
> > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
> > ---
> >  common/rc         | 8 ++++++++
> >  tests/generic/623 | 1 +
> >  2 files changed, 9 insertions(+)
> >
> > diff --git a/common/rc b/common/rc
> > index d8ee8328..bffd576a 100644
> > --- a/common/rc
> > +++ b/common/rc
> > @@ -3033,6 +3033,14 @@ _require_xfs_io_command()
> >               touch $testfile
> >               testio=`$XFS_IO_PROG -c "syncfs" $testfile 2>&1`
> >               ;;
> > +     "shutdown")
> > +             if [ $FSTYP = "overlay" ]; then
> > +                     # Overlayfs tests can use _scratch_shutdown, but they
> > +                     # cannot use "-c shutdown" xfs_io command without jumping
> > +                     # through hoops, so by default we do not support it.
> > +                     _notrun "xfs_io $command not supported on $FSTYP"
> > +             fi
> > +             ;;
>
> Hmm... I'm not sure this's a good way.
> For example, overlay/087 does xfs_io shutdown too,

Yes it does but look at the effort needed to do that properly:

$XFS_IO_PROG -x -c "open $(_scratch_shutdown_handle)" -c 'shutdown -f
' -c close -c syncfs $SCRATCH_MNT | \
        grep -vF '[00'

> generally it should calls
> _require_xfs_io_command "shutdown" although it doesn't. If someone overlay
> test case hope to test as o/087 does, and it calls _require_xfs_io_command "shutdown",
> then it'll be _notrun.

If someone knows enough to perform the dance above with _scratch_shutdown_handle
then that someone should know enough not to call
_require_xfs_io_command "shutdown".
OTOH, if someone doesn't know then default is to not run.

>
> If g/623 is not suitable for overlay, how about skip it for overlay clearly, by
> `_exclude_fs overlay` ?
>

I do not personally mind doing this _exclude_fs overlay, but it is usually
prefered to require what the test needs.

Whatever you prefer is fine by me.

Thanks,
Amir.





[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux