public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] __emul_prefix() problem
Date: Mon, 17 Sep 2001 23:51:11 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590698805196@msgid-missing> (raw)

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(&current->fs->lock);



             reply	other threads:[~2001-09-17 23:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-17 23:51 David Mosberger [this message]
2001-09-18 10:23 ` [Linux-ia64] __emul_prefix() problem Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-ia64-105590698805196@msgid-missing \
    --to=davidm@hpl.hp.com \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox