linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Bligh <alex@alex.org.uk>
To: Josef Bacik <jbacik@fb.com>
Cc: Alex Bligh <alex@alex.org.uk>,
	Christoph Hellwig <hch@infradead.org>,
	Wouter Verhelst <w@uter.be>, Jens Axboe <axboe@fb.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	Kernel Team <Kernel-team@fb.com>,
	"nbd-general@lists.sourceforge.net" 
	<nbd-general@lists.sourceforge.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Nbd] [PATCH][V3] nbd: add multi-connection support
Date: Mon, 3 Oct 2016 15:46:53 +0100	[thread overview]
Message-ID: <A8EF4CD3-61BC-4E29-8796-1013FDBC96F1@alex.org.uk> (raw)
In-Reply-To: <5cf31839-3642-166a-55ab-8d4313025b0c@fb.com>

Josef,

> On 3 Oct 2016, at 15:32, Josef Bacik <jbacik@fb.com> wrote:
> 
> Ok I understand your objections now.  You aren't arguing that we are unsafe by default, only that we are unsafe with servers that do something special beyond simply writing to a single disk or file.  I agree this is problematic, but you simply don't use this feature if your server can't deal with it well.

Not quite. I am arguing that:

1. Parallel channels as currently implemented are inherently unsafe on some servers - I have given an example of such servers

2. Parallel channels as currently implemented may be unsafe on the reference server on some or all platforms (depending on the behaviour of fdatasync() which might varies between platforms)

3. Either the parallel channels stuff should issue flush requests on all channels, or the protocol should protect the unwitting user by negotiating an option to do so (or refusing multi-channel connects). It is not reasonable for an nbd client to have to know the intimate details of the server and its implementation of synchronisation primitives - saying 'the user should disable multiple channels' is not good enough, as this is what we have a protocol for.

"unsafe" here means 'do not conform to the kernel's requirements for flush semantics, whereas they did without multiple channels'

So from my point of view either we need to have an additional connection flag ("don't use multiple channels unless you are going to issue a flush on all channels") OR flush on all channels should be the default.

Whatever SOME more work needs to be done on your patch because there it current doesn't issue flush on all channels, and it currently does not have any way to prevent use of multiple channels.


I'd really like someone with linux / POSIX knowledge to confirm the linux and POSIX position on fdatasync of an fd opened by one process on writes made to the same file by another process. If on all POSIX platforms and all filing systems this is guaranteed to flush the second platform's writes, then I think we could argue "OK there may be some weird servers which might not support multiple channels and they just need a way of signalling that". If on the other hand there is no such cross platform guarantee, I think this means in essence even with the reference server, this patch is unsafe, and it needs adapting to send flushes on all channels - yes it might theoretically be possible to introduce IPC to the current server, but you'd still need some way of tying together channels from a single client.

-- 
Alex Bligh

  reply	other threads:[~2016-10-03 14:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-28 20:01 [PATCH][V3] nbd: add multi-connection support Josef Bacik
2016-09-29  9:52 ` [Nbd] " Wouter Verhelst
2016-09-29 14:03   ` Josef Bacik
2016-09-29 16:41     ` Wouter Verhelst
2016-09-29 16:59       ` Josef Bacik
2016-10-02 16:17         ` Alex Bligh
2016-10-03  1:47           ` Josef Bacik
2016-10-03  7:20             ` Christoph Hellwig
2016-10-03  7:51               ` Wouter Verhelst
2016-10-03  7:57                 ` Christoph Hellwig
2016-10-03 11:34                   ` Alex Bligh
2016-10-03 14:32                     ` Josef Bacik
2016-10-03 14:46                       ` Alex Bligh [this message]
2016-10-03 21:07                     ` Wouter Verhelst
2016-10-04  9:35                       ` Alex Bligh
2016-10-06  9:04                         ` Wouter Verhelst
2016-10-06  9:41                           ` Alex Bligh
2016-10-06 10:15                             ` Wouter Verhelst
2016-10-06 11:04                               ` Alex Bligh
2016-10-06 10:31                           ` Christoph Hellwig
2016-10-06 13:09                             ` Wouter Verhelst
2016-10-06 13:16                               ` Christoph Hellwig
2016-10-06 13:55                                 ` Wouter Verhelst
2016-10-03  7:49           ` Wouter Verhelst
2016-10-11  9:00 ` Sagi Grimberg

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=A8EF4CD3-61BC-4E29-8796-1013FDBC96F1@alex.org.uk \
    --to=alex@alex.org.uk \
    --cc=Kernel-team@fb.com \
    --cc=axboe@fb.com \
    --cc=hch@infradead.org \
    --cc=jbacik@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nbd-general@lists.sourceforge.net \
    --cc=w@uter.be \
    /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).