1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00

tests: use conv=fdatasync

Should be slightly better to flushed before dd exits
instead of using direct IO.
This commit is contained in:
Zdenek Kabelac 2015-09-03 23:04:15 +02:00
parent ee8200f1c6
commit dc261f17e9
4 changed files with 11 additions and 11 deletions

View File

@ -42,7 +42,7 @@ d2="$DM_DEV_DIR/$vg/$lv2"
lvcreate -l47 -n $lv1 $vg
# Fill end with pattern
dd if=64K of="$d1" bs=8192 seek=45 count=2
dd if=64K of="$d1" bs=8192 seek=45 count=2 conv=fdatasync
# Switch to read-only volume
lvchange -an $vg/$lv1
@ -58,7 +58,7 @@ cmp -n 16384 -l 64K 16K
# Now extend and rewrite
lvextend -l+2 $vg/$lv2
dd if=64K of="$d2" bs=8192 seek=46 count=3 oflag=direct
dd if=64K of="$d2" bs=8192 seek=46 count=3 conv=fdatasync
dd if="$d2" of=24K bs=8192 skip=46 count=3 iflag=direct
cmp -n 24576 -l 64K 24K
@ -67,7 +67,7 @@ check lv_field $vg/$lv2 data_percent "66.67"
lvreduce -f -l-24 $vg/$lv2
dd if=64K of="$d2" bs=8192 seek=24 count=1 oflag=direct
dd if=64K of="$d2" bs=8192 seek=24 count=1 conv=fdatasync
dd if="$d2" of=8K bs=8192 skip=24 count=1 iflag=direct
cmp -n 8192 -l 64K 8K
@ -80,7 +80,7 @@ lvcreate -L256M -T $vg/pool -c 64M
lvcreate -s $vg/$lv1 --name $lv2 --thinpool $vg/pool
lvextend -l+2 $vg/$lv2
dd if=64K of="$d2" bs=8192 seek=45 count=4 oflag=direct
dd if=64K of="$d2" bs=8192 seek=45 count=4 conv=fdatasync
dd if="$d2" of=32K bs=8192 skip=45 count=4 iflag=direct
cmp -n 32768 -l 64K 32K

View File

@ -34,7 +34,7 @@ mkdir "$mntdir"
mount "$DM_DEV_DIR/mapper/$vg-snap" "$mntdir"
cat /proc/mounts | grep "$mntdir"
not dd if=/dev/zero of="$mntdir/file$1" bs=1M count=5 oflag=direct
not dd if=/dev/zero of="$mntdir/file$1" bs=1M count=5 conv=fdatasync
# Should be nearly instant check of dmeventd for invalid snapshot.
# Wait here for umount and open_count drops to 0 as it may

View File

@ -24,7 +24,7 @@ lvcreate -aey -L1 -n $lv1 $vg
# Snapshot should be large enough to handle any writes
lvcreate -L2 -s $vg/$lv1 -n $lv2
dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv2" bs=1M count=1 oflag=direct
dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv2" bs=1M count=1 conv=fdatasync
# Snapshot must not be 'I'nvalid here
check lv_attr_bit state $vg/$lv2 "a"

View File

@ -30,24 +30,24 @@ which md5sum || skip
aux prepare_vg
# 8M file with some random data
dd if=/dev/urandom of=data bs=1M count=1
dd if=data of=data bs=1M count=7 seek=1
dd if=/dev/urandom of=data bs=1M count=1 conv=fdatasync
dd if=data of=data bs=1M count=7 seek=1 conv=fdatasync
echo "$(md5sum data | cut -d' ' -f1) $DM_DEV_DIR/$vg/s" >md5.${vg}-s
lvcreate -aey -L 8M -n o $vg
dd if=data of="$DM_DEV_DIR/$vg/o" bs=1M
dd if=data of="$DM_DEV_DIR/$vg/o" bs=1M conv=fdatasync
lvcreate -L 8M -s -n s $vg/o
check_s_
dd if=data of="$DM_DEV_DIR/$vg/o" bs=1234567 count=1 skip=1
dd if=data of="$DM_DEV_DIR/$vg/o" bs=1234567 count=1 skip=1 conv=fdatasync
check_s_
lvchange -an $vg
lvchange -ay $vg
check_s_
dd if=data of="$DM_DEV_DIR/$vg/o" bs=1234567 count=2 skip=1
dd if=data of="$DM_DEV_DIR/$vg/o" bs=1234567 count=2 skip=1 conv=fdatasync
check_s_
lvchange -an $vg