Re: [PATCH 2/2] Configure custom layers via environment variables

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

 



On Wed, Apr 15, 2020 at 10:42 PM Vivek Goyal <vgoyal@xxxxxxxxxx> wrote:
>
> On Wed, Apr 15, 2020 at 07:27:43PM +0300, Amir Goldstein wrote:
> > On Wed, Apr 15, 2020 at 6:30 PM Vivek Goyal <vgoyal@xxxxxxxxxx> wrote:
> > >
> > > On Wed, Apr 15, 2020 at 03:01:34PM +0300, Amir Goldstein wrote:
> > > > The following environment variables are supported:
> > > >
> > > >  UNIONMOUNT_BASEDIR  - base dir for --samefs (default: /base)
> > > >  UNIONMOUNT_UPPERDIR - upper layer root path (default: /upper)
> > > >  UNIONMOUNT_LOWERDIR - lower layer root path (default: /lower)
> > > >  UNIONMOUNT_MNTPOINT - mount point for tests (default: /mnt)
> > > >
> > > > User provided paths for base/lower/upper should point at a pre-mounted
> > > > filesystem, whereas tmpfs instances will be created on default paths.
> > > >
> > > > This is going to be used for running unionmount tests from xfstests.
> > >
> > > Hi Amir,
> > >
> > > I don't understand this testsuite code. So I will ask.
> > >
> > > What's base dir?
> >
> > Before these changes, with option --samefs, tmpfs is mounted
> > at /base, overlay lowerdir is /base/lower and upperdir is /base/upper.
> > After these changes, /base can be substituted with any pre mounted
> > filesystem path.
>
> If I can specify lower and upper root, then why do I need to specify
> base directory. User can put lower, upper either on samefs or different
> fs as need be.
>
> IOW, either I need to specify base dir, so that lower and upper can
> be setup by testsuite automatically. Or I need to specify lower and
> upper and then base should not matter.
>
> What am I missing.
>

Not much, as it stands, with option --samefs, UNIONMOUNT_BASEDIR
is used and without --samefs UNIONMOUNT_LOWERDIR and
UNIONMOUNT_UPPERDIR used instead.

I agree that this a bit lame and non intuitive way to configure.
The reason for explicit --samefs option (vs. providing upper and lower
root from same fs) is, again, for the test sanity checks which differ
for is_samefs() case.

I think what I will do is I will get rid of UNIONMOUNT_UPPERDIR
because this name is a bit confusing. It is not the overlay upperdir,
it is the grandfather of upperdir/workdir. So I might as well call
this config UNIONMOUNT_BASEDIR and use it also as the parent
of lowerdir in --samefs tests.

The config UNIONMOUNT_LOWERDIR will remain, but it will only
be relevant to tests without --samefs.

IOW, you won't need the fstab bind mount trick and you won't need
to use the magic suffix "lower_layer" anymore. You could set:
  UNIONMOUNT_BASEDIR=/mnt/virtiofs

to run --ov --samefs --verify tests.

If you want to run test with virtio fs as upper (single or multi layers)
and lower as another fs, you could additionally set:
  UNIONMOUNT_LOWERDIR=/mnt/anotherfs

and run --ov --verify tests.

Thanks for the feedback!
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