Received: from eggs.gnu.org ([2001:4830:134:3::10]:60764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apV0q-0005am-RF for qemu-devel@nongnu.org; Mon, 11 Apr 2016 02:07:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1apV0p-0000yO-Nn for qemu-devel@nongnu.org; Mon, 11 Apr 2016 02:07:52 -0400 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]:32801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apV0p-0000yK-DN for qemu-devel@nongnu.org; Mon, 11 Apr 2016 02:07:51 -0400 From: Markus Pargmann Date: Mon, 11 Apr 2016 08:07:37 +0200 Message-ID: <6011872.zPbqr8ofCJ@galactica> In-Reply-To: <20160405205051.GC13913@grep.be> References: <1459787950-15286-1-git-send-email-eblake@redhat.com> <5703C829.8070306@redhat.com> <20160405205051.GC13913@grep.be> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1534558.fBvOPebCLE"; micalg="pgp-sha256"; protocol="application/pgp-signature" Subject: Re: [Qemu-devel] [Nbd] [PATCH v2] doc: Add NBD_CMD_BLOCK_STATUS extension List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wouter Verhelst Cc: Eric Blake , nbd-general@lists.sourceforge.net, Kevin Wolf , qemu-devel@nongnu.org, Pavel Borzenkov , Stefan Hajnoczi , "Denis V. Lunev" , Paolo Bonzini --nextPart1534558.fBvOPebCLE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Tuesday 05 April 2016 22:50:51 Wouter Verhelst wrote: > On Tue, Apr 05, 2016 at 08:14:01AM -0600, Eric Blake wrote: > > On 04/05/2016 03:24 AM, Markus Pargmann wrote: > >=20 > > >> + requested. > > >> + > > >> + The client SHOULD NOT read from an area that has both > > >> + `NBD_STATE_HOLE` set and `NBD_STATE_ZERO` clear. > > >=20 > > > Why not? If we don't execute CMD_BLOCK_STATUS we wouldn't know ab= out the > > > situation and would simply read directly. To fulfill this stateme= nt we > > > would need to receive the block status before every read operatio= n. > >=20 > > Because we already state that for NBD_CMD_TRIM, the client SHOULD N= OT > > read an area where a trim was requested without an intervening writ= e, >=20 > Actually, we state that a client SHOULD NOT *make any assumption* abo= ut > the state (emphasis added). There's a difference. >=20 > If the client wants to write, there is no problem (but he'll probably= > get garbage). >=20 > [...] > > > Also something that is kind of missing from the document so far i= s > > > concurrency with other NBD clients. Certainly most users do not u= se NBD > > > for concurrent access to the backend storage. But for example the= > > > sentence above ignores the fact that another client may work on t= he > > > backend and that the state may change after some time so that it = may > > > still be necessary to read from an area with NBD_STATE_HOLE and > > > NBD_STATE_ZERO set. > >=20 > > That's missing from NBD in general, and I don't think this is the p= atch > > to add it. We already have concurrency with self issues, because N= BD > > server can handle requests out of order (within the bounds of FLUSH= and > > FUA modifiers). >=20 > I don't think NBD *needs* to add much in the way of concurrency, othe= r > than write barriers etc; but having an explicit message "some other > process just modified offset X length Y" seems out of scope for NBD. Yes it certainly is out of scope to add explicit messages for concurren= cy. I only thought about some general information for the reader to have a sm= all paragraph in the protocol documentation that states that concurrent acc= ess can occur at all times and that no assumptions can be made about the state = of the server and its backend storage at any times. >=20 > > > Also it is uncertain if these status bits may change over time th= rough > > > reorganization of backend storage, for example holes may be remov= ed in > > > the backend and so on. Is it safe to cache this stuff? > >=20 > > If the client is the only thing modifying the drive, maybe we want = to > > make that additional constraint on the server. But how best to wor= d it, > > or is it too tight of a specification? >=20 > I think it's perfectly fine for the protocol to assume in general tha= t > the client is the only writer, and that no other writers are > concurrently accessing the same device. Anything else would make the > protocol much more complex; and one of the features of NBD is, I thin= k, > the fact that the protocol is not *too* complex. Yes this definitely is a feature. I just think that concurrent access w= as always possible and we should not by accident remove that possibility. = But as far as I can see that's not an issue here. Best Regards, Markus =2D-=20 Pengutronix e.K. | = | Industrial Linux Solutions | http://www.pengutronix.de/= | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 = | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-555= 5 | --nextPart1534558.fBvOPebCLE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJXCz8pAAoJECi9+rkzbKwyZS8P/RiBSGsOJ7eCF3bb1vXurdlw dInZWKojhwhd+LaK5amoHulss4QlKdXOrP2xDShVSp+kg4RGSmTcBV7kx+D3LmNe kamzYQ00l5bFm17WW1Wykayxq9hWWI73M1Mf5qSwsknmx4GUsBRN8zshxgskOV1b lShuNBxhlKf8jPmjqwpIG9dyc0ZAirRYViv84j/Ibit5eQdB7Nj+bxdnSCapgzPP SwRk5SRUYsWB9k/GQbatBh8IR07q7kx/nMjrC/JvOe1+SSpIxgiND1QQRuaN4Zvy hicNsuwX6WOZWGYFarKQ27Sv69GizFuagxktK09MrUdAnyssjyZOGf/p+tnSONR9 NSdxj/hIVrC/DMhpcEtpA3zVE1L576F3gqOO8CWohaON0BCQ3q2uOR+vTQlMf05B MGDaL/CI3ESbKNYeYtJOBvCONSHkxwAha3O/1+RWNTo0fTWbLEG31FzfbVLggmBI o2N89I6m8Zn7x017rVefq5Fs63zhdJRkSBplUYFMavq2jgArV0o5Xqr+t86euICw 6IWtOfBzVTK3b9OoqdH+0RBMqEyuuW0xUz++s7vIwP+DSwQVWTTxm0Zrw/DZs3lq 14SVI5RD0T1Q8VPoEWQONlLY7dCsP7PZeMZKIrok8O2PiIBN33/GNIEBB6oGyD8t sJdNN6s+0KJQwt30DxlZ =1G6R -----END PGP SIGNATURE----- --nextPart1534558.fBvOPebCLE--