qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Don't lose FUA flag during


From: Kevin Wolf
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH] block: Don't lose FUA flag during ZERO_WRITE fallback
Date: Tue, 3 May 2016 09:55:35 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 02.05.2016 um 19:14 hat Eric Blake geschrieben:
> On 05/02/2016 09:42 AM, Eric Blake wrote:
> > On 05/02/2016 09:35 AM, Kevin Wolf wrote:
> >> Am 30.04.2016 um 23:48 hat Eric Blake geschrieben:
> >>> NBD has situations where it can support FUA but not ZERO_WRITE;
> >>> when that happens, the generic block layer fallback was losing
> >>> the FUA flag.  The problem of losing flags unrelated to
> >>> ZERO_WRITE has been latent in bdrv_co_do_write_zeroes() since
> >>> aa7bfbff, but back then, it did not matter because there was no
> >>> FUA flag.  But ever since 93f5e6d8 added bdrv_co_writev_flags(),
> >>> the loss of flags can impact correctness.
> >>>
> > 
> 
> >> then we still don't get the necessary flush unless the driver's
> >> .bdrv_co_write_zeroes() implementation explicitly handles FUA. As far as
> >> I know, we don't have any driver that implements FUA there.
> > 
> > NBD will, once we get to that part of my series.
> 
> And looking further, it looks like SCSI does NOT support FUA during
> WRITESAME(10/16), only during WRITE(10/16).  Which means we probably
> want to start having both .supported_write_flags AND
> .supported_write_zero flags, so that at least the iscsi driver can
> properly report that it does NOT natively support FUA on a write_zeroes
> request.

Hm, not sure if it makes sense, but let me write that thought down:

You're going to convert .supported_write_flags to a function anyway.
Instead of adding a second function, how about passing a set of flags
there and the function returns a subset that it can support? For write
zeroes with FUA you would pass in BDRV_REQ_ZERO_WRITE | BDRV_REQ_FUA and
in this case the iscsi driver would return only BDRV_REQ_ZERO_WRITE.

If we ever decided to get rid of .bdrv_co_write_zeroes() and instead use
.bdrv_co_pwritev() with BDRV_REQ_ZERO_WRITE, this would probably be the
most consistent interface.

Kevin

Attachment: pgpeOlo8WiMoF.pgp
Description: PGP signature


reply via email to

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