linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 3/4] jbd2: restart replay without revokes if journal block csum fails
Date: Thu, 11 Sep 2014 15:15:11 +0200	[thread overview]
Message-ID: <20140911131511.GA30901@quack.suse.cz> (raw)
In-Reply-To: <20140911002838.10109.50948.stgit@birch.djwong.org>

On Wed 10-09-14 17:28:38, Darrick J. Wong wrote:
> If, during a journal_checksum_v3 replay we encounter a block that
> doesn't match its tag in the descriptor block tag, we need to restart
> the replay without the revoke table in the hopes of replaying the
> newest non-corrupt version of the block that we possibly can.
  Ho hum, I don't like this. If you just ignore revoke list, you'll happily
overwrite freshly allocated data blocks with older metadata. Also when
verifying the checksum, we already know the block hasn't been revoked
so what's even the benefit of ignoring the revoke list?

								Honza
 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  fs/jbd2/recovery.c |   19 +++++++++++++++++--
>  1 file changed, 17 insertions(+), 2 deletions(-)
> 
> 
> diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
> index 9b329b5..0094d8b 100644
> --- a/fs/jbd2/recovery.c
> +++ b/fs/jbd2/recovery.c
> @@ -439,6 +439,7 @@ static int do_one_pass(journal_t *journal,
>  	 * block offsets): query the superblock.
>  	 */
>  
> +restart_pass:
>  	sb = journal->j_superblock;
>  	next_commit_ID = be32_to_cpu(sb->s_sequence);
>  	next_log_block = be32_to_cpu(sb->s_start);
> @@ -585,7 +586,8 @@ static int do_one_pass(journal_t *journal,
>  					/* If the block has been
>  					 * revoked, then we're all done
>  					 * here. */
> -					if (jbd2_journal_test_revoke
> +					if (!block_error &&
> +					    jbd2_journal_test_revoke
>  					    (journal, blocknr,
>  					     next_commit_ID)) {
>  						brelse(obh);
> @@ -599,11 +601,24 @@ static int do_one_pass(journal_t *journal,
>  						be32_to_cpu(tmp->h_sequence))) {
>  						brelse(obh);
>  						success = -EIO;
> +						if (!block_error) {
> +							/* If we see a corrupt
> +							 * block, kill the
> +							 * revoke list and
> +							 * restart the replay
> +							 * so that the blocks
> +							 * are as close to
> +							 * accurate as
> +							 * possible. */
> +							jbd2_journal_clear_revoke(journal);
> +							brelse(bh);
> +							block_error = 1;
> +							goto restart_pass;
> +						}
>  						printk(KERN_ERR "JBD2: Invalid "
>  						       "checksum recovering "
>  						       "block %llu in log\n",
>  						       blocknr);
> -						block_error = 1;
>  						goto skip_write;
>  					}
>  
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2014-09-11 13:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11  0:28 [PATCH 0/4] ext4/jbd2: misc 3.17 bugfixes Darrick J. Wong
2014-09-11  0:28 ` [PATCH 1/4] jbd2: fix journal checksum feature flag handling Darrick J. Wong
2014-09-11 15:47   ` Theodore Ts'o
2014-09-11  0:28 ` [PATCH 2/4] ext4: validate external journal superblock checksum Darrick J. Wong
2014-09-11 13:25   ` Jan Kara
2014-09-11 15:47     ` Theodore Ts'o
2014-09-11 17:11     ` Darrick J. Wong
2014-09-11  0:28 ` [PATCH 3/4] jbd2: restart replay without revokes if journal block csum fails Darrick J. Wong
2014-09-11 13:15   ` Jan Kara [this message]
2014-09-11 17:30     ` Darrick J. Wong
2014-09-11 17:43       ` Darrick J. Wong
2014-09-12  9:59         ` Jan Kara
2014-09-11  0:28 ` [PATCH 4/4] ext4: don't keep using page if inline conversion fails Darrick J. Wong
2014-09-11 13:17   ` Jan Kara
2014-09-11 15:46     ` Theodore Ts'o
2014-09-11 20:35 ` [PATCH 5/4] ext4: check EA value offset when loading Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2014-09-12 13:14 [PATCH 3/4] jbd2: restart replay without revokes if journal block csum fails TR Reardon
2014-09-12 16:15 ` Jan Kara

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=20140911131511.GA30901@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).