From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, hreitz@redhat.com,
kwolf@redhat.com
Subject: Re: [RFC for-6.2] block/nbd: forbid incompatible change of server options on reconnect
Date: Mon, 29 Nov 2021 23:49:33 +0300 [thread overview]
Message-ID: <671e28a1-b7cf-d0a5-ff7f-c8f0d323d0a8@virtuozzo.com> (raw)
In-Reply-To: <20211129191606.4cnbnjpsoywgxeq7@redhat.com>
29.11.2021 22:16, Eric Blake wrote:
> On Wed, Nov 24, 2021 at 03:09:51PM +0100, Vladimir Sementsov-Ogievskiy wrote:
>> Reconnect feature was never prepared to handle server options changed
>> on reconnect. Let's be stricter and check what exactly is changed. If
>> server capabilities just got richer don't worry. Otherwise fail and
>> drop the established connection.
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> ---
>> + /*
>> + * No worry if rotational status changed. But other flags are feature flags,
>> + * they should not degrade.
>> + */
>> + dropped_flags = (old->flags & ~new->flags) & ~NBD_FLAG_ROTATIONAL;
>> + if (dropped_flags) {
>> + error_setg(errp, "Server options degrade after reconnect: flags 0x%"
>> + PRIx32 " are not reported anymore", dropped_flags);
>> + return false;
>> + }
>
> Your logic is good for most flags, but somewhat wrong for
> NBD_FLAG_READ_ONLY_BIT. For cases where we are only using the block
> device read-only, we don't care about changes of that bit, in either
> direction. But for cases where we want to use the block device
> read-write, the bit changing from clear in the old to set in the new
> server is an incompatible change that your logic failed to flag.
>
Oh right! Will fix it and resend soon.
--
Best regards,
Vladimir
prev parent reply other threads:[~2021-11-29 20:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-24 14:09 [RFC for-6.2] block/nbd: forbid incompatible change of server options on reconnect Vladimir Sementsov-Ogievskiy
2021-11-29 17:34 ` Eric Blake
2021-11-29 20:47 ` Vladimir Sementsov-Ogievskiy
2021-11-29 19:16 ` Eric Blake
2021-11-29 20:49 ` Vladimir Sementsov-Ogievskiy [this message]
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=671e28a1-b7cf-d0a5-ff7f-c8f0d323d0a8@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).