From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: pivotroot does not work with initramfs Date: Sat, 22 Nov 2003 21:48:54 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20031122204854.GA9512@suse.de> References: <20031116170438.GA4466@suse.de> <20031122164608.GA8009@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from ns.suse.de ([195.135.220.2]:8164 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S262766AbTKVUs4 (ORCPT ); Sat, 22 Nov 2003 15:48:56 -0500 Received: from Hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 90A1C18324E0 for ; Sat, 22 Nov 2003 21:48:55 +0100 (CET) To: linux-fsdevel@vger.kernel.org Content-Disposition: inline In-Reply-To: <20031122164608.GA8009@suse.de> List-Id: linux-fsdevel.vger.kernel.org On Sat, Nov 22, Olaf Hering wrote: > On Sun, Nov 16, Olaf Hering wrote: >=20 > >=20 > > I cant remount the root filesystem rw, mounting proc doesnt work ei= ther, > > mount hangs, no userinput possible. System is a old powermac. > > It seems pivotroot is either broken, or I dont use it correctly. >=20 > Maybe I'm doing something stupid, or there is no obvious RTMF about h= ow > to use kinit from klibc properly. bootargs are: >=20 > console=3DttyS0,38400 rw ip=3Deth0 root=3D/dev/nfs nfsroot=3D192.168.= 1.2:/nfsroot/mac kinit=3D/bin/kinit >=20 > kinit does a pivot_root and returns. prepare_namespace() does > sys_mount(".", "/", NULL, MS_MOVE, NULL); > which leads to this loop: >=20 > check_mnt(103)+ swapper c47f51e0 c47f54a0 > 0 c47f51e0 192.168.1.2:/nfsroot/mac c47f54a0 rootfs > 1 c47f54a0 rootfs c47f51e0 192.168.1.2:/nfsroot/mac > 2 c47f51e0 192.168.1.2:/nfsroot/mac c47f54a0 rootfs > 3 c47f54a0 rootfs c47f51e0 192.168.1.2:/nfsroot/mac > 4 c47f51e0 192.168.1.2:/nfsroot/mac c47f54a0 rootfs > ... This seems to cure it. --- linuxppc-2.5_2.6.0-test9-bk.orig/fs/namespace.c 2003-10-08 03:5= 2:02.000000000 +0200 +++ linuxppc-2.5_2.6.0-test9-bk/fs/namespace.c 2003-11-22 21:46:27.000= 000000 +0100 @@ -99,6 +99,7 @@ EXPORT_SYMBOL(lookup_mnt); static int check_mnt(struct vfsmount *mnt) { spin_lock(&vfsmount_lock); + if(mnt->mnt_parent->mnt_parent !=3D mnt) while (mnt->mnt_parent !=3D mnt) mnt =3D mnt->mnt_parent; spin_unlock(&vfsmount_lock); --=20 USB is for mice, FireWire is for men! sUse lINUX ag, n=C3=9CRNBERG - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html