* [PATCH v2] overlay/029: fix test failure with nfs_export feature enabled
@ 2020-04-20 10:27 Amir Goldstein
0 siblings, 0 replies; only message in thread
From: Amir Goldstein @ 2020-04-20 10:27 UTC (permalink / raw)
To: Eryu Guan; +Cc: Miklos Szeredi, Chengguang Xu, linux-unionfs, fstests
When overlayfs nfs_export 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 nfs_export depends on index feature and with index
feature enabled, an upper/work dirs cannot be reused for mounting with
a different lower layer.
To reproduce the failure do:
echo Y > /sys/module/overlay/parameters/index
echo Y > /sys/module/overlay/parameters/nfs_export
before running the test.
Fix the failure by explicitly re-creating upper/work dirs.
Reported-by: Chengguang Xu <cgxu519@mykernel.net>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
tests/overlay/029 | 6 ++++++
1 file changed, 6 insertions(+)
V2:
- Update commit message s/index/nfs_export feature
- Document how to test failure
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] only message in thread
only message in thread, other threads:[~2020-04-20 10:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-20 10:27 [PATCH v2] overlay/029: fix test failure with nfs_export feature enabled Amir Goldstein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).