aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-10-19 10:06:55 -0700
committerTony Hutter <[email protected]>2018-03-14 16:10:36 -0700
commit5d62588032aa1d13d7f789cf564a0d20c77a5762 (patch)
treef3f7d5eb19cba70e2da63be66f9d348ddc2410b3 /tests
parent6897ea475fd0c82a74edacf374d4e339f9a9b86b (diff)
Remove vn_rename and vn_remove dependency
The only place vn_rename and vn_remove are used is when writing out an updated pool configuration file. By truncating the file instead of renaming and removing it we can avoid having to implement these interfaces entirely. Functionally an empty cache file is treated the same as a missing cache file. This is particularly advantageous because the Linux kernel has never provided a way to reliably implement vn_rename and vn_remove. The cachefile_004_pos.ksh test case was updated to understand that an empty cache file is the same as a missing one. The zfs-import-* systemd service files were not updated to use ConditionFileNotEmpty in place of ConditionPathExists. This means that after exporting all pools and rebooting new pools will not the scanned for on the next boot. This small change should not impact normal usage since pools are not exported as part of a normal shutdown. Documentation was updated accordingly. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Arkadiusz BubaƂa <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes zfsonlinux/spl#648 Closes #6753
Diffstat (limited to 'tests')
-rwxr-xr-xtests/zfs-tests/tests/functional/cachefile/cachefile_004_pos.ksh6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/zfs-tests/tests/functional/cachefile/cachefile_004_pos.ksh b/tests/zfs-tests/tests/functional/cachefile/cachefile_004_pos.ksh
index ae54a9365..e0b81e166 100755
--- a/tests/zfs-tests/tests/functional/cachefile/cachefile_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cachefile/cachefile_004_pos.ksh
@@ -98,13 +98,13 @@ log_must zpool set cachefile=$CPATH2 $TESTPOOL1
log_must pool_in_cache $TESTPOOL1 $CPATH2
log_must zpool set cachefile=$CPATH2 $TESTPOOL2
log_must pool_in_cache $TESTPOOL2 $CPATH2
-if [[ -f $CPATH1 ]]; then
+if [[ -s $CPATH1 ]]; then
log_fail "Verify set when cachefile is set on pool."
fi
log_must zpool export $TESTPOOL1
log_must zpool export $TESTPOOL2
-if [[ -f $CPATH2 ]]; then
+if [[ -s $CPATH2 ]]; then
log_fail "Verify export when cachefile is set on pool."
fi
@@ -117,7 +117,7 @@ log_must pool_in_cache $TESTPOOL2 $CPATH2
log_must zpool destroy $TESTPOOL1
log_must zpool destroy $TESTPOOL2
-if [[ -f $CPATH2 ]]; then
+if [[ -s $CPATH2 ]]; then
log_fail "Verify destroy when cachefile is set on pool."
fi