From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Subject: [PATCH] e2fsck: mark sparse journal as invalid
Date: Mon, 12 Apr 2010 17:36:33 -0500 [thread overview]
Message-ID: <4BC3A071.4030501@redhat.com> (raw)
For a filesystem that fails with:
journal_bmap: journal block not found at offset 7334 on loop0
JBD: bad block at offset 7334
e2fsck won't actually fix this; it will mark the fs as clean,
so it will mount, but it does not fix that block, and when the
journal reaches this point again it will fail again.
The following simple change to process_journal_block() might be
a little drastic; it will clear & recreate the journal inode if
it's sparse - i.e. if it gets block 0.
I suppose we could be more complicated and try to replay the journal
up to the error, but I'm not sure it's worth it since we're fscking
it anyway.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/e2fsck/journal.c b/e2fsck/journal.c
index 57783eb..4e6a7c3 100644
--- a/e2fsck/journal.c
+++ b/e2fsck/journal.c
@@ -214,7 +214,7 @@ static int process_journal_block(ext2_filsys fs,
p = (struct process_block_struct *) priv_data;
- if (blk < fs->super->s_first_data_block ||
+ if (!blk || blk < fs->super->s_first_data_block ||
blk >= ext2fs_blocks_count(fs->super))
return BLOCK_ABORT;
next reply other threads:[~2010-04-12 22:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-12 22:36 Eric Sandeen [this message]
2010-05-13 17:15 ` [PATCH] e2fsck: mark sparse journal as invalid tytso
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=4BC3A071.4030501@redhat.com \
--to=sandeen@redhat.com \
--cc=linux-ext4@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;
as well as URLs for NNTP newsgroup(s).