aboutsummaryrefslogtreecommitdiff
path: root/fs/isofs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/isofs/inode.c')
-rw-r--r--fs/isofs/inode.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 95c72aa8186..043b470fd3b 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -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))