--- ./fs/namei.c.orig 2005-03-23 21:34:32 +0100 +++ ./fs/namei.c 2005-03-25 20:29:35 +0100 @@ -450,6 +450,18 @@ static struct dentry * real_lookup(struc return result; } + +static void dump_dpath(char *str, struct dentry *de, struct vfsmount *mnt) +{ + static char buf[1024], *p; + + p = d_path(de, mnt, buf, sizeof(buf)); + if (IS_ERR(p)) + printk("%s\t[%p,%p] \n", str, mnt, de); + else + printk("%s\t[%p,%p] »%s«\n", str, mnt, de, p); +} + static int __emul_lookup_dentry(const char *, struct nameidata *); /* SMP-safe */ @@ -581,6 +593,8 @@ int follow_up(struct vfsmount **mnt, str static int follow_mount(struct vfsmount **mnt, struct dentry **dentry) { int res = 0; + + dump_dpath("follow_mount()", *dentry, *mnt); while (d_mountpoint(*dentry)) { struct vfsmount *mounted = lookup_mnt(*mnt, *dentry); if (!mounted) @@ -589,6 +603,7 @@ static int follow_mount(struct vfsmount *mnt = mounted; dput(*dentry); *dentry = dget(mounted->mnt_root); + dump_dpath(" ··· lookup", *dentry, *mnt); res = 1; } return res; @@ -619,6 +634,7 @@ int follow_down(struct vfsmount **mnt, s static inline void follow_dotdot(struct vfsmount **mnt, struct dentry **dentry) { + dump_dpath("follow_dotdot()", *dentry, *mnt); while(1) { struct vfsmount *parent; struct dentry *old = *dentry; @@ -626,6 +642,7 @@ static inline void follow_dotdot(struct read_lock(¤t->fs->lock); if (*dentry == current->fs->root && *mnt == current->fs->rootmnt) { + printk(" ··· current root\n"); read_unlock(¤t->fs->lock); break; } @@ -634,6 +651,7 @@ static inline void follow_dotdot(struct if (*dentry != (*mnt)->mnt_root) { *dentry = dget((*dentry)->d_parent); spin_unlock(&dcache_lock); + dump_dpath(" ··· parent", *dentry, *mnt); dput(old); break; } @@ -642,15 +660,18 @@ static inline void follow_dotdot(struct parent = (*mnt)->mnt_parent; if (parent == *mnt) { spin_unlock(&vfsmount_lock); + dump_dpath(" ··· mnt_parent", *dentry, parent); break; } mntget(parent); *dentry = dget((*mnt)->mnt_mountpoint); spin_unlock(&vfsmount_lock); + dump_dpath(" ··· mountpoint", *dentry, parent); dput(old); mntput(*mnt); *mnt = parent; } + printk(" ··· follow_mount()\n"); follow_mount(mnt, dentry); }