Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Oct 1997 13:14:59 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, karpen@ocean.campus.luth.se
Cc:        current@FreeBSD.ORG
Subject:   Re: -STABLE reboots
Message-ID:  <199710230314.NAA13948@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710230314.NAA13948>