aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests/include/blkdev.shlib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/zfs-tests/include/blkdev.shlib')
-rw-r--r--tests/zfs-tests/include/blkdev.shlib9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/zfs-tests/include/blkdev.shlib b/tests/zfs-tests/include/blkdev.shlib
index 2269131a4..e459e9e46 100644
--- a/tests/zfs-tests/include/blkdev.shlib
+++ b/tests/zfs-tests/include/blkdev.shlib
@@ -577,6 +577,11 @@ function corrupt_blocks_at_level # input_file corrupt_level
[[ -f $input_file ]] || log_fail "Couldn't find $input_file"
+ if is_freebsd; then
+ # Temporarily allow corrupting an inuse device.
+ debugflags=$(sysctl -n kern.geom.debugflags)
+ sysctl kern.geom.debugflags=16
+ fi
log_must list_file_blocks $input_file | \
while read level path offset length; do
@@ -586,6 +591,10 @@ function corrupt_blocks_at_level # input_file corrupt_level
fi
done
+ if is_freebsd; then
+ sysctl kern.geom.debugflags=$debugflags
+ fi
+
# This is necessary for pools made of loop devices.
sync
}