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 11:11:54 +0800	[thread overview]
Message-ID: <20170309031154.GG14226@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:
> On Wed, Mar 8, 2017 at 1:51 PM, Eryu Guan <eguan@redhat.com> wrote:
> > On Wed, Mar 08, 2017 at 12:01:33PM +0200, Amir Goldstein wrote:
> >> On Wed, Mar 8, 2017 at 9:26 AM, Zorro Lang <zlang@redhat.com> wrote:
> >> > Darrick found generic/411 golden output mismatch if use
> >> > TEST_DIR=/mnt. Because g/411 use some test path named
> >> > /mnt/XXXX/mnt1/mnt2, _filter_test_dir will replace all
> >> > "/mnt" things to "TEST_DIR".
> >> >
> >> > For stop this failure, change all directory names to be
> >> > "$seq-XXX", that's less likely to be mistaken for TEST_*
> >> > and SCRATCH_*.
> >> >
> >>
> >> Although you have a right to choose whichever names you
> >> want top use for your test, this is papering over a bug.
> >>
> >> I re-read the docuemtnation for \B:
> >> http://www.rexegg.com/regex-boundaries.html#bengines
> >>
> >> To my understanding, the expression "\B$TEST_DIR" will
> >> match every instance of $TEST_DIR, where preceding character
> >> is NOT a letter, number or underscore.
> >> This is because $TEST_DIR must start with '/', which is not
> >> a letter, number or underscore.
> >>
> >> I think it should be safe to fix _filter_test_dir and _filter_scratch.
> >
> > I agreed, according to the document above, \B matches all positions
> > where \b doesn't match. And \b matches positions where "one side is a
> > word character and the other side is not", so \B matches "neither side
> > is a word character" and "both sides are a word character".
> >
> > This is also because we canonicalized all mount points, there's no path
> > like //mnt/mnt1 is allowed in fstests. And this leads me to wonder if we
> > should canonicalize all test devices (if they're block device), to avoid
> > something like //dev/sda5? The double "/" will break the \B match.
> >
> 
> //dev/sda5 does to break \B match.
> \B$TEST_DEV match, as you wrote, means that character before
> $TEST_DEV *is not* a word character, because $TEST_DEV begins
> with a non-word character. it doesn't matter the the second character
> is a non-word as well.
> 
> Attached a patch that I tested -g quick on xfs and overlayfs
> and did not see any regressions, but you better test it with a wider
> variety of fs types and a larger group of tests.

Sure, I'll give it more tests. Thanks!

> 
> > Further more, if we decide to use \B to improve _filter_test_dir and
> > _filter_scratch, it appears to me that the fix from commit 4e965d8
> > ("fstests: fix test and scratch filters for overlapping DEV/MNT paths")
> > can be discarded, the order is not a problem anymore.
> >
> 
> Well, not exactly.
> 
> The case that commit 4e965d8 fixes is:
> TEST_DEV=/mnt
> TEST_DIR=/mnt/ovl-mnt
> 
> So \B$TEST_DEV will still match the prefix of $TEST_DIR and this is
> wrong.

You're right, I missed that.

Thanks,
Eryu

  parent reply	other threads:[~2017-03-09  3:38 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 [this message]
2017-03-09  9:59       ` Eryu Guan
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=20170309031154.GG14226@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.