qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

request_alignment vs file size, how to fix crash?


From: Vladimir Sementsov-Ogievskiy
Subject: request_alignment vs file size, how to fix crash?
Date: Wed, 29 Jan 2020 18:01:31 +0000

Hi!

I found a crash, which may be simply triggered for images unaligned to 
request_alignment:

# ./qemu-io --image-opts -c 'write 0 512' 
driver=blkdebug,align=4096,image.driver=null-co,image.size=512
qemu-io: block/io.c:1505: bdrv_aligned_pwritev: Assertion `end_sector <= 
bs->total_sectors || child->perm & BLK_PERM_RESIZE' failed.
Aborted (core dumped)

The problem is obvious: 512 is aligned to 4096 and becomes larger than file 
size.

I faced it after rebasing our downstream branches to newer Rhel versions. Seems 
that after some updates of alignment detection in file-posix.c, it started to 
detect 4096 alignment in our build environment, and iotest 152 started to crash 
(as it operates on file of 512 bytes).

My question is:

What is wrong? Should we restrict images to be aligned to request_alignment, or 
allow unaligned operations at EOF, if file is unaligned itself?

-- 
Best regards,
Vladimir

reply via email to

[Prev in Thread] Current Thread [Next in Thread]