All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Eryu Guan <eguan@redhat.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	linux-unionfs@vger.kernel.org, fstests <fstests@vger.kernel.org>
Subject: Re: [PATCH v3 9/9] overlay: mount/unmount base fs before/after running tests
Date: Mon, 13 Feb 2017 13:59:37 +0200	[thread overview]
Message-ID: <CAOQ4uxgEayyD_wVzqz+Z8h-Ee2n_nrPPrfDxrStmOkbig+XNNQ@mail.gmail.com> (raw)
In-Reply-To: <20170213113138.GI24562@eguan.usersys.redhat.com>

On Mon, Feb 13, 2017 at 1:31 PM, Eryu Guan <eguan@redhat.com> wrote:
> On Sun, Feb 12, 2017 at 10:43:44PM +0200, Amir Goldstein wrote:
>> When TEST/SCRATCH_DEV are configured to the base fs block device,
>> use this information to mount base fs before running tests,
>> unmount it after running tests and cycle on _test_cycle_mount
>> along with the overlay mounts.
>>
>> This helps catching overlayfs bugs related to leaking objects in
>> underlying (base) fs.
>>
>> To preserve expected tests behavior, the semantics are:
>> - _scratch_mkfs mounts the base fs, cleans all files, creates
>>   lower/upper dirs and keeps base fs mounted
>> - _scratch_mount mounts base fs (if needed) and mounts overlay
>> - _scratch_unmount unmounts overlay and base fs
>>
>> Tests that use _scratch_unmount to unmount a custom overlay mount
>> and expect to have access to overlay base dir, were fixed to use
>> explicit umount $SCRATCH_MNT instead.
>>
>> The overlay test itself, does not support formatting the base fs.
>> However, it is possible to add overlay sections to a multi section
>> config file after every base fs configuration, to run the overlay
>> tests with the file system that was created on the test partitions
>> in the previous section (see example in README.config-sections).
>>
>> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
>> ---
>>  README.config-sections |  6 ++++++
>>  common/rc              | 55 ++++++++++++++++++++++++++++++++++++++++++++++++--
>>  tests/overlay/003      |  3 ++-
>>  tests/overlay/004      |  3 ++-
>>  tests/overlay/014      |  5 +++--
>>  5 files changed, 66 insertions(+), 6 deletions(-)
>>
>> diff --git a/README.config-sections b/README.config-sections
>> index df7c929..d45d6da 100644
>> --- a/README.config-sections
>> +++ b/README.config-sections
>> @@ -102,6 +102,9 @@ MKFS_OPTIONS="-q -F -b4096"
>>  FSTYP=ext4
>>  RESULT_BASE="`pwd`/results/`date +%d%m%y_%H%M%S`"
>>
>> +[ext4_overlay]
>> +FSTYP=overlay
>> +
>>  [ext4_1k_block_size]
>>  MKFS_OPTIONS="-q -F -b1024"
>>
>> @@ -112,6 +115,9 @@ MKFS_OPTIONS="-q -F -b4096 -O ^has_journal"
>>  MKFS_OPTIONS="-f"
>>  FSTYP=xfs
>>
>> +[xfs_overlay]
>> +FSTYP=overlay
>> +
>>  [ext3_filesystem]
>>  FSTYP=ext3
>>  MOUNT_OPTIONS="-o noatime"
>> diff --git a/common/rc b/common/rc
>> index 74168ea..e9ac0df 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -328,24 +328,70 @@ _overlay_mount()
>>                           $SELINUX_MOUNT_OPTIONS $* $dir $mnt
>>  }
>>
>> +_overlay_base_test_mount()
>> +{
>> +     if [ -z "$OVL_BASE_TEST_DEV" -o -z "$OVL_BASE_TEST_DIR" ] || \
>> +             _check_mounted_on OVL_BASE_TEST_DEV $OVL_BASE_TEST_DEV \
>> +                             OVL_BASE_TEST_DIR $OVL_BASE_TEST_DIR
>> +     then
>> +             return 0
>> +     fi
>> +
>> +     _mount $OVL_BASE_MOUNT_OPTIONS \
>
> OVL_BASE_MOUNT_OPTIONS is from MOUNT_OPTIONS, which is used for scratch
> mount. Do we need a ovl base counter part of TEST_FS_MOUNT_OPTS?
>

I suggest that we change this line to:
+     _mount $TEST_FS_MOUNT_OPTS \

MOUNT_OPTIONS in config is used for base scratch mount options
TEST_FS_MOUNT_OPTS in config is used for base test mount options.
OVERLAY_MOUNT_OPTIONS in config is used for both scratch and test overlay mounts

The only case where TEST_FS_MOUNT_OPTS is configured not by user is
for cifs and cheph (in _test_mount_opts) and I don't think that those fs
can be used as overlay base fs. can they?

Good enough?

  reply	other threads:[~2017-02-13 11:59 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
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 [this message]
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=CAOQ4uxgEayyD_wVzqz+Z8h-Ee2n_nrPPrfDxrStmOkbig+XNNQ@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=eguan@redhat.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 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.