Re: d_path errors

From: viro
Date: Fri Aug 06 2004 - 12:39:52 EST


On Fri, Aug 06, 2004 at 05:23:56PM +0200, Andrea Arcangeli wrote:

> on a slightly different topic, Al, could you suggest how to hack d_path
> so that it provides an absolute path with respect to the init_task root
> directory?

Simple: you don't.
a) filesystem may be mounted more than once in init_task's namespace
b) filesystem may be not mounted there at all.
c) different subtrees of filessytem might be mounted there and
full tree might be not among them; your file might be covered by some of
them.

What you are asking for is about as feasible as "I have an unlinked file.
Show me a pathname of existing link to it". The best answer will be
along the lines of "use find(1) if you are that desperate". And if
vfsmount/dentry did *not* give you an absolute pathname, you are in
situation equivalent to that.

No way in hell it's getting shoved in d_path() and I'm very sceptical
about any code that really needs that.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/