* __emul_prefix() problem
@ 2001-09-17 23:51 David Mosberger
2001-09-18 10:23 ` [Linux-ia64] " Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: David Mosberger @ 2001-09-17 23:51 UTC (permalink / raw)
To: viro, torvalds, linux, ralf; +Cc: linux-kernel, linux-ia64
I have been toying with __emul_prefix() on ia64 linux as a means to
deal with x86 programs that use absolute paths when loading shared
objects (such as PAM or the GTK themes). This works quite well, but
it breaks the traditional UNIX way of translating a relative path
into an absolute path. The OpenOffice installer does this, for
example. What happens precisely is that the installer attempts to
create an absolute path by stat()ing "/." and then walking the parent
directory chain until it finds the directory entry with a matching
i-node number. This doesn't work because if an x86 binary stat()s
this path, it will get the i-node number of /emul/ia32-linux/ (in the
ia64 linux case) and things quickly go downhill from there.
I'm not sure there is a clean fix to this, but one proposal is
attached below: it causes __emul_lookup_dentry() to ignore the
alternate root for paths that resolve to a directory. This obviously
could create other problems, but I suspect there is no solution that
works 100% in all cases (the fundamental being that we now have two
different root nodes...).
Comments?
--david
PS: I cc'd all the platform maintainers that use a non-NULL
emul_prefix, except for Dave Miller who in private mail indicated
that he doesn't care about this problem
--- fs/namei.c~ Sat Jul 21 20:20:40 2001
+++ fs/namei.c Mon Sep 17 15:10:20 2001
@@ -604,10 +604,14 @@
static int __emul_lookup_dentry(const char *name, struct nameidata *nd)
{
if (path_walk(name, nd))
- return 0;
+ return 0; /* something went wrong... */
- if (!nd->dentry->d_inode) {
+ if (!nd->dentry->d_inode || S_ISDIR(nd->dentry->d_inode->i_mode)) {
struct nameidata nd_root;
+ /*
+ * NAME was not found in alternate root or it's a directory. Try to find
+ * it in the normal root:
+ */
nd_root.last_type = LAST_ROOT;
nd_root.flags = nd->flags;
read_lock(¤t->fs->lock);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Linux-ia64] __emul_prefix() problem
2001-09-17 23:51 __emul_prefix() problem David Mosberger
@ 2001-09-18 10:23 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2001-09-18 10:23 UTC (permalink / raw)
To: David Mosberger; +Cc: viro, torvalds, linux, ralf, linux-kernel, linux-ia64
On Mon, Sep 17, 2001 at 04:51:11PM -0700, David Mosberger wrote:
> I'm not sure there is a clean fix to this, but one proposal is
> attached below: it causes __emul_lookup_dentry() to ignore the
> alternate root for paths that resolve to a directory. This obviously
> could create other problems, but I suspect there is no solution that
> works 100% in all cases (the fundamental being that we now have two
> different root nodes...).
Looks sant to me and doesn't break Linux-ABI. For 2.5 I'd prefer
to somehow build a per-personality namespace. Al, do you have an
idea how to keep a secondary namespace alive over the whole uptime
so non-Linu binaries can switch to it all the time (implicitly)?
Christoph
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-09-18 10:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-17 23:51 __emul_prefix() problem David Mosberger
2001-09-18 10:23 ` [Linux-ia64] " Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox