X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Fisofs%2Finode.c;h=09e3d306e96fb298518f50bac38d4ee697b4bf8c;hb=974717012029ee36d19069c12e3c9bb13fa715a8;hp=4f5418be0590ed6d484fd628a31fc65c9c7bea71;hpb=10b275ddfd05ccb414cfe0cc56a0f47ff20fe807;p=mv-sheeva.git diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 4f5418be059..09e3d306e96 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -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; @@ -86,7 +86,7 @@ static int init_inodecache(void) sizeof(struct iso_inode_info), 0, (SLAB_RECLAIM_ACCOUNT| SLAB_MEM_SPREAD), - init_once, NULL); + init_once); if (isofs_inode_cachep == NULL) return -ENOMEM; return 0; @@ -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))