zfs_receive_010_pos: change dd arguments

The  `dd` command as written will not create a hole in the file.
Additionally, the `stride` argument isn't understood by `dd` so
it's replaced with `seek` which isn't equivilant but will result in
a single whole which is sufficient for the test case.  Finally,
`conv=notrunc` is added to avoid truncating the file.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: George Melikov <mail@gmelikov.ru>
Closes #6023
This commit is contained in:
George Melikov 2017-04-20 23:05:39 +04:00 committed by Brian Behlendorf
parent ad7e908ad5
commit 3e67c38c34

View File

@ -53,9 +53,9 @@ function make_object
if [[ $type == "file" ]]; then
dd if=/dev/urandom of=${mntpnt}/f$objnum bs=512 count=16
elif [[ $type == "hole1" ]]; then
dd if=/dev/urandom of=${mntpnt}/fh$objnum bs=512 count=5 stride=4
dd if=/dev/zero of=${mntpnt}/fh$objnum bs=512 count=5 seek=4 conv=notrunc
elif [[ $type == "hole2" ]]; then
dd if=/dev/urandom of=${mntpnt}/fh$objnum bs=512 count=4 stride=5
dd if=/dev/zero of=${mntpnt}/fh$objnum bs=512 count=4 seek=5 conv=notrunc
elif [[ $type == "directory" ]]; then
mkdir ${mntpnt}/d$objnum
elif [[ $type == "missing" ]]; then