* [PATCH] common/overlay: source base fs specific common file
@ 2022-05-12 17:56 Zorro Lang
2022-05-12 18:11 ` Amir Goldstein
0 siblings, 1 reply; 4+ messages in thread
From: Zorro Lang @ 2022-05-12 17:56 UTC (permalink / raw)
To: fstests; +Cc: amir73il
When tests overlayfs, sometimes we need the underlying fs specific
helpers, e.g. common/rc has:
_filesystem_timestamp_range $OVL_BASE_TEST_DEV $OVL_BASE_FSTYP
So when we source common/overlay, better to source then OVL_BASE_FSTYP
too.
Signed-off-by: Zorro Lang <zlang@kernel.org>
---
The generic/402 always fails on overlayfs as:
QA output created by 402
./common/rc: line 2441: _xfs_timestamp_range: command not found
./common/rc: line 2403: [: syntax error: '-1' unexpected
./common/rc: line 2408: [: -le: unary operator expected
./common/rc: line 2441: _xfs_timestamp_range: command not found
0;0 != 1;1
0;0 != 1;1
Silence is golden
Due to if FSTYP is overlay, we only source common/overlay file. But we
still need the helpers of the underlying filesystem. So I think we need
to source the common/$OVL_BASE_FSTYP in common/overlay. What do you think?
Thanks,
Zorro
common/config | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++
common/overlay | 4 ++++
common/rc | 49 +----------------------------------------
3 files changed, 64 insertions(+), 48 deletions(-)
diff --git a/common/config b/common/config
index efcf12e9..b4b2a8d4 100644
--- a/common/config
+++ b/common/config
@@ -481,6 +481,65 @@ _fsck_opts()
esac
}
+_source_specific_fs()
+{
+ local fs=$1
+
+ if [ -z "$fs" ];then
+ fs=$FSTYP
+ fi
+
+ case "$fs" in
+ xfs)
+ [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found"
+ [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found"
+ [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found"
+ [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found"
+ [ "$XFS_INFO_PROG" = "" ] && _fatal "xfs_info not found"
+
+ . ./common/xfs
+ ;;
+ udf)
+ [ "$MKFS_UDF_PROG" = "" ] && _fatal "mkfs_udf/mkudffs not found"
+ ;;
+ btrfs)
+ [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found"
+
+ . ./common/btrfs
+ ;;
+ ext4)
+ [ "$MKFS_EXT4_PROG" = "" ] && _fatal "mkfs.ext4 not found"
+ ;;
+ f2fs)
+ [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found"
+ ;;
+ nfs)
+ . ./common/nfs
+ ;;
+ cifs)
+ ;;
+ 9p)
+ ;;
+ ceph)
+ . ./common/ceph
+ ;;
+ glusterfs)
+ ;;
+ overlay)
+ . ./common/overlay
+ ;;
+ reiser4)
+ [ "$MKFS_REISER4_PROG" = "" ] && _fatal "mkfs.reiser4 not found"
+ ;;
+ pvfs2)
+ ;;
+ ubifs)
+ [ "$UBIUPDATEVOL_PROG" = "" ] && _fatal "ubiupdatevol not found"
+ ;;
+ esac
+}
+
+
known_hosts()
{
[ "$HOST_CONFIG_DIR" ] || HOST_CONFIG_DIR=`pwd`/configs
diff --git a/common/overlay b/common/overlay
index fff67ba1..4708d393 100644
--- a/common/overlay
+++ b/common/overlay
@@ -12,6 +12,10 @@ export OVL_XATTR_NLINK="trusted.overlay.nlink"
export OVL_XATTR_UPPER="trusted.overlay.upper"
export OVL_XATTR_METACOPY="trusted.overlay.metacopy"
+if [ -n "$OVL_BASE_FSTYP" ];then
+ _source_specific_fs $OVL_BASE_FSTYP
+fi
+
# helper function to do the actual overlayfs mount operation
_overlay_mount_dirs()
{
diff --git a/common/rc b/common/rc
index e907e362..ebdeeb93 100644
--- a/common/rc
+++ b/common/rc
@@ -96,54 +96,7 @@ _log_err()
umask 022
# check for correct setup and source the $FSTYP specific functions now
-case "$FSTYP" in
- xfs)
- [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found"
- [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found"
- [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found"
- [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found"
- [ "$XFS_INFO_PROG" = "" ] && _fatal "xfs_info not found"
-
- . ./common/xfs
- ;;
- udf)
- [ "$MKFS_UDF_PROG" = "" ] && _fatal "mkfs_udf/mkudffs not found"
- ;;
- btrfs)
- [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found"
-
- . ./common/btrfs
- ;;
- ext4)
- [ "$MKFS_EXT4_PROG" = "" ] && _fatal "mkfs.ext4 not found"
- ;;
- f2fs)
- [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found"
- ;;
- nfs)
- . ./common/nfs
- ;;
- cifs)
- ;;
- 9p)
- ;;
- ceph)
- . ./common/ceph
- ;;
- glusterfs)
- ;;
- overlay)
- . ./common/overlay
- ;;
- reiser4)
- [ "$MKFS_REISER4_PROG" = "" ] && _fatal "mkfs.reiser4 not found"
- ;;
- pvfs2)
- ;;
- ubifs)
- [ "$UBIUPDATEVOL_PROG" = "" ] && _fatal "ubiupdatevol not found"
- ;;
-esac
+_source_specific_fs $FSTYP
if [ ! -z "$REPORT_LIST" ]; then
. ./common/report
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] common/overlay: source base fs specific common file
2022-05-12 17:56 [PATCH] common/overlay: source base fs specific common file Zorro Lang
@ 2022-05-12 18:11 ` Amir Goldstein
2022-05-12 18:29 ` Zorro Lang
0 siblings, 1 reply; 4+ messages in thread
From: Amir Goldstein @ 2022-05-12 18:11 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests
On Thu, May 12, 2022 at 8:56 PM Zorro Lang <zlang@kernel.org> wrote:
>
> When tests overlayfs, sometimes we need the underlying fs specific
> helpers, e.g. common/rc has:
> _filesystem_timestamp_range $OVL_BASE_TEST_DEV $OVL_BASE_FSTYP
>
> So when we source common/overlay, better to source then OVL_BASE_FSTYP
> too.
>
> Signed-off-by: Zorro Lang <zlang@kernel.org>
> ---
>
> The generic/402 always fails on overlayfs as:
>
> QA output created by 402
> ./common/rc: line 2441: _xfs_timestamp_range: command not found
> ./common/rc: line 2403: [: syntax error: '-1' unexpected
> ./common/rc: line 2408: [: -le: unary operator expected
> ./common/rc: line 2441: _xfs_timestamp_range: command not found
> 0;0 != 1;1
> 0;0 != 1;1
> Silence is golden
>
> Due to if FSTYP is overlay, we only source common/overlay file. But we
> still need the helpers of the underlying filesystem. So I think we need
> to source the common/$OVL_BASE_FSTYP in common/overlay. What do you think?
That makes sense.
I don't know why I have never hit this.
Maybe because I am not running with multi section config or
because I am runing with kvm-xfstests runner.
Thanks,
Amir.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] common/overlay: source base fs specific common file
2022-05-12 18:11 ` Amir Goldstein
@ 2022-05-12 18:29 ` Zorro Lang
2022-05-13 0:54 ` Amir Goldstein
0 siblings, 1 reply; 4+ messages in thread
From: Zorro Lang @ 2022-05-12 18:29 UTC (permalink / raw)
To: Amir Goldstein; +Cc: fstests
On Thu, May 12, 2022 at 09:11:34PM +0300, Amir Goldstein wrote:
> On Thu, May 12, 2022 at 8:56 PM Zorro Lang <zlang@kernel.org> wrote:
> >
> > When tests overlayfs, sometimes we need the underlying fs specific
> > helpers, e.g. common/rc has:
> > _filesystem_timestamp_range $OVL_BASE_TEST_DEV $OVL_BASE_FSTYP
> >
> > So when we source common/overlay, better to source then OVL_BASE_FSTYP
> > too.
> >
> > Signed-off-by: Zorro Lang <zlang@kernel.org>
> > ---
> >
> > The generic/402 always fails on overlayfs as:
> >
> > QA output created by 402
> > ./common/rc: line 2441: _xfs_timestamp_range: command not found
> > ./common/rc: line 2403: [: syntax error: '-1' unexpected
> > ./common/rc: line 2408: [: -le: unary operator expected
> > ./common/rc: line 2441: _xfs_timestamp_range: command not found
> > 0;0 != 1;1
> > 0;0 != 1;1
> > Silence is golden
> >
> > Due to if FSTYP is overlay, we only source common/overlay file. But we
> > still need the helpers of the underlying filesystem. So I think we need
> > to source the common/$OVL_BASE_FSTYP in common/overlay. What do you think?
>
> That makes sense.
I haven't given it enough test, hope it won't break something:)
> I don't know why I have never hit this.
> Maybe because I am not running with multi section config or
> because I am runing with kvm-xfstests runner.
Do you test overlay with XFS? For now, I think only xfs+overlay can reproduce
this failure.
Thanks,
Zorro
>
> Thanks,
> Amir.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] common/overlay: source base fs specific common file
2022-05-12 18:29 ` Zorro Lang
@ 2022-05-13 0:54 ` Amir Goldstein
0 siblings, 0 replies; 4+ messages in thread
From: Amir Goldstein @ 2022-05-13 0:54 UTC (permalink / raw)
To: Amir Goldstein, fstests
On Thu, May 12, 2022 at 9:29 PM Zorro Lang <zlang@kernel.org> wrote:
>
> On Thu, May 12, 2022 at 09:11:34PM +0300, Amir Goldstein wrote:
> > On Thu, May 12, 2022 at 8:56 PM Zorro Lang <zlang@kernel.org> wrote:
> > >
> > > When tests overlayfs, sometimes we need the underlying fs specific
> > > helpers, e.g. common/rc has:
> > > _filesystem_timestamp_range $OVL_BASE_TEST_DEV $OVL_BASE_FSTYP
> > >
> > > So when we source common/overlay, better to source then OVL_BASE_FSTYP
> > > too.
> > >
> > > Signed-off-by: Zorro Lang <zlang@kernel.org>
> > > ---
> > >
> > > The generic/402 always fails on overlayfs as:
> > >
> > > QA output created by 402
> > > ./common/rc: line 2441: _xfs_timestamp_range: command not found
> > > ./common/rc: line 2403: [: syntax error: '-1' unexpected
> > > ./common/rc: line 2408: [: -le: unary operator expected
> > > ./common/rc: line 2441: _xfs_timestamp_range: command not found
> > > 0;0 != 1;1
> > > 0;0 != 1;1
> > > Silence is golden
> > >
> > > Due to if FSTYP is overlay, we only source common/overlay file. But we
> > > still need the helpers of the underlying filesystem. So I think we need
> > > to source the common/$OVL_BASE_FSTYP in common/overlay. What do you think?
> >
> > That makes sense.
>
> I haven't given it enough test, hope it won't break something:)
>
> > I don't know why I have never hit this.
> > Maybe because I am not running with multi section config or
> > because I am runing with kvm-xfstests runner.
>
> Do you test overlay with XFS? For now, I think only xfs+overlay can reproduce
> this failure.
I only test xfs+overlay.
And Darrick also tests this regularly for xfs regression test,
so it must be a different way in which we invoke the test.
Thanks,
Amir.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-05-13 0:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12 17:56 [PATCH] common/overlay: source base fs specific common file Zorro Lang
2022-05-12 18:11 ` Amir Goldstein
2022-05-12 18:29 ` Zorro Lang
2022-05-13 0:54 ` Amir Goldstein
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.