qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* do_fallocate with (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) is not necessary when allocate a new qcow2 cluster
@ 2020-12-22  0:23 ChangLimin
  0 siblings, 0 replies; only message in thread
From: ChangLimin @ 2020-12-22  0:23 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

From commit https://git.qemu.org/?p=qemu.git;a=commit;h=c8bb23cbdbe32f5c326365e0a82e1b0e68cdcd8a 
for qcow2 file in ocfs2 filesystem, do_fallocate with (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) 
will be called when allocate a new cluster.  It's not necessary and also cause data error.

1. create a ocfs2 cluster and   `mkfs.ocfs2 -b 4k -C 1M -N 2 /dev/sdb1`  then `mount /dev/sdb1 /mnt`
2. qemu-img create -f qcow2 -o cluster_size=256k /mnt/test.img 1G
3. attach /mnt/test.img to a linux vm as vdb
4. in vm, `dd if=/root/foo of=/dev/vdb bs=4k count=1` 
5. `hexdump -C /dev/vdb -n 4096`   the output is not identical to the file /root/foo

After remove do_fallocate with (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) in handle_aiocb_write_zeroes , 
it's good.

Chang Limin

[-- Attachment #2: Type: text/html, Size: 1340 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-22  0:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-22  0:23 do_fallocate with (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) is not necessary when allocate a new qcow2 cluster ChangLimin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).