]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/isofs/inode.c
[ARM] 4602/3: AT91: debugfs interface to view GPIO pin state
[linux-2.6-omap-h63xx.git] / fs / isofs / inode.c
index 95c72aa818677b9ced909477aa80deedbd9232bb..09e3d306e96fb298518f50bac38d4ee697b4bf8c 100644 (file)
@@ -3,7 +3,7 @@
  *
  *  (C) 1991  Linus Torvalds - minix filesystem
  *      1992, 1993, 1994  Eric Youngdale Modified for ISO 9660 filesystem.
- *      1994  Eberhard Moenkeberg - multi session handling.
+ *      1994  Eberhard Mรถnkeberg - multi session handling.
  *      1995  Mark Dobie - allow mounting of some weird VideoCDs and PhotoCDs.
  *     1997  Gordon Chaffee - Joliet CDs
  *     1998  Eric Lammerts - ISO 9660 Level 3
@@ -73,7 +73,7 @@ static void isofs_destroy_inode(struct inode *inode)
        kmem_cache_free(isofs_inode_cachep, ISOFS_I(inode));
 }
 
-static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
+static void init_once(struct kmem_cache *cachep, void *foo)
 {
        struct iso_inode_info *ei = foo;
 
@@ -846,6 +846,15 @@ root_found:
                goto out_no_root;
        if (!inode->i_op)
                goto out_bad_root;
+
+       /* Make sure the root inode is a directory */
+       if (!S_ISDIR(inode->i_mode)) {
+               printk(KERN_WARNING
+                       "isofs_fill_super: root inode is not a directory. "
+                       "Corrupted media?\n");
+               goto out_iput;
+       }
+
        /* get the root dentry */
        s->s_root = d_alloc_root(inode);
        if (!(s->s_root))