[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH/RFC] block: Ensure that block size constraints a
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH/RFC] block: Ensure that block size constraints are considered |
Date: |
Wed, 21 Nov 2012 17:03:57 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 |
Il 21/11/2012 10:15, Kevin Wolf ha scritto:
>> > + if ((bs->open_flags & BDRV_O_NOCACHE)) {
>> > + bs->file->buffer_alignment = align;
>> > + }
> Any reason to restrict this to BDRV_O_NOCACHE?
>
> There have been patches to change the BDRV_O_NOCACHE flag from the
> monitor, in which case bdrv_set_buffer_alignment() wouldn't be called
> anew and O_DIRECT requests start to fail again.
>
bdrv_set_buffer_alignment() is completely broken. It should set host
alignment, but in fact it is passed the guest alignment.
In practice, we only support logical_block_size matching the host's or
bigger (which is unsafe due to torn writes, but works).
So I suggest that we just look at writes outside the device models, and
"fix" them to always read a multiple of 4k.
Paolo