zfs: fix the slog_012_neg test

This test attempts to corrupt a file-backed vdev by deleting it and then
recreating it with truncate.  But that doesn't work, because the pool
already has the vdev open, and it happily hangs on to the open-but-deleted
file.  Fix by truncating the file without deleting it.

MFC after:	2 weeks
Sponsored by:	Axcient
This commit is contained in:
Alan Somers 2019-10-07 18:55:40 +00:00
parent ba23dca684
commit d253c454bb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=353282

View File

@ -74,7 +74,9 @@ function test_slog_mirror_corruption # <pooltype> <sparetype>
log_must $DD if=/dev/urandom of=$mntpnt/testfile.${TESTCASE_ID} count=100
ldev=$(random_get $LDEV)
log_must create_vdevs $ldev
eval `$STAT -s $ldev`
log_must $TRUNCATE -s0 $ldev
log_must $TRUNCATE -s $st_size $ldev
log_must $ZPOOL scrub $TESTPOOL
log_must display_status $TESTPOOL