From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752080AbbAaMid (ORCPT ); Sat, 31 Jan 2015 07:38:33 -0500 Received: from metis.ext.pengutronix.de ([92.198.50.35]:34919 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750985AbbAaMia (ORCPT ); Sat, 31 Jan 2015 07:38:30 -0500 Date: Sat, 31 Jan 2015 13:38:21 +0100 From: Markus Pargmann To: Wouter Verhelst Cc: nbd-general@lists.sourceforge.net, Paul Clements , linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [Nbd] [RFC 4/4] nbd: Add support for nbd as root device Message-ID: <20150131123821.GI16879@pengutronix.de> References: <1421156665-27318-1-git-send-email-mpa@pengutronix.de> <1421156665-27318-5-git-send-email-mpa@pengutronix.de> <20150129234254.GD15853@grep.be> <20150130080400.GD16879@pengutronix.de> <20150130173014.GA16754@grep.be> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pe+tqlI1iYzVj1X/" Content-Disposition: inline In-Reply-To: <20150130173014.GA16754@grep.be> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 13:24:01 up 10 days, 2:31, 30 users, load average: 2.42, 2.32, 2.06 User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: mpa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --pe+tqlI1iYzVj1X/ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 30, 2015 at 06:30:14PM +0100, Wouter Verhelst wrote: > On Fri, Jan 30, 2015 at 09:04:00AM +0100, Markus Pargmann wrote: > > Hi, > >=20 > > On Fri, Jan 30, 2015 at 12:42:54AM +0100, Wouter Verhelst wrote: > > > Not that I'm opposed to this, but you do realize that doing nbd-client > > > from initramfs or similar is possible, right? Most initramfs > > > implementations these days support it. > >=20 > > Yes, that was the first idea how to implement a complete netboot for an > > embedded ARM device. However, an initramfs is at least around 1MB in > > size which has to be loaded using tftp. As the essential nbd-client > > connection setup and negotiation is quite small I decided to go with > > nbd-root support. > >=20 > > Also it is quite useful to have nbd-root support much like nfsroot > > directly built-in for debugging purposes. It has the big advantage of > > booting/testing read-only filesystem images for embedded systems without > > the need for an initramfs. >=20 > Fair enough, just thought I'd point it out. >=20 > When looking at your patch set, two things pop out which you should > probably look at: > - What will happen if someone boots with root-on-NBD in your scheme and > later does a pivot_root() followed by an NBD_DISCONNECT ioctl on the > device? Good point. I will look if it works or fix it otherwise. > - When a connection is started by nbd-client, the kernel creates a "pid" > file in sysfs, which contains the PID of the client and which the > client (when called with -c, or in other cases) uses to verify whether > a device is connected. At first glance, your patch does not do this, > which could cause confusion. I am actually not quite happy to expose the pid of the task that is doing the receive handling through sysfs. As it is already in the code, we can't simply remove it. But I think this should be managed by userspace if it is necessary at some point. It seems like the pid is only used for the connection status? Maybe it would be better to expose the connection status directly and deprecate the 'pid' file. >=20 > I must admit I haven't checked your patch very well (my kernel fu isn't > that advanced) so I might have missed something, but I'd rather point > it out now than have to fix the pieces afterwards ;-) Yes better to discuss it before things break :). Thanks, Markus --=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-5555 | --pe+tqlI1iYzVj1X/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUzMy9AAoJEEpcgKtcEGQQMOkP/RxLPe14IS6Lzpaz21FLScuM ecX4Q/JqYKDrxl8293tLUbVJQ8GPx4Sp2rBTByN7Ov577OJtcfBGAM2qQOvbUSka CvZPYzFGHjdTOz/nUZ+brPX1ABu80tVVW344dgF3oV4AbmGYwYAYfIdsnruqv/hx 1jTHtLyo1x3gB0J6BBrUpcOMgwr+eYyi30zYshJW5ha4p8mW6S5oEjex2U2JqWUi 3ZcLlC0e83nYEcJ9sKc038ReUfj6k50kO27BgShnd5vHYfY7H13TPOvIVa0LcHfi DBSTjtV6QpwUF2KIE5kZ3mnsYWudUxHb18v9vrASmvz8Jy/auimUerfAvtWhHpxu p0CU488rv0Ol7Skf2AWO3Og5of/HcOsULF8PIP0bx0ExzLDX3dvh9bZZ24E7FyuO N8c71X/mHTamzzpccaJX8s/pLCgghQ57qkKojr6ubBXtBoyBJ+HrsZjtG9Lr2f/Y yYKsSspI/fi2OLouZGNAO2xPR7H0LDsVx6v5um9geFrrsK8uxWkK9u9H9f1VSng2 QJGCjjWZC3k89s/iQagyzuynoly21aW8U9c7FQSFQfmYGdmILZK9YduTqkBnky54 lfQ7LrEkxXRkkwNw3enIsO8JHyseV6YsuolKWzhodzGo/GWwOqr5G81hSILh65Ck De25agooincxREzPxo4A =cPq1 -----END PGP SIGNATURE----- --pe+tqlI1iYzVj1X/--