All of lore.kernel.org
 help / color / mirror / Atom feed
* xfstests mount options?
@ 2016-10-24 18:46 Eric Biggers
  2016-10-26  9:47 ` Eryu Guan
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Biggers @ 2016-10-24 18:46 UTC (permalink / raw)
  To: fstests

Hi,

When starting xfstests without $TEST_DEV mounted, it mounts it using this
command in _test_mount, called from init_rc:

    _mount -t $FSTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $SELINUX_MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR

This is also used by _test_cycle_mount, which some tests use.

This is inconsistent with the later code in _check_generic_filesystem, called
after each test, which remounts $TEST_DEV:

    _mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint

It is possible to have mount options in $MOUNT_OPTIONS which then are *not*
included in the options that _test_mount uses.

$TEST_FS_MOUNT_OPTS is also very strange in that it only appears to ever be set
when testing CIFS.

Which version of the test device mount options is correct?  Is it documented
anywhere what is the correct way to configure the mount options used by
xfstests?

Thanks,

Eric

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xfstests mount options?
  2016-10-24 18:46 xfstests mount options? Eric Biggers
@ 2016-10-26  9:47 ` Eryu Guan
  2016-10-27  0:46   ` Dave Chinner
  0 siblings, 1 reply; 3+ messages in thread
From: Eryu Guan @ 2016-10-26  9:47 UTC (permalink / raw)
  To: Eric Biggers; +Cc: fstests

On Mon, Oct 24, 2016 at 11:46:11AM -0700, Eric Biggers wrote:
> Hi,
> 
> When starting xfstests without $TEST_DEV mounted, it mounts it using this
> command in _test_mount, called from init_rc:
> 
>     _mount -t $FSTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $SELINUX_MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR

In my understanding, TEST_FS_MOUNT_OPTS is used for TEST_DEV, as
MOUNT_OPTIONS is used for SCRATCH_DEV.

Looking through the git history, TEST_FS_MOUNT_OPTS was introduced by
commit ab526a6 in 2006 without any documents. It replaced MOUNT_OPTIONS
in _test_mount(). So I think its intention is used as mount options for
TEST_DEV.

> 
> This is also used by _test_cycle_mount, which some tests use.
> 
> This is inconsistent with the later code in _check_generic_filesystem, called
> after each test, which remounts $TEST_DEV:
> 
>     _mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint

_check_generic_filesystem is used in both _check_test_fs() and
_check_scratch_fs(), I think it should use different mount options based
on which device it's checking, not use MOUNT_OPTIONS always.

And there's another inconsistency in _require_test()

	out=`_mount_or_remount_rw "$MOUNT_OPTIONS" $TEST_DEV $TEST_DIR`

We should use TEST_FS_MOUNT_OPTS here, because we know we're working on
TEST_DEV in this function.

> 
> It is possible to have mount options in $MOUNT_OPTIONS which then are *not*
> included in the options that _test_mount uses.
> 
> $TEST_FS_MOUNT_OPTS is also very strange in that it only appears to ever be set
> when testing CIFS.

Only CIFS set both TEST_FS_MOUNT_OPTS and MOUNT_OPTIONS to
CIFS_MOUNT_OPTIONS, that means for cifs it's not possible to use
different mount options for TEST_DEV and SCRATCH_DEV if you have
CIFS_MOUNT_OPTIONS set.

Thanks,
Eryu

> 
> Which version of the test device mount options is correct?  Is it documented
> anywhere what is the correct way to configure the mount options used by
> xfstests?
> 
> Thanks,
> 
> Eric
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xfstests mount options?
  2016-10-26  9:47 ` Eryu Guan
@ 2016-10-27  0:46   ` Dave Chinner
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2016-10-27  0:46 UTC (permalink / raw)
  To: Eryu Guan; +Cc: Eric Biggers, fstests

On Wed, Oct 26, 2016 at 05:47:24PM +0800, Eryu Guan wrote:
> On Mon, Oct 24, 2016 at 11:46:11AM -0700, Eric Biggers wrote:
> > Hi,
> > 
> > When starting xfstests without $TEST_DEV mounted, it mounts it using this
> > command in _test_mount, called from init_rc:
> > 
> >     _mount -t $FSTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $SELINUX_MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR
> 
> In my understanding, TEST_FS_MOUNT_OPTS is used for TEST_DEV, as
> MOUNT_OPTIONS is used for SCRATCH_DEV.
> 
> Looking through the git history, TEST_FS_MOUNT_OPTS was introduced by
> commit ab526a6 in 2006 without any documents. It replaced MOUNT_OPTIONS
> in _test_mount(). So I think its intention is used as mount options for
> TEST_DEV.

> 
> > 
> > This is also used by _test_cycle_mount, which some tests use.
> > 
> > This is inconsistent with the later code in _check_generic_filesystem, called
> > after each test, which remounts $TEST_DEV:
> > 
> >     _mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint
> 
> _check_generic_filesystem is used in both _check_test_fs() and
> _check_scratch_fs(), I think it should use different mount options based
> on which device it's checking, not use MOUNT_OPTIONS always.

Right - we have _scratch_mount_options() for returning the
configured mount options for a scratch device.  We should extract a
similar helper out of _test_mount(), and use them appropriately
where necessary.

i.e. nothing should really be using $MOUNT_OPTIONS or
$TEST_FS_MOUNT_OPTS directly - they should always get them from
the _scratch_mount_options/_test_mount_options functions...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-27  0:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-24 18:46 xfstests mount options? Eric Biggers
2016-10-26  9:47 ` Eryu Guan
2016-10-27  0:46   ` Dave Chinner

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.