mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolinux.com>
To: adilger@webber.adilger.net
Cc: Timo Jantunen <jeti@iki.fi>, linux-kernel@vger.kernel.org
Subject: Re: kernel BUG at inode.c:889!
Date: Wed, 31 Jan 2001 15:23:44 -0700 (MST)	[thread overview]
Message-ID: <200101312223.f0VMNjP30699@webber.adilger.net> (raw)
In-Reply-To: From "(env:" "adilger)" at "Jan 31, 2001 12:42:27 pm"

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/

             reply	other threads:[~2001-01-31 22:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-31 22:23 Andreas Dilger [this message]
  -- 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200101312223.f0VMNjP30699@webber.adilger.net \
    --to=adilger@turbolinux.com \
    --cc=adilger@webber.adilger.net \
    --cc=jeti@iki.fi \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®