lkml.org 
[lkml]   [1997]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: eject /dev/cdrom --> oops. (patch)
Date
From

Apparently the problem was caused by trying to mount my IDE cd when the drive
was empty. The vfsmntlist was ending up with an entry in which xxx->mnt_sb->
s_type == NULL, so the references to tmp->mnt_sb->s_type->name in
get_filesystem_info weren't particularly happy.

This isn't a real fix, but at least it stops the oopses by checking for that
case and not attempting to dereference the pointer. I believe the real problem
is in the CD drivers - attempting to mount an empty floppy drive doesn't
produce the same problems.

This is against the vger snapshot of 971020. When's the next one due?
--- linux/fs/super.c.orig Sat Oct 18 05:12:08 1997
+++ linux/fs/super.c Wed Oct 29 02:18:49 1997
@@ -331,7 +331,8 @@
while ( tmp && len < PAGE_SIZE - 160)
{
len += sprintf( buf + len, "%s %s %s %s",
- tmp->mnt_devname, tmp->mnt_dirname, tmp->mnt_sb->s_type->name,
+ tmp->mnt_devname, tmp->mnt_dirname,
+ tmp->mnt_sb->s_type?tmp->mnt_sb->s_type->name:"BUG!",
tmp->mnt_flags & MS_RDONLY ? "ro" : "rw" );
for (fs_infop = fs_info; fs_infop->flag; fs_infop++) {
if (tmp->mnt_flags & fs_infop->flag) {
@@ -339,7 +340,7 @@
len += strlen(fs_infop->str);
}
}
- if (!strcmp("nfs", tmp->mnt_sb->s_type->name)) {
+ if (tmp->mnt_sb->s_type && !strcmp("nfs", tmp->mnt_sb->s_type->name)) {
nfss = &tmp->mnt_sb->u.nfs_sb.s_server;
if (nfss->rsize != NFS_DEF_FILE_IO_BUFFER_SIZE) {
len += sprintf(buf+len, ",rsize=%d",
\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.058 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site