All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Fwd: [Bug] 2.6.30 kernel stack trace with 'fsfuzzer ext3' on
       [not found] <20090722095000.GA19072@duck.suse.cz>
@ 2009-07-23  9:50 ` Kamalesh Babulal
  0 siblings, 0 replies; only message in thread
From: Kamalesh Babulal @ 2009-07-23  9:50 UTC (permalink / raw)
  To: linux-s390

* Jan Kara <jack@suse.cz> [2009-07-22 11:50:00]:

> On Wed 22-07-09 10:42:52, Nageswara R Sastry wrote:
> > Hi Jan,
> >
> > >My first guess would be that journal superblock was corrupted by
> > >fsfuzzer so that the journal had less than 32 blocks and the warning
> > >triggered. That being said, we might use more sanity checks when loading
> > >journal superblock because currently it just blindly consumes what's on
> > >disk. We can't do too much since we don't know anything about the
> > >filesystem structure but we can do at least something. I'll write a
> > >patch for that in a moment...
> >
> > Any updates on this. Thanks!!
>   I have a patch queued for this in my patch queue and will ask Linus for
> merging it probably tomorrow. Similar JBD2 fix is in the Ted's patch queue
> also waiting for being merged. I'm also attaching the fix for your
> convenience.

Thanks, the patch fixes the warning.

> 
> 								Honza
> -- 
> Jan Kara <jack@suse.cz>
> SUSE Labs, CR

> From 7447a668a3860b66b3c9db86fdea91e355ba59ac Mon Sep 17 00:00:00 2001
> From: Jan Kara <jack@suse.cz>
> Date: Wed, 15 Jul 2009 20:36:08 +0200
> Subject: [PATCH 1/5] jbd: Fail to load a journal if it is too short
> 
> Due to on disk corruption, it can happen that journal is too short. Fail
> to load it in such case so that we don't oops somewhere later.
> 
  Tested-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
> Reported-by: Nageswara R Sastry <rnsastry@linux.vnet.ibm.com>
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  fs/jbd/journal.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
> index 737f724..94a64a1 100644
> --- a/fs/jbd/journal.c
> +++ b/fs/jbd/journal.c
> @@ -848,6 +848,12 @@ static int journal_reset(journal_t *journal)
> 
>  	first = be32_to_cpu(sb->s_first);
>  	last = be32_to_cpu(sb->s_maxlen);
> +	if (first + JFS_MIN_JOURNAL_BLOCKS > last + 1) {
> +		printk(KERN_ERR "JBD: Journal too short (blocks %lu-%lu).\n",
> +		       first, last);
> +		journal_fail_superblock(journal);
> +		return -EINVAL;
> +	}
> 
>  	journal->j_first = first;
>  	journal->j_last = last;
> -- 
> 1.6.0.2
> 

			
					Kamalesh

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-23  9:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20090722095000.GA19072@duck.suse.cz>
2009-07-23  9:50 ` [Fwd: [Bug] 2.6.30 kernel stack trace with 'fsfuzzer ext3' on Kamalesh Babulal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.