Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Aug 2005 06:17:32 +0100 (BST)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        =?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?= <des@des.no>
Cc:        freebsd-hackers@freebsd.org, kamalp@acm.org
Subject:   Re: vode to pathname
Message-ID:  <20050825061451.D11335@fledge.watson.org>
In-Reply-To: <867jeb8phr.fsf@xps.des.no>
References:  <20050824103243.47160.qmail@web52710.mail.yahoo.com> <867jeb8phr.fsf@xps.des.no>

index | next in thread | previous in thread | raw e-mail


On Wed, 24 Aug 2005, Dag-Erling Smørgrav wrote:

> "Kamal R. Prasad" <kamalpr@yahoo.com> writes:
>> So the question is, how do I get hold of pathname given
>> vnode*/(inode, devno, generation no) -without relying on the name
>> cache (on freebsd)?
>
> You can't.  The semantics of Unix file systems are such that the mapping 
> from file name to file is one-way.  Furthermore, a file can be 
> associated with more than one file name, or even none at all (if it has 
> been unlinked but is still held open by a process).

In fact, there's another troublesome edge case -- different files can also 
return the same name, if you have a way to generate names from linked 
files, due to mountpoint covering.  Covered vnodes can still be accessed 
after the mount, if they have been opened, or if the cwd of a process is a 
directory (other than the mountpoint vnode) of the covered file system, 
and an identically named node can exist in the covering file system.

Robert N M Watson
help

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