[PATCH] umsdos 2.3.99pre4-5

From: François romieu (romieu@ensta.fr)
Date: Sun Apr 09 2000 - 12:18:11 EST


Problem : changes to lookup_dentry forbid umsdos to compile.
[...]
make[2]: Entering directory `/usr/src/linux-2.3.99pre4-5/fs/umsdos'
gcc -D__KERNEL__ -I/usr/src/linux-2.3.99pre4-5/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -march=i386 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.3.99pre4-5/include/linux/modversions.h -c
-o inode.o inode.c
inode.c: In function `check_pseudo_root':
inode.c:404: warning: passing arg 2 of `lookup_dentry_Rb0910a88' makes integer from pointer without a cast
inode.c:404: too many arguments to function `lookup_dentry_Rb0910a88'
inode.c:413: warning: passing arg 2 of `lookup_dentry_Rb0910a88' makes integer from pointer without a cast
inode.c:413: too many arguments to function `lookup_dentry_Rb0910a88'

Fix (?) :
- call to lookup_dentry modified
- be it in pre4-4 or pre4-5, I haven't been able to find a place where
  current->fs->{root,pwd} can be initialized before lookup_dentry (through
  walk_init) uses it. Therefore it's now done in check_pseudo_root, right
  once we know we're trying and mount the root fs (UMSDOS_read_super calls
  shrink_dcache later thus I hope it's right).
- walk_init_root looked strange -> typo ?

Comments ?

--- linux-2.3.99pre4-5/fs/namei.c Sun Apr 9 16:36:39 2000
+++ linux/fs/namei.c Sun Apr 9 16:59:45 2000
@@ -522,7 +522,7 @@
 walk_init_root(const char *name, unsigned flags, struct nameidata *nd)
 {
         if (current->personality) {
- if (__emul_lookup_dentry(name,flags,nd));
+ if (__emul_lookup_dentry(name,flags,nd))
                         return 0;
         }
         nd->mnt = mntget(current->fs->rootmnt);

--- linux-2.3.99pre4-5/fs/umsdos/inode.c Sun Apr 9 16:35:46 2000
+++ linux/fs/umsdos/inode.c Sun Apr 9 16:59:47 2000
@@ -390,6 +390,7 @@
 static struct dentry *check_pseudo_root(struct super_block *sb)
 {
         struct dentry *root, *init;
+ struct vfsmount *vfsmnt = NULL;
 
         /*
          * Check whether we're mounted as the root device.
@@ -398,19 +399,23 @@
                 
         if (sb->s_dev != ROOT_DEV)
                 goto out_noroot;
-
-printk("check_pseudo_root: mounted as root\n");
-
- root = lookup_dentry(UMSDOS_PSDROOT_NAME, dget(sb->s_root), 0);
+ /*
+ * lookup_dentry needs a (so far non-existent) root.
+ */
+ current->fs->root = dget(sb->s_root);
+ current->fs->rootmnt = mntget(vfsmnt);
+ current->fs->pwd = dget(sb->s_root);
+ current->fs->pwdmnt = mntget(vfsmnt);
+ printk("check_pseudo_root: mounted as root\n");
+ root = lookup_dentry(UMSDOS_PSDROOT_NAME, 0);
         if (IS_ERR(root))
                 goto out_noroot;
         if (!root->d_inode)
                 goto out_dput;
-printk("check_pseudo_root: found %s/%s\n",
-root->d_parent->d_name.name, root->d_name.name);
+ printk("check_pseudo_root: found %s/%s\n", root->d_parent->d_name.name, root->d_name.name);
 
         /* look for /sbin/init */
- init = lookup_dentry("sbin/init", dget(root), 0);
+ init = lookup_dentry("sbin/init", 0);
         if (!IS_ERR(init)) {
                 if (init->d_inode)
                         goto root_ok;
@@ -420,8 +425,7 @@
         goto out_dput;
 
 root_ok:
-printk("check_pseudo_root: found %s/%s, enabling pseudo-root\n",
-init->d_parent->d_name.name, init->d_name.name);
+ printk("check_pseudo_root: found %s/%s, enabling pseudo-root\n", init->d_parent->d_name.name, init->d_name.name);
         dput(init);
         return root;
 

-- 
Ueimor

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:12 EST