All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Zorro Lang <zlang@redhat.com>, fstests <fstests@vger.kernel.org>,
	"Darrick J. Wong" <darrick.wong@oracle.com>
Subject: Re: [PATCH] generic/411: change sub-path name that's duplicate of TEST_DIR
Date: Thu, 9 Mar 2017 17:59:38 +0800	[thread overview]
Message-ID: <20170309095938.GJ14226@eguan.usersys.redhat.com> (raw)
In-Reply-To: <CAOQ4uxiJKouz9c=91Odd1CsrmkiKcnFuQT1r2V1Fa+UuOm9fxw@mail.gmail.com>

On Wed, Mar 08, 2017 at 04:26:22PM +0200, Amir Goldstein wrote:

[snip]

> From f365bd5d60d9d5b82e02db17e615380bf37a74de Mon Sep 17 00:00:00 2001
> From: Amir Goldstein <amir73il@gmail.com>
> Date: Wed, 8 Mar 2017 12:38:22 +0200
> Subject: [PATCH] filter: match $TEST_* $SCRATCH_* in beginning of path string
> 
> For example, if $TEST_DIR=/mnt, only replace instacnes of /mnt that
> are in the beginning of a path string, e.g.:
> 
> "/mnt/mntA/mntB:/mnt/mntC" => "TEST_DIR/mntA/mntB:TEST_DIR/mntC"
> 
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>

I'm testing this patch now, with the following config:

TEST_DEV=/dev/vda5
TEST_DIR=/vda5
SCRATCH_DEV=/dev/vda6
SCRATCH_MNT=/vda6
FSTYP=xfs
MKFS_OPTIONS="-m crc=1,reflink=1"

First I run this test on xfs, and everything went well. Then I ran test
with -overlay option, and found generic/171 generic/172 in this order
confused _check_mounted_on().

./check -overlay generic/17[1-2]

I got this diff

--- tests/generic/172.out       2016-12-30 14:13:24.076000000 +0800
+++ /root/xfstests/results//xfs_4k_reflink/generic/172.out.bad  2017-03-09 17:27:12.203000000 +0800
@@ -1,9 +1,4 @@
 QA output created by 172
-Format and mount
-Reformat with appropriate size
-Create a big file and reflink it
-Allocate the rest of the space
-CoW the big file
-pwrite: No space left on device
-Remount and try CoW again
-pwrite: No space left on device
+SCRATCH_DEV=/vda6 is mounted but not on SCRATCH_MNT=/vda6/ovl-mnt - aborting
+Already mounted result:
+/dev/vda6 on /vda6 type xfs (rw,relatime,context=system_u:object_r:nfs_t:s0,attr2,inode64,noquota)

Seems the 'grep -F "$dev on ' check isn't that accurate either. This
also happens without this patch.

I'm trying a draft patch like below, this seems to fix the problem for
me, and it works for NFS too (both ipv4 and ipv6). I'm testing your
patch + my local fix now.  Will see how it goes, if everything goes well
I'll post it as a seperate patch.

diff --git a/common/rc b/common/rc
index 109325d..e3169d5 100644
--- a/common/rc
+++ b/common/rc
@@ -1440,11 +1440,13 @@ _check_mounted_on()
        # IPv6 server as a regular expression.  Because of that, we cannot use
        # ^$dev so we use "$dev on " to avoid matching $dev to mount point field
        # for overlay case, where $dev is a directory.
-       local mount_rec=`_mount | grep -F "$dev on "`
+#      local mount_rec=`_mount | grep -F "$dev on "`
+       local mount_rec=`findmnt -rnc -S $dev -o SOURCE,TARGET`
        [ -n "$mount_rec" ] || return 1 # 1 = not mounted

        # if it's mounted, make sure its on $mnt
-       if ! (echo $mount_rec | grep -q "$dev on $mnt")
+#      if ! (echo $mount_rec | grep -q "$dev on $mnt")
+       if ! (echo $mount_rec | grep -Fq "$dev $mnt")
        then
                echo "$devname=$dev is mounted but not on $mntname=$mnt - aborti
                echo "Already mounted result:"

I paste it here to see if you have any early comments :)

Thanks,
Eryu

  parent reply	other threads:[~2017-03-09  9:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08  7:26 [PATCH] generic/411: change sub-path name that's duplicate of TEST_DIR Zorro Lang
2017-03-08 10:01 ` Amir Goldstein
2017-03-08 11:51   ` Eryu Guan
2017-03-08 14:26     ` Amir Goldstein
2017-03-08 14:59       ` Zorro Lang
2017-03-08 16:32         ` Amir Goldstein
2017-03-09  3:11       ` Eryu Guan
2017-03-09  9:59       ` Eryu Guan [this message]
2017-03-09 11:28         ` Amir Goldstein
2017-03-09 13:16           ` Amir Goldstein
2017-03-10  3:52             ` Eryu Guan
2017-03-10  6:57               ` Eryu Guan
2017-03-10  7:44                 ` Amir Goldstein
2017-03-08 13:15   ` Zorro Lang

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=20170309095938.GJ14226@eguan.usersys.redhat.com \
    --to=eguan@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=zlang@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
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.