From owner-freebsd-current Wed Oct 22 20:17:26 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA23927 for current-outgoing; Wed, 22 Oct 1997 20:17:26 -0700 (PDT) (envelope-from owner-freebsd-current) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id UAA23920 for ; Wed, 22 Oct 1997 20:17:22 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.6.9) id NAA13948; Thu, 23 Oct 1997 13:14:59 +1000 Date: Thu, 23 Oct 1997 13:14:59 +1000 From: Bruce Evans Message-Id: <199710230314.NAA13948@godzilla.zeta.org.au> To: bde@zeta.org.au, karpen@ocean.campus.luth.se Subject: Re: -STABLE reboots Cc: current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >> Of course not, or it would have been fixed years ago. `mkdir foo; ln foo > >Thought that there might be such problems... > >> bar; mount foo bar' also panics. Checking inodes isn't enough either, > >Umm, but I thought hardlinking of directories were historic things used >nowadays only to scare children with? True. I should have said `ln -s foo bar' or used an alias for the name, e.g. ../tmp/foo where foo is in /tmp. >> since `mkdir foo foo/foo; mount foo/foo foo' also panics. > >Ack, the last example never occured to me. Wouldn't it help to loop through >arg1's part by part, from the root, and check the inodes against arg2's >inode, then? > > cd /a/b/x/ > mkdir y > > mount y x -> inode(a) == inode(x)? > inode(b) == inode(x)? > inode(x) == inode(x)? Yupp! Abort. > >Or is there a problem with this too? Only implementation difficulties (deadlock and races), I think. [ufs_]rename() has to do something like this. It unlocks in ufs_checkpath() to avoid deadlock and has some race bugs (it is possible (but very unlikely) for ufs_checkpath() to block and the tree to change in a harmful way). Bruce