qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* request_alignment vs file size, how to fix crash?
@ 2020-01-29 18:01 Vladimir Sementsov-Ogievskiy
  2020-01-30 10:40 ` Vladimir Sementsov-Ogievskiy
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2020-01-29 18:01 UTC (permalink / raw)
  To: qemu block; +Cc: Kevin Wolf, Denis Lunev, qemu-devel, Max Reitz

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-01-30 12:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-29 18:01 request_alignment vs file size, how to fix crash? Vladimir Sementsov-Ogievskiy
2020-01-30 10:40 ` Vladimir Sementsov-Ogievskiy
2020-01-30 11:11   ` Kevin Wolf
2020-01-30 11:30     ` Vladimir Sementsov-Ogievskiy
2020-01-30 12:12       ` Kevin Wolf

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).