]> err.no Git - linux-2.6/commitdiff
[GFS2] panic after can't parse mount arguments
authorAbhijith Das <adas@redhat.com>
Thu, 23 Aug 2007 18:33:01 +0000 (13:33 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Wed, 10 Oct 2007 07:55:46 +0000 (08:55 +0100)
When you try to mount gfs2 with -o garbage, the mount fails and the gfs2
superblock is deallocated and becomes NULL. The vfs comes around later
on and calls gfs2_kill_sb. At this point the hidden gfs2 superblock
pointer (sb->s_fs_info) is NULL and dereferencing it through
gfs2_meta_syncfs causes the panic. (the other function call to
gfs2_delete_debugfs_file() succeeds because this function already checks
for a NULL pointer)

Signed-off-by: Abhijith Das <adas@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/ops_fstype.c

index 9e0e9be1e41ddc4d973ca5515496401c3d97e77a..314c1134d12df623ff7c5713de0153ba0bf535f6 100644 (file)
@@ -887,8 +887,10 @@ error:
 
 static void gfs2_kill_sb(struct super_block *sb)
 {
-       gfs2_delete_debugfs_file(sb->s_fs_info);
-       gfs2_meta_syncfs(sb->s_fs_info);
+       if (sb->s_fs_info) {
+               gfs2_delete_debugfs_file(sb->s_fs_info);
+               gfs2_meta_syncfs(sb->s_fs_info);
+       }
        kill_block_super(sb);
 }