All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] overlay/029: fix test failure with index feature enabled
@ 2020-04-09 11:29 Amir Goldstein
  2020-04-19 16:06 ` Eryu Guan
  0 siblings, 1 reply; 5+ messages in thread
From: Amir Goldstein @ 2020-04-09 11:29 UTC (permalink / raw)
  To: Eryu Guan; +Cc: Chengguang Xu, Miklos Szeredi, linux-unionfs, fstests

When overlayfs index feature is enabled by default in either kernel
config or module parameters, this test fails:

    mount: /tmp/8751/mnt: mount(2) system call failed: Stale file handle.
    cat: /tmp/8751/mnt/bar: No such file or directory

The reason is that with index feature enabled, an upper/work dirs cannot
be reused for mounting with a different lower layer.

Reported-by: Chengguang Xu <cgxu519@mykernel.net>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 tests/overlay/029 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/overlay/029 b/tests/overlay/029
index 1d2d2092..17f58de7 100755
--- a/tests/overlay/029
+++ b/tests/overlay/029
@@ -68,12 +68,18 @@ _overlay_mount_dirs $SCRATCH_MNT/up $tmp/{upper,work} \
 cat $tmp/mnt/foo
 $UMOUNT_PROG $tmp/mnt
 
+# re-create upper/work to avoid ovl_verify_origin() mount failure
+# when index is enabled
+rm -rf $tmp/{upper,work}
+mkdir -p $tmp/{upper,work}
 # mount overlay again using lower dir from SCRATCH_MNT dir
 _overlay_mount_dirs $SCRATCH_MNT/low $tmp/{upper,work} \
   overlay $tmp/mnt
 cat $tmp/mnt/bar
 $UMOUNT_PROG $tmp/mnt
 
+rm -rf $tmp/{upper,work}
+mkdir -p $tmp/{upper,work}
 # mount overlay again using SCRATCH_MNT dir
 _overlay_mount_dirs $SCRATCH_MNT/ $tmp/{upper,work} \
   overlay $tmp/mnt
-- 
2.17.1


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

* Re: [PATCH] overlay/029: fix test failure with index feature enabled
  2020-04-09 11:29 [PATCH] overlay/029: fix test failure with index feature enabled Amir Goldstein
@ 2020-04-19 16:06 ` Eryu Guan
  2020-04-19 16:12   ` Amir Goldstein
  0 siblings, 1 reply; 5+ messages in thread
From: Eryu Guan @ 2020-04-19 16:06 UTC (permalink / raw)
  To: Amir Goldstein
  Cc: Eryu Guan, Chengguang Xu, Miklos Szeredi, linux-unionfs, fstests

On Thu, Apr 09, 2020 at 02:29:00PM +0300, Amir Goldstein wrote:
> When overlayfs index feature is enabled by default in either kernel
> config or module parameters, this test fails:
> 
>     mount: /tmp/8751/mnt: mount(2) system call failed: Stale file handle.
>     cat: /tmp/8751/mnt/bar: No such file or directory
> 
> The reason is that with index feature enabled, an upper/work dirs cannot
> be reused for mounting with a different lower layer.

I re-built my test kernel with CONFIG_OVERLAY_FS_INDEX=y, and confirmed
/sys/module/overlay/parameters/index is 'Y', but test still passes for
me. And I do notice the following info in dmesg:

[  598.663923] overlayfs: fs on '/mnt/scratch/ovl-mnt/up' does not support file handles, falling back to index=off,nfs_export=off.
[  598.674299] overlayfs: fs on '/mnt/scratch/ovl-mnt/low' does not support file handles, falling back to index=off,nfs_export=off.
[  598.684594] overlayfs: fs on '/mnt/scratch/ovl-mnt/' does not support file handles, falling back to index=off,nfs_export=off.

Seems it has something to do with nfs_export feature? I have it disabled
by default.

 # CONFIG_OVERLAY_FS_NFS_EXPORT is not set

Could you please help confirm?

Thanks,
Eryu

> 
> Reported-by: Chengguang Xu <cgxu519@mykernel.net>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
>  tests/overlay/029 | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tests/overlay/029 b/tests/overlay/029
> index 1d2d2092..17f58de7 100755
> --- a/tests/overlay/029
> +++ b/tests/overlay/029
> @@ -68,12 +68,18 @@ _overlay_mount_dirs $SCRATCH_MNT/up $tmp/{upper,work} \
>  cat $tmp/mnt/foo
>  $UMOUNT_PROG $tmp/mnt
>  
> +# re-create upper/work to avoid ovl_verify_origin() mount failure
> +# when index is enabled
> +rm -rf $tmp/{upper,work}
> +mkdir -p $tmp/{upper,work}
>  # mount overlay again using lower dir from SCRATCH_MNT dir
>  _overlay_mount_dirs $SCRATCH_MNT/low $tmp/{upper,work} \
>    overlay $tmp/mnt
>  cat $tmp/mnt/bar
>  $UMOUNT_PROG $tmp/mnt
>  
> +rm -rf $tmp/{upper,work}
> +mkdir -p $tmp/{upper,work}
>  # mount overlay again using SCRATCH_MNT dir
>  _overlay_mount_dirs $SCRATCH_MNT/ $tmp/{upper,work} \
>    overlay $tmp/mnt
> -- 
> 2.17.1
> 

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

* Re: [PATCH] overlay/029: fix test failure with index feature enabled
  2020-04-19 16:06 ` Eryu Guan
@ 2020-04-19 16:12   ` Amir Goldstein
  2020-04-19 17:01     ` Eryu Guan
  0 siblings, 1 reply; 5+ messages in thread
From: Amir Goldstein @ 2020-04-19 16:12 UTC (permalink / raw)
  To: Eryu Guan; +Cc: Eryu Guan, Chengguang Xu, Miklos Szeredi, overlayfs, fstests

On Sun, Apr 19, 2020 at 7:05 PM Eryu Guan <guan@eryu.me> wrote:
>
> On Thu, Apr 09, 2020 at 02:29:00PM +0300, Amir Goldstein wrote:
> > When overlayfs index feature is enabled by default in either kernel
> > config or module parameters, this test fails:
> >
> >     mount: /tmp/8751/mnt: mount(2) system call failed: Stale file handle.
> >     cat: /tmp/8751/mnt/bar: No such file or directory
> >
> > The reason is that with index feature enabled, an upper/work dirs cannot
> > be reused for mounting with a different lower layer.
>
> I re-built my test kernel with CONFIG_OVERLAY_FS_INDEX=y, and confirmed
> /sys/module/overlay/parameters/index is 'Y', but test still passes for
> me. And I do notice the following info in dmesg:
>
> [  598.663923] overlayfs: fs on '/mnt/scratch/ovl-mnt/up' does not support file handles, falling back to index=off,nfs_export=off.
> [  598.674299] overlayfs: fs on '/mnt/scratch/ovl-mnt/low' does not support file handles, falling back to index=off,nfs_export=off.
> [  598.684594] overlayfs: fs on '/mnt/scratch/ovl-mnt/' does not support file handles, falling back to index=off,nfs_export=off.
>
> Seems it has something to do with nfs_export feature? I have it disabled
> by default.
>
>  # CONFIG_OVERLAY_FS_NFS_EXPORT is not set
>
> Could you please help confirm?
>

I confirm. enabling index on nested overlay requires that
the lower overlay has nfs_export enabled.

Missed that, but in the bug report, CONFIG_OVERLAY_FS_NFS_EXPORT
was indeed set.

You do not need to rebuild the kernel.
You can reproduce the failure by setting overlay module parameter before
running the tests.

echo Y > /sys/module/overlay/parameters/index
echo Y > /sys/module/overlay/parameters/nfs_export

Thanks,
Amir.

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

* Re: [PATCH] overlay/029: fix test failure with index feature enabled
  2020-04-19 16:12   ` Amir Goldstein
@ 2020-04-19 17:01     ` Eryu Guan
  2020-04-19 17:54       ` Amir Goldstein
  0 siblings, 1 reply; 5+ messages in thread
From: Eryu Guan @ 2020-04-19 17:01 UTC (permalink / raw)
  To: Amir Goldstein
  Cc: Eryu Guan, Chengguang Xu, Miklos Szeredi, overlayfs, fstests

On Sun, Apr 19, 2020 at 07:12:33PM +0300, Amir Goldstein wrote:
> On Sun, Apr 19, 2020 at 7:05 PM Eryu Guan <guan@eryu.me> wrote:
> >
> > On Thu, Apr 09, 2020 at 02:29:00PM +0300, Amir Goldstein wrote:
> > > When overlayfs index feature is enabled by default in either kernel
> > > config or module parameters, this test fails:
> > >
> > >     mount: /tmp/8751/mnt: mount(2) system call failed: Stale file handle.
> > >     cat: /tmp/8751/mnt/bar: No such file or directory
> > >
> > > The reason is that with index feature enabled, an upper/work dirs cannot
> > > be reused for mounting with a different lower layer.
> >
> > I re-built my test kernel with CONFIG_OVERLAY_FS_INDEX=y, and confirmed
> > /sys/module/overlay/parameters/index is 'Y', but test still passes for
> > me. And I do notice the following info in dmesg:
> >
> > [  598.663923] overlayfs: fs on '/mnt/scratch/ovl-mnt/up' does not support file handles, falling back to index=off,nfs_export=off.
> > [  598.674299] overlayfs: fs on '/mnt/scratch/ovl-mnt/low' does not support file handles, falling back to index=off,nfs_export=off.
> > [  598.684594] overlayfs: fs on '/mnt/scratch/ovl-mnt/' does not support file handles, falling back to index=off,nfs_export=off.
> >
> > Seems it has something to do with nfs_export feature? I have it disabled
> > by default.
> >
> >  # CONFIG_OVERLAY_FS_NFS_EXPORT is not set
> >
> > Could you please help confirm?
> >
> 
> I confirm. enabling index on nested overlay requires that
> the lower overlay has nfs_export enabled.

Thanks!

> 
> Missed that, but in the bug report, CONFIG_OVERLAY_FS_NFS_EXPORT
> was indeed set.

Would you please update the commit log accordingly as well?

> 
> You do not need to rebuild the kernel.
> You can reproduce the failure by setting overlay module parameter before
> running the tests.
> 
> echo Y > /sys/module/overlay/parameters/index
> echo Y > /sys/module/overlay/parameters/nfs_export

Ah, forgot about that.. it's easier now :)

Thanks,
Eryu

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

* Re: [PATCH] overlay/029: fix test failure with index feature enabled
  2020-04-19 17:01     ` Eryu Guan
@ 2020-04-19 17:54       ` Amir Goldstein
  0 siblings, 0 replies; 5+ messages in thread
From: Amir Goldstein @ 2020-04-19 17:54 UTC (permalink / raw)
  To: Eryu Guan; +Cc: Eryu Guan, Chengguang Xu, Miklos Szeredi, overlayfs, fstests

On Sun, Apr 19, 2020 at 8:00 PM Eryu Guan <guan@eryu.me> wrote:
>
> On Sun, Apr 19, 2020 at 07:12:33PM +0300, Amir Goldstein wrote:
> > On Sun, Apr 19, 2020 at 7:05 PM Eryu Guan <guan@eryu.me> wrote:
> > >
> > > On Thu, Apr 09, 2020 at 02:29:00PM +0300, Amir Goldstein wrote:
> > > > When overlayfs index feature is enabled by default in either kernel
> > > > config or module parameters, this test fails:
> > > >
> > > >     mount: /tmp/8751/mnt: mount(2) system call failed: Stale file handle.
> > > >     cat: /tmp/8751/mnt/bar: No such file or directory
> > > >
> > > > The reason is that with index feature enabled, an upper/work dirs cannot
> > > > be reused for mounting with a different lower layer.
> > >
> > > I re-built my test kernel with CONFIG_OVERLAY_FS_INDEX=y, and confirmed
> > > /sys/module/overlay/parameters/index is 'Y', but test still passes for
> > > me. And I do notice the following info in dmesg:
> > >
> > > [  598.663923] overlayfs: fs on '/mnt/scratch/ovl-mnt/up' does not support file handles, falling back to index=off,nfs_export=off.
> > > [  598.674299] overlayfs: fs on '/mnt/scratch/ovl-mnt/low' does not support file handles, falling back to index=off,nfs_export=off.
> > > [  598.684594] overlayfs: fs on '/mnt/scratch/ovl-mnt/' does not support file handles, falling back to index=off,nfs_export=off.
> > >
> > > Seems it has something to do with nfs_export feature? I have it disabled
> > > by default.
> > >
> > >  # CONFIG_OVERLAY_FS_NFS_EXPORT is not set
> > >
> > > Could you please help confirm?
> > >
> >
> > I confirm. enabling index on nested overlay requires that
> > the lower overlay has nfs_export enabled.
>
> Thanks!
>
> >
> > Missed that, but in the bug report, CONFIG_OVERLAY_FS_NFS_EXPORT
> > was indeed set.
>
> Would you please update the commit log accordingly as well?
>

OK.

Thanks,
Amir.

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

end of thread, other threads:[~2020-04-19 17:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 11:29 [PATCH] overlay/029: fix test failure with index feature enabled Amir Goldstein
2020-04-19 16:06 ` Eryu Guan
2020-04-19 16:12   ` Amir Goldstein
2020-04-19 17:01     ` Eryu Guan
2020-04-19 17:54       ` Amir Goldstein

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.