All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Unaligned images with O_DIRECT
@ 2019-05-14 15:06 Max Reitz
  2019-05-14 15:45 ` Eric Blake
  0 siblings, 1 reply; 5+ messages in thread
From: Max Reitz @ 2019-05-14 15:06 UTC (permalink / raw)
  To: Qemu-block; +Cc: Kevin Wolf, qemu-devel

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

Hi,

Unaligned images don’t work so well with O_DIRECT:

$ echo > foo
$ qemu-img map --image-opts driver=file,filename=foo,cache.direct=on
Offset          Length          Mapped to       File
qemu-img: block/io.c:2093: bdrv_co_block_status: Assertion `*pnum &&
QEMU_IS_ALIGNED(*pnum, align) && align > offset - aligned_offset' failed.
[1]    10954 abort (core dumped)  qemu-img map --image-opts
driver=file,filename=foo,cache.direct=on

(compare https://bugzilla.redhat.com/show_bug.cgi?id=1588356)

This is because the request_alignment is 512 (in my case), but the EOF
is not aligned accordingly, so raw_co_block_status() returns an aligned
*pnum.

I suppose having an unaligned tail is not so bad and maybe we can just
adjust the assertion accordingly.  On the other hand, this has been
broken for a while.  Does it even make sense to use O_DIRECT with
unaligned images?  Shouldn’t we just reject them outright?

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2019-05-14 21:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-14 15:06 [Qemu-devel] Unaligned images with O_DIRECT Max Reitz
2019-05-14 15:45 ` Eric Blake
2019-05-14 16:15   ` Max Reitz
2019-05-14 17:28     ` Max Reitz
2019-05-14 21:36       ` Eric Blake

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.