From: Eryu Guan <eguan@redhat.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
linux-unionfs@vger.kernel.org, fstests <fstests@vger.kernel.org>
Subject: Re: [PATCH v3 6/9] overlay: configure TEST/SCRATCH vars to base fs
Date: Tue, 14 Feb 2017 19:03:15 +0800 [thread overview]
Message-ID: <20170214110315.GN24562@eguan.usersys.redhat.com> (raw)
In-Reply-To: <CAOQ4uxjgGN5zxv-AG4qnz+46M9+JK8AaU+-1m4DTfx=YDTPc=w@mail.gmail.com>
On Mon, Feb 13, 2017 at 10:31:30PM +0200, Amir Goldstein wrote:
> On Mon, Feb 13, 2017 at 1:28 PM, Eryu Guan <eguan@redhat.com> wrote:
> > On Sun, Feb 12, 2017 at 10:43:41PM +0200, Amir Goldstein wrote:
> >> Instead of setting the vars TEST/SCRATCH_DEV to overlay base dirs,
> >> allow setting them to block devices to configure the base fs partition,
> >> where overlay dirs will be created.
> >>
> >> For example, the following config file can be used to run tests on
> >> xfs test/scratch partitions:
> >>
> >> TEST_DEV=/dev/sda5
> >> TEST_DIR=/mnt/test
> >> SCRATCH_DEV=/dev/sda6
> >> SCRATCH_MNT=/mnt/scratch
> >> FSTYP=xfs
> >>
> >> Using the same config file, but executing './check -overlay' will
> >> use the same partitions as base fs for overlayfs directories
> >> and set TEST_DIR/SCRATCH_MNT values to overlay mount points, i.e.:
> >> /mnt/test/ovl-mnt and /mnt/scratch/ovl-mnt.
> >>
> >> The base fs should be pre-formatted and mounted when starting the test.
> >> An upcoming change is going to support mount/umount of base fs.
> >>
> >> The new OVL_BASE_SCRATCH/TEST_* vars are set to point at the
> >> overlayfs base dirs in either legacy or new config method.
> >> Tests should always use these vars and not the legacy SCRATCH/TEST_DEV
> >> vars when referring to overlay base dir.
> >>
> >> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> >> ---
> ...
> >>
> >> # Parse config section options. This function will parse all the configuration
> >> @@ -516,6 +574,15 @@ get_next_config() {
> >> unset SCRATCH_DEV
> >> fi
> >>
> >> + # We might have overriden TEST/SCRATCH vars with overlay base dir in the
> >> + # previous run, so restore them to original values stored in OVL_BASE_*
> >> + if [ "$FSTYP" == "overlay" ]; then
> >> + [ -z "$OVL_BASE_TEST_DEV" ] || export TEST_DEV=$OVL_BASE_TEST_DEV
> >> + [ -z "$OVL_BASE_TEST_DIR" ] || export TEST_DIR=$OVL_BASE_TEST_DIR
> >> + [ -z "$OVL_BASE_SCRATCH_DEV" ] || export SCRATCH_DEV=$OVL_BASE_SCRATCH_DEV
> >> + [ -z "$OVL_BASE_SCRATCH_MNT" ] || export SCRATCH_MNT=$OVL_BASE_SCRATCH_MNT
> >> + fi
> >> +
> >> parse_config_section $1
> >>
> >> if [ ! -z "$OLD_FSTYP" ] && [ $OLD_FSTYP != $FSTYP ]; then
> >> @@ -544,6 +611,12 @@ get_next_config() {
> >> export RESULT_BASE="$here/results/"
> >> fi
> >>
> >> + # Override FSTYP from config when running ./check -overlay
> >> + # and maybe derive overlay TEST/SCRATCH from base fs values
> >> + if [ "$OVERLAY" == "true" -o "$FSTYP" == "overlay" ]; then
> >> + _config_overlay
> >> + fi
> >> +
> >
> > If I have SCRATCH_DEV_POOL defined, e.g.
> >
> > TEST_DEV=/dev/sda5
> > TEST_DIR=/mnt/testarea/test
> > SCRATCH_DEV_POOL="/dev/sda6 /dev/sda7"
> > SCRATCH_MNT=/mnt/testarea/scratch
> >
> > I got error like:
> >
> > [root@dhcp-66-86-11 xfstests]# ./check -overlay overlay/002
> > common/config: SCRATCH_DEV (/dev/sda6) is not a directory for overlay
> >
> > Because we obtain SCRATCH_DEV from SCRATCH_DEV_POOL after we call
> > _config_overlay, and SCRATCH_DEV is not set when configing overlay, so
> > SCRATCH_DEV stays as a block device and fails _check_device.
> >
> > Moving the SCRATCH_DEV_POOL handling just after "unset SCRATCH_DEV"
> > fixes this problem for me.
Seems this only works for multi-section config, not standalone
local.config file..
> >
>
> Right, I didn't test this setup. It appears to me that SCRATCH_DEV_POOL handling
> should be *after* parse_config_section for multi section config, where
> SCRATCH_DEV_POOL is assigned a new value in current section??
I set SCRATCH_DEV_POOL as a default var, so it's inherited by all
sections.
>
> Can you check if SCRATCH_DEV_POOL handling could be moved right before
> _config_overlay?
No, test results show that it should be before restoring TEST_DEV/DIR
etc. from previous run, this hunk:
# We might have overriden TEST/SCRATCH vars with overlay base dir in the
# previous run, so restore them to original values stored in OVL_BASE_*
if [ "$FSTYP" == "overlay" ]; then
...
>
> I'm not really sure how that configuration should be working with
> overlay anyway.
In general, I think SCRATCH_DEV_POOL should be handled just after
reading in configs, as what you said. But multi-section config (maybe
and the new overlayfs config) makes things more complex, and my brain
stops working today..
Thanks,
Eryu
next prev parent reply other threads:[~2017-02-14 11:03 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-12 20:43 [PATCH v3 0/9] fstests: new way to run overlay tests Amir Goldstein
2017-02-12 20:43 ` [PATCH v3 1/9] fstests: sanity check that test partitions are not mounted elsewhere Amir Goldstein
2017-02-13 11:10 ` Eryu Guan
2017-02-13 11:44 ` Amir Goldstein
2017-02-13 13:33 ` Amir Goldstein
2017-02-14 5:51 ` Eryu Guan
2017-02-14 6:02 ` Amir Goldstein
2017-02-14 7:23 ` Eryu Guan
2017-02-14 8:05 ` Amir Goldstein
2017-02-16 8:53 ` Amir Goldstein
2017-02-12 20:43 ` [PATCH v3 2/9] fstests: use _test_mount() consistently Amir Goldstein
2017-02-13 11:17 ` Eryu Guan
2017-02-12 20:43 ` [PATCH v3 3/9] fstests: canonicalize mount points on every config section Amir Goldstein
2017-02-12 20:43 ` [PATCH v3 4/9] overlay: rename OVERLAY_LOWER/UPPER/WORK_DIR Amir Goldstein
2017-02-12 20:43 ` [PATCH v3 5/9] overlay: allow SCRATCH_DEV to be the base fs mount point Amir Goldstein
2017-02-12 20:43 ` [PATCH v3 6/9] overlay: configure TEST/SCRATCH vars to base fs Amir Goldstein
2017-02-13 11:28 ` Eryu Guan
2017-02-13 20:31 ` Amir Goldstein
2017-02-14 11:03 ` Eryu Guan [this message]
2017-02-15 14:59 ` Amir Goldstein
2017-02-12 20:43 ` [PATCH v3 7/9] overlay: use OVL_BASE_SCRATCH_MNT instead of SCRATCH_DEV Amir Goldstein
2017-02-12 20:43 ` [PATCH v3 8/9] overlay: fix test and scratch filters for overlay base fs Amir Goldstein
2017-02-13 20:39 ` Amir Goldstein
2017-02-12 20:43 ` [PATCH v3 9/9] overlay: mount/unmount base fs before/after running tests Amir Goldstein
2017-02-13 11:31 ` Eryu Guan
2017-02-13 11:59 ` Amir Goldstein
2017-02-14 0:23 ` Theodore Ts'o
2017-02-14 5:24 ` Eryu Guan
2017-02-14 6:43 ` Amir Goldstein
2017-02-14 17:07 ` Theodore Ts'o
2017-02-14 17:55 ` Amir Goldstein
2017-02-16 8:50 ` Amir Goldstein
2017-02-12 20:51 ` [PATCH v3 0/9] fstests: new way to run overlay tests Amir Goldstein
2017-02-13 4:19 ` Xiong Zhou
2017-02-13 5:37 ` Amir Goldstein
2017-02-14 4:40 ` Xiong Zhou
2017-02-14 6:15 ` Amir Goldstein
2017-02-14 9:25 ` Xiong Zhou
2017-02-14 9:51 ` Amir Goldstein
2017-02-13 11:02 ` Eryu Guan
2017-02-16 9:02 ` Amir Goldstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170214110315.GN24562@eguan.usersys.redhat.com \
--to=eguan@redhat.com \
--cc=amir73il@gmail.com \
--cc=fstests@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox