qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	Denis Lunev <den@virtuozzo.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "qemu-stable@nongnu.org" <qemu-stable@nongnu.org>,
	Valery Vdovin <valery.vdovin@acronis.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/1] nbd: fix NBD_CMD_CACHE negitiation according to the NBD specification
Date: Thu, 4 Oct 2018 08:49:37 -0500	[thread overview]
Message-ID: <c6223557-2ff7-4d2a-2d7b-1daf3372c34b@redhat.com> (raw)
In-Reply-To: <558261af-914a-1ea4-ef21-c7654a50284e@virtuozzo.com>

On 10/4/18 7:51 AM, Vladimir Sementsov-Ogievskiy wrote:
> 04.10.2018 15:27, Eric Blake wrote:
>> On 10/4/18 5:03 AM, Denis V. Lunev wrote:
>>> Commit bc37b06a5 was made very bad thing, it has been added
>>> NBD_FLAG_SEND_CACHE flag for negotiation.
>>
>> Oof. Probably my fault for not doing a careful review against the
>> upstream spec.
> 
> mostly my, to introduce this =(. really too bad
> 
>>
>>> The problem is that the value
>>> of the flag was taken wrong and directly violates NBD specification.
>>> This value (bit 8) is used at least in the Linux kernel as a part of
>>> stable userspace-kernel API since 4.10 as NBD_FLAG_CAN_MULTI_CONN
>>> as defined in the specification:
>>
>> And a kernel that honors that bit can cause qemu to misbehave. Yeah,
>> that's definitely undesirable.
> 
> As I understand opposite: kernel client will assume support for
> multi_conn feature which declares some guarantees about FLUSH, but qemu
> don't give these guarantees.

Yeah, that's my biggest worry - data corruption when the kernel assumes 
it can make multiple connections with consistent caching, but the 
caching is not consistent, leading to data corruption when connected to 
an unpatched qemu 3.0 server.  I'm rewording the commit message along 
those lines.


>> I'll probably amend this to list all NBD_FLAG_ values in the spec
>> (even if qemu doesn't implement them yet), just to make it easier to
>> avoid making this mistake in the future.
>>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>>
>> Will queue through my NBD tree.
>>
> 
> I vote for adding all values at least as a comment
> 
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> 
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

  parent reply	other threads:[~2018-10-04 13:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 10:03 [Qemu-devel] [PATCH 1/1] nbd: fix NBD_CMD_CACHE negitiation according to the NBD specification Denis V. Lunev
2018-10-04 12:27 ` Eric Blake
2018-10-04 12:51   ` Vladimir Sementsov-Ogievskiy
2018-10-04 13:17     ` [Qemu-devel] [PATCH 2/2] nbd: add all possible transmission flags supported by NBD Denis V. Lunev
2018-10-04 13:49     ` Eric Blake [this message]
2018-10-04 13:02 ` [Qemu-devel] [PATCH 1/1] nbd: fix NBD_CMD_CACHE negitiation according to the NBD specification Denis V.Lunev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6223557-2ff7-4d2a-2d7b-1daf3372c34b@redhat.com \
    --to=eblake@redhat.com \
    --cc=den@virtuozzo.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=valery.vdovin@acronis.com \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).