public inbox for linux-unionfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3] xfstest: overlay: Absolute redirect should be followed even if ancestor is opaque
@ 2018-03-14 13:16 Vivek Goyal
  2018-03-14 20:19 ` Amir Goldstein
  2018-03-16  2:53 ` Eryu Guan
  0 siblings, 2 replies; 6+ messages in thread
From: Vivek Goyal @ 2018-03-14 13:16 UTC (permalink / raw)
  To: eguan, fstests, Amir Goldstein; +Cc: linux-unionfs, Miklos Szeredi

Typically, when following absolute redirect, if an opauqe dentry is
found, lookup in further lower directories is stopped. But if a
child dentry has another absolute redirect, then lookup in further
lower layers should continue.

Say, following is example setup.
upper:  /redirect (redirect=/a/b/c)
lower1: /a/[b]/c       ([b] is opaque) (c has absolute redirect=/a/b/d/)
lower0: /a/b/d/foo

"redirect" directory in upper should merge with lower1:/a/b/c/ and
lower0:/a/b/d/, despite lower1:/a/b/ being opaque.

This example and kernel fix has come from Amir Goldstein. I am just putting
a test for it to make sure its not broken down the line.

v3: Took care of more comments from amir.
    - Added some comments.
    - Added _overlay_check_scratch_dirs call.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
 tests/overlay/057     |  100 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/overlay/057.out |    2 +
 tests/overlay/group   |    1 
 3 files changed, 103 insertions(+)

Index: xfstests-dev/tests/overlay/057
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ xfstests-dev/tests/overlay/057	2018-03-14 09:10:00.577179042 -0400
@@ -0,0 +1,100 @@
+#! /bin/bash
+# FS QA Test No. 057
+#
+# Test absolute redirect is followed even if ancestor is opaque
+#
+# Typically, when following absolute redirect, if an opauqe dentry is
+# found, lookup in further lower directories is stopped. But if a
+# child dentry has another absolute redirect, then lookup in further
+# lower layers should continue.
+#
+# Say, following is example setup.
+# upper:  /redirect (redirect=/a/b/c)
+# lower1: /a/[b]/c       ([b] is opaque) (c has absolute redirect=/a/b/d/)
+# lower0: /a/b/d/foo
+#
+# "redirect" directory in upper should merge with lower1:/a/b/c/ and
+# lower0:/a/b/d/, despite lower1:/a/b/ being opaque.
+#
+#-----------------------------------------------------------------------
+# Copyright (C) 2018 Red Hat, Inc. All Rights Reserved.
+# Author: Vivek Goyal <vgoyal@redhat.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs overlay
+_supported_os Linux
+# We use non-default scratch underlying overlay dirs, we need to check
+# them explicity after test.
+_require_scratch_nocheck
+_require_scratch_overlay_features redirect_dir
+
+# remove all files from previous tests
+_scratch_mkfs
+
+# Create test directories
+lowerdir=$OVL_BASE_SCRATCH_MNT/lower
+lowerdir2=$OVL_BASE_SCRATCH_MNT/lower2
+upperdir=$OVL_BASE_SCRATCH_MNT/upper
+workdir=$OVL_BASE_SCRATCH_MNT/workdir
+workdir2=$OVL_BASE_SCRATCH_MNT/workdir2
+
+mkdir -p $lowerdir $lowerdir2 $upperdir $workdir $workdir2
+mkdir -p $lowerdir/origin
+touch $lowerdir/origin/foo
+_overlay_scratch_mount_dirs $lowerdir $lowerdir2 $workdir2 -o redirect_dir=on
+
+# Create opaque parent with absolute redirect child in middle layer
+mkdir $SCRATCH_MNT/pure
+mv $SCRATCH_MNT/origin $SCRATCH_MNT/pure/redirect
+$UMOUNT_PROG $SCRATCH_MNT
+_overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on
+mv $SCRATCH_MNT/pure/redirect $SCRATCH_MNT/redirect
+
+# Verify that redirects are followed after mount cycle
+$UMOUNT_PROG $SCRATCH_MNT
+_overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on
+ls $SCRATCH_MNT/redirect/
+
+# check overlayfs
+_overlay_check_scratch_dirs "$lowerdir2:$lowerdir" $upperdir $workdir -o redirect_dir=on
+
+# success, all done
+status=0
+exit
Index: xfstests-dev/tests/overlay/group
===================================================================
--- xfstests-dev.orig/tests/overlay/group	2018-02-28 15:27:29.981693615 -0500
+++ xfstests-dev/tests/overlay/group	2018-03-12 09:31:45.692818432 -0400
@@ -59,3 +59,4 @@
 054 auto quick copyup redirect exportfs
 055 auto quick copyup redirect exportfs nonsamefs
 056 auto quick fsck
+057 auto quick redirect
Index: xfstests-dev/tests/overlay/057.out
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ xfstests-dev/tests/overlay/057.out	2018-03-12 13:09:42.061818432 -0400
@@ -0,0 +1,2 @@
+QA output created by 057
+foo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V3] xfstest: overlay: Absolute redirect should be followed even if ancestor is opaque
  2018-03-14 13:16 [PATCH V3] xfstest: overlay: Absolute redirect should be followed even if ancestor is opaque Vivek Goyal
@ 2018-03-14 20:19 ` Amir Goldstein
  2018-03-16  2:53 ` Eryu Guan
  1 sibling, 0 replies; 6+ messages in thread
From: Amir Goldstein @ 2018-03-14 20:19 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: Eryu Guan, fstests, overlayfs, Miklos Szeredi

On Wed, Mar 14, 2018 at 3:16 PM, Vivek Goyal <vgoyal@redhat.com> wrote:
> Typically, when following absolute redirect, if an opauqe dentry is
> found, lookup in further lower directories is stopped. But if a
> child dentry has another absolute redirect, then lookup in further
> lower layers should continue.
>
> Say, following is example setup.
> upper:  /redirect (redirect=/a/b/c)
> lower1: /a/[b]/c       ([b] is opaque) (c has absolute redirect=/a/b/d/)
> lower0: /a/b/d/foo
>
> "redirect" directory in upper should merge with lower1:/a/b/c/ and
> lower0:/a/b/d/, despite lower1:/a/b/ being opaque.
>
> This example and kernel fix has come from Amir Goldstein. I am just putting
> a test for it to make sure its not broken down the line.
>
> v3: Took care of more comments from amir.
>     - Added some comments.
>     - Added _overlay_check_scratch_dirs call.
>
> Signed-off-by: Vivek Goyal <vgoyal@redhat.com>

Thanks,

Reviewed-by: Amir Goldstein <amir73il@gmail.com>


> ---
>  tests/overlay/057     |  100 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/overlay/057.out |    2 +
>  tests/overlay/group   |    1
>  3 files changed, 103 insertions(+)
>
> Index: xfstests-dev/tests/overlay/057
> ===================================================================
> --- /dev/null   1970-01-01 00:00:00.000000000 +0000
> +++ xfstests-dev/tests/overlay/057      2018-03-14 09:10:00.577179042 -0400
> @@ -0,0 +1,100 @@
> +#! /bin/bash
> +# FS QA Test No. 057
> +#
> +# Test absolute redirect is followed even if ancestor is opaque
> +#
> +# Typically, when following absolute redirect, if an opauqe dentry is
> +# found, lookup in further lower directories is stopped. But if a
> +# child dentry has another absolute redirect, then lookup in further
> +# lower layers should continue.
> +#
> +# Say, following is example setup.
> +# upper:  /redirect (redirect=/a/b/c)
> +# lower1: /a/[b]/c       ([b] is opaque) (c has absolute redirect=/a/b/d/)
> +# lower0: /a/b/d/foo
> +#
> +# "redirect" directory in upper should merge with lower1:/a/b/c/ and
> +# lower0:/a/b/d/, despite lower1:/a/b/ being opaque.
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (C) 2018 Red Hat, Inc. All Rights Reserved.
> +# Author: Vivek Goyal <vgoyal@redhat.com>
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it would be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write the Free Software Foundation,
> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> +#-----------------------------------------------------------------------
> +#
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1       # failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +       cd /
> +       rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# remove previous $seqres.full before test
> +rm -f $seqres.full
> +
> +# real QA test starts here
> +_supported_fs overlay
> +_supported_os Linux
> +# We use non-default scratch underlying overlay dirs, we need to check
> +# them explicity after test.
> +_require_scratch_nocheck
> +_require_scratch_overlay_features redirect_dir
> +
> +# remove all files from previous tests
> +_scratch_mkfs
> +
> +# Create test directories
> +lowerdir=$OVL_BASE_SCRATCH_MNT/lower
> +lowerdir2=$OVL_BASE_SCRATCH_MNT/lower2
> +upperdir=$OVL_BASE_SCRATCH_MNT/upper
> +workdir=$OVL_BASE_SCRATCH_MNT/workdir
> +workdir2=$OVL_BASE_SCRATCH_MNT/workdir2
> +
> +mkdir -p $lowerdir $lowerdir2 $upperdir $workdir $workdir2
> +mkdir -p $lowerdir/origin
> +touch $lowerdir/origin/foo
> +_overlay_scratch_mount_dirs $lowerdir $lowerdir2 $workdir2 -o redirect_dir=on
> +
> +# Create opaque parent with absolute redirect child in middle layer
> +mkdir $SCRATCH_MNT/pure
> +mv $SCRATCH_MNT/origin $SCRATCH_MNT/pure/redirect
> +$UMOUNT_PROG $SCRATCH_MNT
> +_overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on
> +mv $SCRATCH_MNT/pure/redirect $SCRATCH_MNT/redirect
> +
> +# Verify that redirects are followed after mount cycle
> +$UMOUNT_PROG $SCRATCH_MNT
> +_overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on
> +ls $SCRATCH_MNT/redirect/
> +
> +# check overlayfs
> +_overlay_check_scratch_dirs "$lowerdir2:$lowerdir" $upperdir $workdir -o redirect_dir=on
> +
> +# success, all done
> +status=0
> +exit
> Index: xfstests-dev/tests/overlay/group
> ===================================================================
> --- xfstests-dev.orig/tests/overlay/group       2018-02-28 15:27:29.981693615 -0500
> +++ xfstests-dev/tests/overlay/group    2018-03-12 09:31:45.692818432 -0400
> @@ -59,3 +59,4 @@
>  054 auto quick copyup redirect exportfs
>  055 auto quick copyup redirect exportfs nonsamefs
>  056 auto quick fsck
> +057 auto quick redirect
> Index: xfstests-dev/tests/overlay/057.out
> ===================================================================
> --- /dev/null   1970-01-01 00:00:00.000000000 +0000
> +++ xfstests-dev/tests/overlay/057.out  2018-03-12 13:09:42.061818432 -0400
> @@ -0,0 +1,2 @@
> +QA output created by 057
> +foo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V3] xfstest: overlay: Absolute redirect should be followed even if ancestor is opaque
  2018-03-14 13:16 [PATCH V3] xfstest: overlay: Absolute redirect should be followed even if ancestor is opaque Vivek Goyal
  2018-03-14 20:19 ` Amir Goldstein
@ 2018-03-16  2:53 ` Eryu Guan
  2018-03-16  2:55   ` Eryu Guan
  1 sibling, 1 reply; 6+ messages in thread
From: Eryu Guan @ 2018-03-16  2:53 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: fstests, Amir Goldstein, linux-unionfs, Miklos Szeredi

On Wed, Mar 14, 2018 at 09:16:18AM -0400, Vivek Goyal wrote:
> Typically, when following absolute redirect, if an opauqe dentry is
> found, lookup in further lower directories is stopped. But if a
> child dentry has another absolute redirect, then lookup in further
> lower layers should continue.
> 
> Say, following is example setup.
> upper:  /redirect (redirect=/a/b/c)
> lower1: /a/[b]/c       ([b] is opaque) (c has absolute redirect=/a/b/d/)
> lower0: /a/b/d/foo
> 
> "redirect" directory in upper should merge with lower1:/a/b/c/ and
> lower0:/a/b/d/, despite lower1:/a/b/ being opaque.
> 
> This example and kernel fix has come from Amir Goldstein. I am just putting
> a test for it to make sure its not broken down the line.
> 
> v3: Took care of more comments from amir.
>     - Added some comments.
>     - Added _overlay_check_scratch_dirs call.
> 
> Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> ---
>  tests/overlay/057     |  100 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/overlay/057.out |    2 +
>  tests/overlay/group   |    1 
>  3 files changed, 103 insertions(+)
> 
> Index: xfstests-dev/tests/overlay/057
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ xfstests-dev/tests/overlay/057	2018-03-14 09:10:00.577179042 -0400
> @@ -0,0 +1,100 @@
> +#! /bin/bash
> +# FS QA Test No. 057
> +#
> +# Test absolute redirect is followed even if ancestor is opaque
> +#
> +# Typically, when following absolute redirect, if an opauqe dentry is
> +# found, lookup in further lower directories is stopped. But if a
> +# child dentry has another absolute redirect, then lookup in further
> +# lower layers should continue.
> +#
> +# Say, following is example setup.
> +# upper:  /redirect (redirect=/a/b/c)
> +# lower1: /a/[b]/c       ([b] is opaque) (c has absolute redirect=/a/b/d/)
> +# lower0: /a/b/d/foo
> +#
> +# "redirect" directory in upper should merge with lower1:/a/b/c/ and
> +# lower0:/a/b/d/, despite lower1:/a/b/ being opaque.
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (C) 2018 Red Hat, Inc. All Rights Reserved.
> +# Author: Vivek Goyal <vgoyal@redhat.com>
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it would be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write the Free Software Foundation,
> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> +#-----------------------------------------------------------------------
> +#
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +	cd /
> +	rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# remove previous $seqres.full before test
> +rm -f $seqres.full
> +
> +# real QA test starts here
> +_supported_fs overlay
> +_supported_os Linux
> +# We use non-default scratch underlying overlay dirs, we need to check
> +# them explicity after test.
> +_require_scratch_nocheck
> +_require_scratch_overlay_features redirect_dir
> +
> +# remove all files from previous tests
> +_scratch_mkfs
> +
> +# Create test directories
> +lowerdir=$OVL_BASE_SCRATCH_MNT/lower
> +lowerdir2=$OVL_BASE_SCRATCH_MNT/lower2
> +upperdir=$OVL_BASE_SCRATCH_MNT/upper
> +workdir=$OVL_BASE_SCRATCH_MNT/workdir
> +workdir2=$OVL_BASE_SCRATCH_MNT/workdir2
> +
> +mkdir -p $lowerdir $lowerdir2 $upperdir $workdir $workdir2
> +mkdir -p $lowerdir/origin
> +touch $lowerdir/origin/foo
> +_overlay_scratch_mount_dirs $lowerdir $lowerdir2 $workdir2 -o redirect_dir=on
> +
> +# Create opaque parent with absolute redirect child in middle layer
> +mkdir $SCRATCH_MNT/pure
> +mv $SCRATCH_MNT/origin $SCRATCH_MNT/pure/redirect
> +$UMOUNT_PROG $SCRATCH_MNT
> +_overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on
> +mv $SCRATCH_MNT/pure/redirect $SCRATCH_MNT/redirect

I think we'd better do a "ls $SCRATCH_MNT/redirect/" here too, right
after the rename and before mount cycle, to make sure 'foo' is there as
well. I can add it on commit (and change the .out file too) if this
change looks OK to you.

BTW, I stopped using eguan@redhat.com, please refer to the following
email (though it's not so obvious..)

[ANNOUNCE] fstests: master branch updated to 5e6514523342, and Eryu's comming role change
https://www.spinics.net/lists/fstests/msg09052.html

Thanks,
Eryu

> +
> +# Verify that redirects are followed after mount cycle
> +$UMOUNT_PROG $SCRATCH_MNT
> +_overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on
> +ls $SCRATCH_MNT/redirect/
> +
> +# check overlayfs
> +_overlay_check_scratch_dirs "$lowerdir2:$lowerdir" $upperdir $workdir -o redirect_dir=on
> +
> +# success, all done
> +status=0
> +exit
> Index: xfstests-dev/tests/overlay/group
> ===================================================================
> --- xfstests-dev.orig/tests/overlay/group	2018-02-28 15:27:29.981693615 -0500
> +++ xfstests-dev/tests/overlay/group	2018-03-12 09:31:45.692818432 -0400
> @@ -59,3 +59,4 @@
>  054 auto quick copyup redirect exportfs
>  055 auto quick copyup redirect exportfs nonsamefs
>  056 auto quick fsck
> +057 auto quick redirect
> Index: xfstests-dev/tests/overlay/057.out
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ xfstests-dev/tests/overlay/057.out	2018-03-12 13:09:42.061818432 -0400
> @@ -0,0 +1,2 @@
> +QA output created by 057
> +foo
> --
> To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V3] xfstest: overlay: Absolute redirect should be followed even if ancestor is opaque
  2018-03-16  2:53 ` Eryu Guan
@ 2018-03-16  2:55   ` Eryu Guan
  2018-03-16  5:58     ` Amir Goldstein
  0 siblings, 1 reply; 6+ messages in thread
From: Eryu Guan @ 2018-03-16  2:55 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: fstests, Amir Goldstein, linux-unionfs, Miklos Szeredi

On Fri, Mar 16, 2018 at 10:53:20AM +0800, Eryu Guan wrote:

> > +# Create opaque parent with absolute redirect child in middle layer
> > +mkdir $SCRATCH_MNT/pure
> > +mv $SCRATCH_MNT/origin $SCRATCH_MNT/pure/redirect
> > +$UMOUNT_PROG $SCRATCH_MNT
> > +_overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on
> > +mv $SCRATCH_MNT/pure/redirect $SCRATCH_MNT/redirect
> 
> I think we'd better do a "ls $SCRATCH_MNT/redirect/" here too, right
> after the rename and before mount cycle, to make sure 'foo' is there as
> well. I can add it on commit (and change the .out file too) if this
> change looks OK to you.

Something like this:

git a/tests/overlay/057 b/tests/overlay/057
index 10b46bfa8cff..d54024e98bcd 100644
--- a/tests/overlay/057
+++ b/tests/overlay/057
@@ -86,6 +86,8 @@ mv $SCRATCH_MNT/origin $SCRATCH_MNT/pure/redirect
 $UMOUNT_PROG $SCRATCH_MNT
 _overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on
 mv $SCRATCH_MNT/pure/redirect $SCRATCH_MNT/redirect
+# Verify that redirects are followed
+ls $SCRATCH_MNT/redirect/
 
 # Verify that redirects are followed after mount cycle
 $UMOUNT_PROG $SCRATCH_MNT
diff --git a/tests/overlay/057.out b/tests/overlay/057.out
index 750830212460..b3b4017d32ae 100644
--- a/tests/overlay/057.out
+++ b/tests/overlay/057.out
@@ -1,2 +1,3 @@
 QA output created by 057
 foo
+foo

Thanks,
Eryu

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH V3] xfstest: overlay: Absolute redirect should be followed even if ancestor is opaque
  2018-03-16  2:55   ` Eryu Guan
@ 2018-03-16  5:58     ` Amir Goldstein
  2018-03-16  6:18       ` Eryu Guan
  0 siblings, 1 reply; 6+ messages in thread
From: Amir Goldstein @ 2018-03-16  5:58 UTC (permalink / raw)
  To: Eryu Guan; +Cc: Vivek Goyal, fstests, overlayfs, Miklos Szeredi

On Fri, Mar 16, 2018 at 4:55 AM, Eryu Guan <guaneryu@gmail.com> wrote:
> On Fri, Mar 16, 2018 at 10:53:20AM +0800, Eryu Guan wrote:
>
>> > +# Create opaque parent with absolute redirect child in middle layer
>> > +mkdir $SCRATCH_MNT/pure
>> > +mv $SCRATCH_MNT/origin $SCRATCH_MNT/pure/redirect
>> > +$UMOUNT_PROG $SCRATCH_MNT
>> > +_overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on
>> > +mv $SCRATCH_MNT/pure/redirect $SCRATCH_MNT/redirect
>>
>> I think we'd better do a "ls $SCRATCH_MNT/redirect/" here too, right
>> after the rename and before mount cycle, to make sure 'foo' is there as
>> well. I can add it on commit (and change the .out file too) if this
>> change looks OK to you.
>

OK, but...

> Something like this:
>
> git a/tests/overlay/057 b/tests/overlay/057
> index 10b46bfa8cff..d54024e98bcd 100644
> --- a/tests/overlay/057
> +++ b/tests/overlay/057
> @@ -86,6 +86,8 @@ mv $SCRATCH_MNT/origin $SCRATCH_MNT/pure/redirect
>  $UMOUNT_PROG $SCRATCH_MNT
>  _overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on
>  mv $SCRATCH_MNT/pure/redirect $SCRATCH_MNT/redirect
> +# Verify that redirects are followed

The wording here is not technically accurate.
"redirect" are "followed" on lookup and there is no lookup here
(dentry is already in cache). It would be more accurate to say
some thing like "List content of renamed merge dir before mount cycle"
and then maybe to use the same language, "Verify that redirects are
followed by listing content of renamed merge dir after after cycle".

> +ls $SCRATCH_MNT/redirect/
>
>  # Verify that redirects are followed after mount cycle
>  $UMOUNT_PROG $SCRATCH_MNT
> diff --git a/tests/overlay/057.out b/tests/overlay/057.out
> index 750830212460..b3b4017d32ae 100644
> --- a/tests/overlay/057.out
> +++ b/tests/overlay/057.out
> @@ -1,2 +1,3 @@
>  QA output created by 057
>  foo
> +foo
>
> Thanks,
> Eryu

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V3] xfstest: overlay: Absolute redirect should be followed even if ancestor is opaque
  2018-03-16  5:58     ` Amir Goldstein
@ 2018-03-16  6:18       ` Eryu Guan
  0 siblings, 0 replies; 6+ messages in thread
From: Eryu Guan @ 2018-03-16  6:18 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: Vivek Goyal, fstests, overlayfs, Miklos Szeredi

On Fri, Mar 16, 2018 at 07:58:35AM +0200, Amir Goldstein wrote:
> On Fri, Mar 16, 2018 at 4:55 AM, Eryu Guan <guaneryu@gmail.com> wrote:
> > On Fri, Mar 16, 2018 at 10:53:20AM +0800, Eryu Guan wrote:
> >
> >> > +# Create opaque parent with absolute redirect child in middle layer
> >> > +mkdir $SCRATCH_MNT/pure
> >> > +mv $SCRATCH_MNT/origin $SCRATCH_MNT/pure/redirect
> >> > +$UMOUNT_PROG $SCRATCH_MNT
> >> > +_overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on
> >> > +mv $SCRATCH_MNT/pure/redirect $SCRATCH_MNT/redirect
> >>
> >> I think we'd better do a "ls $SCRATCH_MNT/redirect/" here too, right
> >> after the rename and before mount cycle, to make sure 'foo' is there as
> >> well. I can add it on commit (and change the .out file too) if this
> >> change looks OK to you.
> >
> 
> OK, but...
> 
> > Something like this:
> >
> > git a/tests/overlay/057 b/tests/overlay/057
> > index 10b46bfa8cff..d54024e98bcd 100644
> > --- a/tests/overlay/057
> > +++ b/tests/overlay/057
> > @@ -86,6 +86,8 @@ mv $SCRATCH_MNT/origin $SCRATCH_MNT/pure/redirect
> >  $UMOUNT_PROG $SCRATCH_MNT
> >  _overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on
> >  mv $SCRATCH_MNT/pure/redirect $SCRATCH_MNT/redirect
> > +# Verify that redirects are followed
> 
> The wording here is not technically accurate.
> "redirect" are "followed" on lookup and there is no lookup here
> (dentry is already in cache). It would be more accurate to say
> some thing like "List content of renamed merge dir before mount cycle"
> and then maybe to use the same language, "Verify that redirects are
> followed by listing content of renamed merge dir after after cycle".

I'll update as suggested. Thanks!

Eryu

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-16  6:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-14 13:16 [PATCH V3] xfstest: overlay: Absolute redirect should be followed even if ancestor is opaque Vivek Goyal
2018-03-14 20:19 ` Amir Goldstein
2018-03-16  2:53 ` Eryu Guan
2018-03-16  2:55   ` Eryu Guan
2018-03-16  5:58     ` Amir Goldstein
2018-03-16  6:18       ` Eryu Guan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox