aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2021-12-22 11:05:07 -0800
committerTony Hutter <[email protected]>2022-02-16 17:58:55 -0800
commitc454e46336c31d3fe2c6491c57b1e71963ca7ed6 (patch)
tree7b57090b10050430f7ae40a1443f0d9a75544dbf /tests/zfs-tests
parent306cccca274d2af19bbfa76452249359db00a832 (diff)
ZTS: Fix rollback_003_pos.ksh
Under Linux when rolling back a mounted filesystem negative dentries may not be dropped from the cache. This can result in an ENOENT being incorrectly returned on first access. Issuing a `df` before the unmount results in the negative dentries being invalidated and side steps the issue. This is solely a workaround for the test case on Linux and not correct behavior. The core issue of invalidating negative dentries needs to be handled with a kernel side change. This is being tracked as issue #6143. Reviewed-by: George Melikov <[email protected]> Reviewed-by: John Kennedy <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #12898 Issue #6143
Diffstat (limited to 'tests/zfs-tests')
-rw-r--r--tests/zfs-tests/tests/functional/rsend/rsend.kshlib7
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/rollback_003_pos.ksh17
2 files changed, 17 insertions, 7 deletions
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend.kshlib b/tests/zfs-tests/tests/functional/rsend/rsend.kshlib
index 8cd35e4af..516d41263 100644
--- a/tests/zfs-tests/tests/functional/rsend/rsend.kshlib
+++ b/tests/zfs-tests/tests/functional/rsend/rsend.kshlib
@@ -121,6 +121,13 @@ function cleanup_pool
log_must rm -rf $BACKDIR/*
if is_global_zone ; then
+ #
+ # Linux: Issuing a `df` seems to properly force any negative
+ # dcache entries to be invalidated preventing failures when
+ # accessing the mount point. Additional investigation required.
+ #
+ # https://github.com/openzfs/zfs/issues/6143
+ #
log_must df >/dev/null
log_must_busy zfs destroy -Rf $pool
else
diff --git a/tests/zfs-tests/tests/functional/snapshot/rollback_003_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/rollback_003_pos.ksh
index 59e7c110d..036e71410 100755
--- a/tests/zfs-tests/tests/functional/snapshot/rollback_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/rollback_003_pos.ksh
@@ -92,6 +92,15 @@ log_note "Verify rollback of multiple nested file systems succeeds."
log_must zfs snapshot $TESTPOOL/$TESTFILE@$TESTSNAP
log_must zfs snapshot $SNAPPOOL.1
+#
+# Linux: Issuing a `df` seems to properly force any negative dcache entries to
+# be invalidated preventing failures when accessing the mount point. Additional
+# investigation required.
+#
+# https://github.com/openzfs/zfs/issues/6143
+#
+log_must df >/dev/null
+
export __ZFS_POOL_RESTRICT="$TESTPOOL"
log_must zfs unmount -a
log_must zfs mount -a
@@ -100,12 +109,6 @@ unset __ZFS_POOL_RESTRICT
log_must touch /$TESTPOOL/$TESTFILE/$TESTFILE.1
log_must zfs rollback $SNAPPOOL.1
-
-#
-# Workaround for issue #6143. Issuing a `df` seems to properly force any
-# negative dcache entries to be invalidated preventing subsequent failures
-# when accessing the mount point. Additional investigation required.
-#
-log_must df
+log_must df >/dev/null
log_pass "Rollbacks succeed when nested file systems are present."