lkml.org 
[lkml]   [1997]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: 2.1.49 oops.
Edward Welbon wrote:
>
> Two oopses, the first occurs durring boot in rc.S. I use initrd
> and one of the first actions of rc.S is to unmount the initial
> ram disk. This oopses with a negative d_count.

OK, now I see what's going on ... do_change_root is unmounting something
that doesn't need unmounting, and doing the mount twice.

I'll bet all of the kswapd etc. oops are on kernels using initrd ...

The attached patch should fix the problem. The first printk should
report d_count=2, we do one dput, then mount the old root on the new
directory.

>
> The second occurs randomly when starting a new shell. Couldn't
> see any pattern, the oops is:

This is probably just remaining corruption from the first problem.

Regards,
Bill--- fs/super.c.old Tue Aug 12 07:49:18 1997
+++ fs/super.c Wed Aug 13 17:17:46 1997
@@ -1118,6 +1134,8 @@
dput(dir_d);
error = -ENOTDIR;
}
+ printk("do_change_root: old root d_count=%d\n", old_root->d_count);
+ dput(old_root);
dput(old_pwd);
if (error) {
int umount_error;
@@ -1133,15 +1151,15 @@
}
remove_vfsmnt(old_root_dev);
vfsmnt = add_vfsmnt(old_root_dev,"/dev/root.old",put_old);
- if (!vfsmnt) printk(KERN_CRIT "Trouble: add_vfsmnt failed\n");
- else {
+ if (vfsmnt) {
vfsmnt->mnt_sb = old_root->d_inode->i_sb;
- d_mount(dir_d,vfsmnt->mnt_sb->s_root);
vfsmnt->mnt_flags = vfsmnt->mnt_sb->s_flags;
+ d_mount(dir_d,old_root);
+ return 0;
}
- d_umount(old_root);
- d_mount(dir_d,old_root);
- return 0;
+ printk(KERN_CRIT "Trouble: add_vfsmnt failed\n");
+ dput(old_root);
+ return -ENOMEM;
}

int change_root(kdev_t new_root_dev,const char *put_old)
\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.128 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site