mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Corrected oversight in ZERO_RANGE behavior
It turns out, no, in fact, ZERO_RANGE and PUNCH_HOLE do have differing semantics in some ways - in particular, one requires KEEP_SIZE, and the other does not. Also added a zero-range test to catch this, corrected a flaw that made the punch-hole test succeed vacuously, and a typo in file_write. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes #13329 Closes #13338
This commit is contained in:
@@ -3602,6 +3602,22 @@ function punch_hole # offset length file
|
||||
esac
|
||||
}
|
||||
|
||||
function zero_range # offset length file
|
||||
{
|
||||
typeset offset=$1
|
||||
typeset length=$2
|
||||
typeset file=$3
|
||||
|
||||
case "$UNAME" in
|
||||
Linux)
|
||||
fallocate --zero-range --offset $offset --length $length "$file"
|
||||
;;
|
||||
*)
|
||||
false
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
#
|
||||
# Wait for the specified arcstat to reach non-zero quiescence.
|
||||
# If echo is 1 echo the value after reaching quiescence, otherwise
|
||||
|
||||
Reference in New Issue
Block a user