qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2] block: Reject misaligned write requests with BDRV_REQ_NO_


From: Alberto Garcia
Subject: Re: [PATCH v2] block: Reject misaligned write requests with BDRV_REQ_NO_FALLBACK
Date: Mon, 14 Oct 2019 13:22:47 +0200
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Mon 14 Oct 2019 11:26:01 AM CEST, Kevin Wolf wrote:
>> Signed-off-by: Alberto Garcia <address@hidden>
>
> Thanks, applied to the block branch.

I'm a bit late now, but a possible trivial optimization is to flip the
conditions, because checking the flag should be faster than checking the
alignment and it's going to be false in almost all cases:

    if ((flags & BDRV_REQ_NO_FALLBACK) &&
        !QEMU_IS_ALIGNED(offset | bytes, align)) {
        return -ENOTSUP;
    }

Feel free to edit the commit if you want.

Berto



reply via email to

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