LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Duane Griffin" <duaneg@dghda.com>
To: Jan Kara <jack@suse.cz>
Cc: Duane Griffin <duaneg@dghda.com>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	Theodore Tso <tytso@mit.edu>,
	sct@redhat.com, akpm@linux-foundation.org, adilger@clusterfs.com
Subject: Re: [RFC, PATCH 5/6] jbd: add support for read-only log recovery
Date: Wed, 12 Mar 2008 01:40:56 +0000	[thread overview]
Message-ID: <20080312014056.GA21711@dastardly.plus.com> (raw)
In-Reply-To: <20080311150514.GC6544@atrey.karlin.mff.cuni.cz>

On Tue, Mar 11, 2008 at 04:05:14PM +0100, Jan Kara wrote:
>   Hmm, how about setting some journal flag in memory and using that one,
> instead of passing 'write' parameter through the functions. And you'd
> also have a nicer solution to your problem in journal_destroy()
> and a few other functions.

That sounds promising. I'll rework it and see how it looks, thanks.

>   Also dynamic sizing of the hashtable would be useful, when you know
> needed number of entries anyway...

Yes, indeed. I'll probably look at this after I get remount support
working.

>   And you have one problem you don't seem to be aware of: JBD escapes
> data in the block to avoid magic number in the first four bytes of the
> block (see the code replaying data from the journal). You have to do
> this unescaping when reading blocks from the journal so it's not that
> easy as you have it now.

D'oh! I noticed that in the journal replay code, but it didn't quite
register. Thanks for pointing it out. I'll think about that and make
sure to add it to my test scripts so it doesn't get overlooked.

> > +void journal_destroy_translations(journal_t *journal)
> > +{
> > +	int ii;
> > +	struct journal_block_translation *jbt;
> > +	struct hlist_node *tmp;
> > +	struct hlist_node *node;
> > +
> > +	if (!journal->j_bt_hash)
> > +		return;
> > +
> > +	for (ii = 0; ii < (1 << journal->j_bt_hash_bits); ii++) {
>   Hmm, why are you using 'ii' and not just 'i'? :) It's below as well.

Habit :)

I usually use ii, jj, etc as they are easier to grep for. However, not
linux style, I must admit. I'll change it.

> > @@ -365,28 +506,34 @@ static int replay_descriptor_block(
> >  			goto skip_write;
> >  		}
> >  
> > -		err = jread(&obh, journal, io_block);
> > -		if (err) {
> > +		if (journal->j_bt_hash) {
> > +			err = journal_record_bt(journal, blocknr, io_block);
> > +		} else {
> > +			struct buffer_head *obh;
> >  
> > -			/* Recover what we can, but
> > -			 * report failure at the end. */
> > -			success = err;
> > -			printk(KERN_ERR "JBD: IO error %d recovering "
> > -			       "block %ld in log\n", err, io_block);
> > -			continue;
> > -		}
> > -		J_ASSERT(obh != NULL);
> > +			err = jread(&obh, journal, io_block);
> > +			if (err) {
> >  
> > -		err = replay_data_block(journal, obh, data, flags, blocknr);
> > -		if (err) {
> > +				/* Recover what we can, but
> > +				 * report failure at the end. */
> > +				success = err;
> > +				printk(KERN_ERR "JBD: IO error %d recovering "
> > +				       "block %ld in log\n", err, io_block);
> > +				continue;
> > +			}
> > +			J_ASSERT(obh != NULL);
> > +
> > +			err = replay_data_block(
> > +				journal, obh, data, flags, blocknr);
> >  			brelse(obh);
> > +		}
> > +		if (err) {
> >  			printk(KERN_ERR "JBD: Out of memory during recovery\n");
> >  			success = err;
> >  			goto failed;
> >  		}
> >  
> ->  		++info->nr_replays;

Sorry, not sure if you are pointing something out or if this is a mailer
glitch. If the former, I'm afraid I don't understand.

> Jan Kara <jack@suse.cz>
> SuSE CR Labs

Cheers,
Duane.

-- 
"I never could learn to drink that blood and call it wine" - Bob Dylan

  reply	other threads:[~2008-03-12  1:41 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-06  1:59 [RFC, PATCH 0/6] ext3: do not modify data on-disk when mounting read-only filesystem Duane Griffin
     [not found] ` <1204768754-29655-2-git-send-email-duaneg@dghda.com>
2008-03-06  1:59   ` [RFC, PATCH 1/6] jbd: eliminate duplicated code in revocation table init/destroy functions Duane Griffin
     [not found]     ` <1204768754-29655-3-git-send-email-duaneg@dghda.com>
2008-03-06  1:59       ` [RFC, PATCH 2/6] jbd: replace potentially false assertion with if block Duane Griffin
2008-03-08 14:52         ` Christoph Hellwig
     [not found]     ` <1204768754-29655-4-git-send-email-duaneg@dghda.com>
2008-03-06  1:59       ` [RFC, PATCH 3/6] jbd: only create debugfs entries if cache initialisation is successful Duane Griffin
     [not found]     ` <1204768754-29655-5-git-send-email-duaneg@dghda.com>
2008-03-06  1:59       ` [RFC, PATCH 4/6] jbd: refactor nested journal log recovery loop into separate functions Duane Griffin
2008-03-08 14:53         ` Christoph Hellwig
2008-03-08 18:40           ` Duane Griffin
2008-03-11 14:35         ` Jan Kara
2008-03-12  1:02           ` Duane Griffin
2008-03-12 10:50             ` Jan Kara
     [not found]     ` <1204768754-29655-6-git-send-email-duaneg@dghda.com>
2008-03-06  1:59       ` [RFC, PATCH 5/6] jbd: add support for read-only log recovery Duane Griffin
2008-03-11 15:05         ` Jan Kara
2008-03-12  1:40           ` Duane Griffin [this message]
2008-03-12 10:51             ` Jan Kara
     [not found]     ` <1204768754-29655-7-git-send-email-duaneg@dghda.com>
2008-03-06  1:59       ` [RFC, PATCH 6/6] ext3: do not write to the disk when mounting a dirty read-only filesystem Duane Griffin
2008-03-06  7:17         ` Andreas Dilger
2008-03-06 11:19           ` Duane Griffin
2008-03-11 15:11           ` Jan Kara
2008-03-12  2:42             ` Duane Griffin
2008-03-12 10:53               ` Jan Kara
2008-03-06  3:42 ` [RFC, PATCH 0/6] ext3: do not modify data on-disk when mounting " Andrew Morton
2008-03-06 11:20   ` Duane Griffin
2008-03-13  3:22 ` Daniel Phillips
2008-03-13 12:35   ` Duane Griffin

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=20080312014056.GA21711@dastardly.plus.com \
    --to=duaneg@dghda.com \
    --cc=adilger@clusterfs.com \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sct@redhat.com \
    --cc=tytso@mit.edu \
    --subject='Re: [RFC, PATCH 5/6] jbd: add support for read-only log recovery' \
    /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

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).