On Mon, Jun 17, 2024 at 03:06:54PM GMT, Zorro Lang wrote: > On Fri, Jun 14, 2024 at 06:17:25AM +0000, Daniel Gomez wrote: > > Add support for test device recreation (RECREATE_TEST_DEV=true) for > > tmpfs. This allows to inherit the tmpfs profile extra mount options > > (TMPFS_MOUNT_OPTIONS) for the test device. > > > > Signed-off-by: Daniel Gomez <da.gomez@xxxxxxxxxxx> > > --- > > common/rc | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/common/rc b/common/rc > > index 163041fea..7f995b0fa 100644 > > --- a/common/rc > > +++ b/common/rc > > @@ -457,7 +457,7 @@ _test_mount() > > fi > > > > _test_options mount > > - _mount -t $FSTYP$FUSE_SUBTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $SELINUX_MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR > > + _mount -t $FSTYP$FUSE_SUBTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $SELINUX_MOUNT_OPTIONS $TMPFS_MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR > > We shouldn't use a FSTYP specific parameter in a common mount line. > Better to set it in a "$FSTYP=tmpfs" branch. I notice that we set: > > tmpfs) > # We need to specify the size at mount, use 1G by default > echo "-o size=1G $TMPFS_MOUNT_OPTIONS" > > in _common_mount_opts(). Then it will be set in MOUNT_OPTIONS and > TEST_FS_MOUNT_OPTS, won't that help? No for the recreation path with specific section variables as we have not yet source '. common/rc'. Dropping changes in _test_mount() and force reading test mount options makes $TMPFS_MOUNT_OPTION available for the test in the recreation path. diff --git a/check b/check index 723a52e30..b3f7d7b14 100755 --- a/check +++ b/check @@ -773,6 +773,7 @@ function run_section() status=1 exit fi + _test_mount_opts if ! _test_mount then echo "check: failed to mount $TEST_DEV on $TEST_DIR" I understand from Darrick's comment that the change above in _test_mount() is wrong. Would this solution be okay? Not sure if this is a bug but I'd guess all specific mount options are now ignored in the recreation path (not only tmpfs). > > Thanks, > Zorro > > > > mount_ret=$? > > [ $mount_ret -ne 0 ] && return $mount_ret > > _idmapped_mount $TEST_DEV $TEST_DIR > > @@ -604,6 +604,9 @@ _test_mkfs() > > pvfs2) > > # do nothing for pvfs2 > > ;; > > + tmpfs) > > + # do nothing for tmpfs > > + ;; > > udf) > > $MKFS_UDF_PROG $MKFS_OPTIONS $* $TEST_DEV > /dev/null > > ;; > > -- > > 2.43.0 > > >