Description of problem: # virsh vol-wipe /dev/lv_pool/lv_test Vol /dev/lv_pool/lv_test wiped # cmp /dev/lv_pool/lv_test /dev/zero /dev/lv_pool/lv_test /dev/zero differ: byte 2576412, line 1 # virsh vol-wipe /dev/lv_pool/lv_test Vol /dev/lv_pool/lv_test wiped # cmp /dev/lv_pool/lv_test /dev/zero cmp: EOF on /dev/lv_pool/lv_test Version-Release number of selected component (if applicable): libvirt-0.8.2-14.el5 How reproducible: always Steps to Reproduce: 1. create a logical volume pool with xml similar with following: <pool type="logical"> <name>lv_pool</name> <source> <device path="/dev/sda3"/> <device path="/dev/sdb4"/> <device path="/dev/sdc5"/> </source> <target> <path>/dev/lv_pool</path> </target> </pool> # virsh pool-define lv_pool.xml # virsh pool-build lv_pool # virsh pool-start lv_pool 2. create a logical volume with xml similar with following: <volume> <name>lv_test</name> <key>r4xkCv-MQhr-WKIT-R66x-Epn2-e8hG-1Z5gY0</key> <source> <device path='/dev/sda3'> </device> </source> <capacity>2080374784</capacity> <allocation>2080374784</allocation> <target> <path>/dev/lv_pool/lv_test</path> <permissions> <mode>0660</mode> <owner>0</owner> <group>6</group> <label>system_u:object_r:fixed_disk_device_t:s0</label> </permissions> </target> </volume> # virsh vol-create lv_pool lv_test.xml 3. check if the volume exists # virsh vol-list lv_pool Name Path ----------------------------------------- lv_test /dev/lv_pool/lv_test 4. mount /dev/lv_pool/lv_test # mkfs.ext3 /dev/lv_pool/lv_test # mount /dev/lv_pool/lv_test /mnt 5. write some datas to /dev/lv_pool/lv_test # cd /mnt # for i in {1..100}; do touch "hello${i}"; done for i in {1..100};do echo "hello, girl" >> hello${i}; done 6. wipe # virsh vol-wipe ${lv_test_path} 7. check if it's empty #cmp ${lv_test_path} /dev/zero 8. remount /dev/lv_pool/lv_test Actual results: as $description Expected results: could wipe up the volume in one time Additional info:
on RHEL6 did the same operation with the comment 0 , and the volume could be wiped up in one time . libvirt-0.8.1-27.el6.x86_64 kernel-2.6.32-71.el6.x86_64 steps did on RHEL6 [root@dhcp-93-211 ~]# vim pool.xml [root@dhcp-93-211 ~]# virsh pool-define pool.xml Pool lv_pool defined from pool.xml [root@dhcp-93-211 ~]# virsh pool-build lv_pool Pool lv_pool built [root@dhcp-93-211 ~]# virsh pool-start lv_pool Pool lv_pool started [root@dhcp-93-211 ~]# vim vol.xml [root@dhcp-93-211 ~]# virsh vol-create lv_pool vol.xml Vol lv_test created from vol.xml [root@dhcp-93-211 ~]# mkfs.ext3 /dev/lv_pool/lv_test ...... [root@dhcp-93-211 ~]# mount /dev/lv_pool/lv_test /mnt [root@dhcp-93-211 ~]# cd /mnt; for i in {1..100}; do touch "hello${i}"; done [root@dhcp-93-211 mnt]# virsh vol-wipe /dev/lv_pool/lv_test Vol /dev/lv_pool/lv_test wiped [root@dhcp-93-211 mnt]# cmp /dev/lv_pool/lv_test /dev/zero cmp: EOF on /dev/lv_pool/lv_test
all of the xml files in comment 0 and comment 1 are the same
Can you provide the bytes that are non-zero?
Created attachment 464155 [details] bytes that wasn't wiped on the volume # cmp /dev/lv_pool/lv_test /dev/zero /dev/lv_pool/lv_test /dev/zero differ: byte 1073, line 1 # dd if=/dev/lv_pool/lv_test of=/opt/un-wiped-bytes bs=1073 count=1 1+0 records in 1+0 records out 1073 bytes (1.1 kB) copied, 0.0001 seconds, 11 MB/s # cat /opt/un-wiped-bytes �
Can't reproduce this with many times testing. The codes looks good to me, have no idea what happened. @vivian, if it still could be reproduced for you, please execute the "cmp" command with option "-l", it will print the differing bytes (though actually it's only one byte difference in your result). It might help us. And I'm not sure if it caused by some byte we actually should skip. Please refer to the "-i SKIP1:SKIP2" or "-i SKIP" of the cmp manual, and try to do some testing with it. Thanks.
can't reproduce this bug on libvirt-0.8.2-22.el5 kernel-2.6.18-278.el5 # cmp -l /dev/lv_pool/lv_test /dev/zero 2576412 2 0 2576416 1 0 2576417 377 0 2576418 377 0 2576419 377 0 2576420 373 0 cmp: EOF on /dev/lv_pool/lv_test
(In reply to comment #9) > can't reproduce this bug on > libvirt-0.8.2-22.el5 > kernel-2.6.18-278.el5 > > # cmp -l /dev/lv_pool/lv_test /dev/zero > 2576412 2 0 > 2576416 1 0 > 2576417 377 0 > 2576418 377 0 > 2576419 377 0 > 2576420 373 0 > cmp: EOF on /dev/lv_pool/lv_test I'll close as WORKSFORME, and please reopen if it reappears.