From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762885AbbA3Rar (ORCPT ); Fri, 30 Jan 2015 12:30:47 -0500 Received: from barbershop.grep.be ([89.106.240.122]:33953 "EHLO barbershop.grep.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762739AbbA3RaV (ORCPT ); Fri, 30 Jan 2015 12:30:21 -0500 Date: Fri, 30 Jan 2015 18:30:14 +0100 From: Wouter Verhelst To: Markus Pargmann 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: <20150130173014.GA16754@grep.be> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150130080400.GD16879@pengutronix.de> X-Speed: Gates' Law: Every 18 months, the speed of software halves. Organization: none User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 30, 2015 at 09:04:00AM +0100, Markus Pargmann wrote: > Hi, > > 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. > > 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. > > 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. Fair enough, just thought I'd point it out. 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? - 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 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 ;-) -- It is easy to love a country that is famous for chocolate and beer -- Barack Obama, speaking in Brussels, Belgium, 2014-03-26