($INBOX_DIR/description missing)
 help / color / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Mauricio Faria de Oliveira <mfo@canonical.com>
Cc: fstests <fstests@vger.kernel.org>,
	overlayfs <linux-unionfs@vger.kernel.org>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [PATCH v2 4/5] common/rc: add quirks for fuse-overlayfs device/mount point
Date: Sat, 15 Feb 2020 00:37:47 +0200
Message-ID: <CAOQ4uxj9+BDv5DCcioUCTXhv9_32t5L+spBn8_2n+QKkjQ6nGA@mail.gmail.com> (raw)
In-Reply-To: <20200214151848.8328-5-mfo@canonical.com>

On Fri, Feb 14, 2020 at 5:18 PM Mauricio Faria de Oliveira
<mfo@canonical.com> wrote:
>
> 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
> +

I guess if we have to do the quirk then we better do it before the
first findmnt.
I don't see the point of trying the first time.

But I wonder, how come this is not also problem for virtiofs?
Maybe there is a way to make fuse fsname mount option work
instead of these quirks?

>         [ -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`" ]

Somewhat simplified:
       elif [ "$OVL_FSTYP" = "fuse.fuse-overlayfs" -a \
               -n "`_fs_type_dev_dir fuse-overlayfs $TEST_DIR`" ]


Thanks,
Amir.

  parent reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200214151848.8328-1-mfo@canonical.com>
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
     [not found] ` <20200214151848.8328-2-mfo@canonical.com>
2020-02-14 22:06   ` [PATCH v2 1/5] common/overlay,rc,config: introduce OVL_FSTYP variable and aufs Amir Goldstein
     [not found] ` <20200214151848.8328-4-mfo@canonical.com>
2020-02-14 22:20   ` [PATCH v2 3/5] common/rc: introduce new helper function _fs_type_dev_dir() Amir Goldstein
     [not found] ` <20200214151848.8328-5-mfo@canonical.com>
2020-02-14 22:37   ` Amir Goldstein [this message]
     [not found] ` <20200214151848.8328-6-mfo@canonical.com>
2020-02-14 22:51   ` [PATCH v2 5/5] common/overlay: silence some mount messages for fuse-overlayfs 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=CAOQ4uxj9+BDv5DCcioUCTXhv9_32t5L+spBn8_2n+QKkjQ6nGA@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=mfo@canonical.com \
    --cc=miklos@szeredi.hu \
    --cc=vgoyal@redhat.com \
    /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

($INBOX_DIR/description missing)

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-unionfs/0 linux-unionfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-unionfs linux-unionfs/ https://lore.kernel.org/linux-unionfs \
		linux-unionfs@vger.kernel.org
	public-inbox-index linux-unionfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-unionfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git