mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: kernel BUG at inode.c:889!
@ 2001-01-31 22:23 Andreas Dilger
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Dilger @ 2001-01-31 22:23 UTC (permalink / raw)
  To: adilger; +Cc: Timo Jantunen, linux-kernel

I previously wrote:
> Below is a patch which should fix this.  It _should_ prevent you from
> mounting this filesystem in the first place, and should also stop the BUG
> in inode.c.  I'm not 100% sure of correctness, however:
> - is calling clear_inode() in these error cases OK?
> - is calling dput() the right thing to do for the root dentry?  This
>   is what kill_super() does when cleaning up the filesystem.
> 
> Cheers, Andreas
> ============================================================================
> --- fs/ext2/super.c.orig	Tue Jan 23 17:24:45 2001
> +++ fs/ext2/super.c	Wed Jan 31 12:27:25 2001
> @@ -628,13 +628,19 @@
>  	 */
>  	sb->s_op = &ext2_sops;
>  	sb->s_root = d_alloc_root(iget(sb, EXT2_ROOT_INO));
> -	if (!sb->s_root) {
> +	if (!sb->s_root || !S_ISDIR(sb->s_root->d_inode) ||

This should be !S_ISDIR(sb->s_root->d_inode->i_mode).

> +	    !sb->s_root->d_inode->i_blocks || !sb->s_root->d_inode->i_size) {
> +		if (sb->s_root) {
> +			dput(sb->s_root);
> +			sb->s_root = NULL;
> +			printk ("EXT2-fs: corrupt root inode, run e2fsck\n");
> +		} else
> +			printk ("EXT2-fs: get root inode failed\n");

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread
* kernel BUG at inode.c:889!
@ 2001-01-31 18:44 Timo Jantunen
  2001-01-31 17:07 ` Marcelo Tosatti
  2001-01-31 19:42 ` Andreas Dilger
  0 siblings, 2 replies; 6+ messages in thread
From: Timo Jantunen @ 2001-01-31 18:44 UTC (permalink / raw)
  To: linux-kernel

Heip!


While I was looking unused partitions to be used for ReiserFS testing
(paranoia is a way of life when dealing with my data ;-), I did

mount /dev/hda5 /mnt/tmp

to a partition which I thought to be unused (just to be sure). This resulted
in a Really Weird(tm) /mnt/tmp _file_ which didn't have any permissions to
anyone. When checking kernel messages, I found "EXT2-fs warning: checktime
reached, running e2fsck is recommended" line. Then I tried to unmount the
partition. It checkfaulted. Messages had following entries.

---cut
Jan 31 19:46:30 limbo kernel: EXT2-fs error (device ide0(3,5)): free_inode: reserved inode or nonexistent inode
Jan 31 19:46:30 limbo kernel: kernel BUG at inode.c:889!
Jan 31 19:46:30 limbo kernel: invalid operand: 0000
Jan 31 19:46:30 limbo kernel: CPU:    0
Jan 31 19:46:30 limbo kernel: EIP:    0010:[iput+205/336]
Jan 31 19:46:30 limbo kernel: EFLAGS: 00010282
Jan 31 19:46:30 limbo kernel: eax: 0000001b   ebx: c7ce7180   ecx: cd536000   edx: c023a328
Jan 31 19:46:30 limbo kernel: esi: c023dde0   edi: c023dde0   ebp: c023de18   esp: c7c69f20
Jan 31 19:46:30 limbo kernel: ds: 0018   es: 0018   ss: 0018
Jan 31 19:46:30 limbo kernel: Process umount (pid: 1076, stackpage=c7c69000)
Jan 31 19:46:30 limbo kernel: Stack: c020954b c02095eb 00000379 c80b48c0 c7ce7180 c01413fe c7ce7180 cbb04e00
Jan 31 19:46:30 limbo kernel:        c80b48c0 c01352ff c80b48c0 c88ed0c0 cbb04e00 00000000 080526c0 c013466a
Jan 31 19:46:30 limbo kernel:        c0135731 cbb04e00 00000000 c88ed0c0 c023ce8c ffffffff cd07a000 c0135803
Jan 31 19:46:30 limbo kernel: Call Trace: [dput+238/336] [kill_super+63/304] [remove_vfsmnt+138/144] [do_umount+433/448] [sys_umount+195/240] [sys_munmap+43/64] [sys_oldumount+12/16]
Jan 31 19:46:30 limbo kernel:        [system_call+51/56]
Jan 31 19:46:30 limbo kernel:
Jan 31 19:46:30 limbo kernel: Code: 0f 0b 83 c4 0c eb 6c 39 1b 74 38 f6 83 ec 00 00 00 07 75 26
---cut

I couldn't unmount that partition, but SysRq <Sync> <Unmount> <Boot> saved
all other partitions.

After reboot I fsck'd /dev/hda5 and it was seriously messed up. Actually it
was very likely once part of RAID array tests I did a while back (/dev/hda5
was 5GB but fsck said ext2 was a 6GB filesystem).

So ok, I did try to mount a seriously messed up filesystem, but it shouldn't
be possible in the first place or at least it shouldn't do that when I try to
umount.


// /
....................................Timo Jantunen  ......................
       ZZZ      (Used to represent :Kuunsäde 8 A 28: Email: jeti@iki.fi :
the  sound of  a person  snoring.) :02210 Espoo    : http://iki.fi/jeti :
Webster's  Encyclopedic Unabridged :Finland        : GSM+358-40-5763131 :
Dictionary of the English Language :...............:....................:


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-02-01 14:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-31 22:23 kernel BUG at inode.c:889! Andreas Dilger
  -- strict thread matches above, loose matches on Subject: below --
2001-01-31 18:44 Timo Jantunen
2001-01-31 17:07 ` Marcelo Tosatti
2001-01-31 19:01   ` Timo Jantunen
2001-01-31 19:42 ` Andreas Dilger
2001-02-01 14:38   ` Timo Jantunen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®