From: Mauricio Faria de Oliveira <mfo@canonical.com>
To: fstests@vger.kernel.org
Cc: Amir Goldstein <amir73il@gmail.com>
Subject: [PATCH v2 4/5] common/rc: add quirks for fuse-overlayfs device/mount point
Date: Fri, 14 Feb 2020 12:18:47 -0300 [thread overview]
Message-ID: <20200214151848.8328-5-mfo@canonical.com> (raw)
In-Reply-To: <20200214151848.8328-1-mfo@canonical.com>
On fuse-overlayfs the mount device is always reported as
a "fuse-overlayfs" string, instead of the parent directory
of the mount point (the string expected by overlay/scripts).
Unfortunately, it seems that the fuse mount option 'fsname'
doesn't set the filesystem source/device on fuse-overlayfs,
so the easy fix of just adding it to mount options is gone.
So two quirks are used to check for a fuse-overlayfs mount,
that checks the mount point/directory in _check_mounted_on()
and init_rc(); latter with the new helper _fs_type_dev_dir().
With this, fuse-overlayfs can now keep going through tests!
Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
---
README.overlay | 1 +
common/rc | 19 ++++++++++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/README.overlay b/README.overlay
index 08a39b8830c9..7ef07ae6bbab 100644
--- a/README.overlay
+++ b/README.overlay
@@ -53,4 +53,5 @@ OVERLAY_FSCK_OPTIONS will be used to check both test and scratch overlay.
To test other filesystem types (experimental) configure the OVL_FSTYP variable:
+ OVL_FSTYP=fuse.fuse-overlayfs
OVL_FSTYP=aufs
diff --git a/common/rc b/common/rc
index 5711eca2a1d2..6a4cb9b6d604 100644
--- a/common/rc
+++ b/common/rc
@@ -1481,6 +1481,14 @@ _check_mounted_on()
# find $dev as the source, and print result in "$dev $mnt" format
local mount_rec=`findmnt -rncv -S $dev -o SOURCE,TARGET`
+
+ # fuse-overlayfs dev is not $dev, check via $mnt.
+ if [ -z "$mount_rec" -a "$FSTYP" = "overlay" -a \
+ "$OVL_FSTYP" = "fuse.fuse-overlayfs" ]; then
+ dev="fuse-overlayfs"
+ mount_rec=`findmnt -rncv -S $dev -T $mnt -o SOURCE,TARGET`
+ fi
+
[ -n "$mount_rec" ] || return 1 # 1 = not mounted
# if it's mounted, make sure its on $mnt
@@ -3788,8 +3796,17 @@ init_rc()
fi
# if $TEST_DEV is not mounted, mount it now as XFS
- if [ -z "`_fs_type $TEST_DEV`" ]
+ if [ -n "`_fs_type $TEST_DEV`" ]
then
+ # $TEST_DEV is mounted
+ true
+ elif [ "$FSTYP" = "overlay" -a "$OVL_FSTYP" = "fuse.fuse-overlayfs" -a \
+ -n "`_fs_type_dev_dir fuse-overlayfs $TEST_DEV/$OVL_MNT`" ]
+ then
+ # (fuse-overlayfs dev is not $TEST_DEV; check via mount point)
+ # $TEST_DEV is mounted
+ true
+ else
# $TEST_DEV is not mounted
if ! _test_mount
then
--
2.20.1
next prev parent reply other threads:[~2020-02-14 15:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-14 15:18 [PATCH v2 0/5] fstests: overlay: initial support for aufs and Mauricio Faria de Oliveira
2020-02-14 15:18 ` [PATCH v2 1/5] common/overlay,rc,config: introduce OVL_FSTYP variable and aufs Mauricio Faria de Oliveira
2020-02-14 22:06 ` Amir Goldstein
2020-02-14 15:18 ` [PATCH v2 2/5] tests/overlay: mount: replace overlay hardcode with OVL_FSTYP variable Mauricio Faria de Oliveira
2020-02-14 22:12 ` Amir Goldstein
2020-02-14 15:18 ` [PATCH v2 3/5] common/rc: introduce new helper function _fs_type_dev_dir() Mauricio Faria de Oliveira
2020-02-14 22:20 ` Amir Goldstein
2020-02-14 15:18 ` Mauricio Faria de Oliveira [this message]
2020-02-14 22:37 ` [PATCH v2 4/5] common/rc: add quirks for fuse-overlayfs device/mount point Amir Goldstein
2020-02-14 15:18 ` [PATCH v2 5/5] common/overlay: silence some mount messages for fuse-overlayfs Mauricio Faria de Oliveira
2020-02-14 22:51 ` Amir Goldstein
2020-02-14 18:45 ` [PATCH v2 0/5] fstests: overlay: initial support for aufs and Amir Goldstein
2020-02-17 15:44 ` Mauricio Faria de Oliveira
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=20200214151848.8328-5-mfo@canonical.com \
--to=mfo@canonical.com \
--cc=amir73il@gmail.com \
--cc=fstests@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).