linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Andreas Dilger <adilger@dilger.ca>
Cc: linux-ext4@vger.kernel.org, Mark Fasheh <mfasheh@suse.com>,
	Joel Becker <jlbec@evilplan.org>
Subject: Re: [PATCH 15/23] jbd2: Change disk layout for metadata checksumming
Date: Sun, 29 Apr 2012 15:39:21 -0400	[thread overview]
Message-ID: <20120429193921.GA7342@thunk.org> (raw)
In-Reply-To: <FCF93AD5-A078-4855-BC8D-B7B046884411@dilger.ca>

[ I've trimmed the cc line to avoid spamming lots of folks who might not
  care about the details of jbd2 checksumming. ]

On Sat, Apr 28, 2012 at 04:58:12PM -0600, Andreas Dilger wrote:
> 
> I thought we originally discussed using the high 16 bits of the
> t_flags field to store the checksum?  This would avoid the need to
> change the disk format.

I don't recall that suggestion, but I like it.  One thing that will
get subtle about this is that t_flags is stored big-endian (jbd/jbd2
data structures are stored be, but the data structures in ext4 proper
are stored le; sigh).   So we'd have to do something like this:

typedef struct journal_block_tag_s
{
	__u32		t_blocknr;	/* The on-disk block number */
	__u16		t_checksum;	/* 16-bit checksum */
	__u16		t_flags;	/* See below */
	__u32		t_blocknr_high; /* most-significant high 32bits. */
} journal_block_tag_t;

... and then make sure we change all of the places that access t_flags
using cpu_to_be32() and be32_to_cpu() get changed to the 16-bit
variant.

> Since there is still a whole transaction checksum, it isn't so
> critical that the per-block checksum be strong.
>
> One idea is to do the crc32c for each block, then store the high 16
> bits into t_flags, and checksum the full 32-bit per-block checksums
> to make the commit block checksum, to avoid having to do the block
> checksums twice.

It's not critical because the hard drive is doing its own ECC.  So I'm
not that worried about detecting a large burst of bit errors, which is
the main advantage of using a larger CRC.  I'm more worried about a
disk block getting written to the wrong place, or not getting written
at all.  So whether the chance of detecting a wrong block is 99.9985%
at all (w/ a 16-bit checksum) or 99.9999% (with a 32-bit checksum),
at all, either is fine.

I'm not even sure I would worry combining the per-block checksums into
the commit block checksum.  In the rare case where there is an error
not detected by the 16-bit checksum which is detected in the commit
checksum, what are we supposed to do?  Throw away the entire commit
again?  Just simply testing to see what we do in this rare case is
going to be interesting / painful.

   	     	     	      	 	     - Ted

  reply	other threads:[~2012-04-29 19:39 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-06 20:47 [PATCH v3 00/23] ext4: Add metadata checksumming Darrick J. Wong
2012-03-06 20:48 ` [PATCH 01/23] ext4: Create a new BH_Verified flag to avoid unnecessary metadata validation Darrick J. Wong
2012-03-06 20:48 ` [PATCH 02/23] ext4: Change on-disk layout to support extended metadata checksumming Darrick J. Wong
2012-03-06 20:48 ` [PATCH 03/23] ext4: Record the checksum algorithm in use in the superblock Darrick J. Wong
2012-03-06 20:48 ` [PATCH 04/23] ext4: Only call out to crc32c if necessary Darrick J. Wong
2012-03-06 20:48 ` [PATCH 05/23] ext4: Calculate and verify superblock checksum Darrick J. Wong
2012-04-27 20:05   ` Ted Ts'o
2012-04-30 16:19     ` djwong
2012-03-06 20:48 ` [PATCH 06/23] ext4: Calculate and verify inode checksums Darrick J. Wong
2012-03-06 20:48 ` [PATCH 07/23] ext4: Calculate and verify checksums for inode bitmaps Darrick J. Wong
2012-03-06 20:48 ` [PATCH 08/23] ext4: Calculate and verify block bitmap checksum Darrick J. Wong
2012-03-06 20:48 ` [PATCH 09/23] ext4: Verify and calculate checksums for extent tree blocks Darrick J. Wong
2012-03-06 20:49 ` [PATCH 10/23] ext4: Calculate and verify checksums for htree nodes Darrick J. Wong
2012-03-06 20:49 ` [PATCH 11/23] ext4: Calculate and verify checksums of directory leaf blocks Darrick J. Wong
2012-03-06 20:49 ` [PATCH 12/23] ext4: Calculate and verify checksums of extended attribute blocks Darrick J. Wong
2012-03-06 20:49 ` [PATCH 13/23] ext4: Make block group checksums use metadata_csum algorithm Darrick J. Wong
2012-03-06 20:49 ` [PATCH 14/23] ext4: Add checksums to the MMP block Darrick J. Wong
2012-03-06 20:49 ` [PATCH 15/23] jbd2: Change disk layout for metadata checksumming Darrick J. Wong
2012-04-28 14:19   ` Ted Ts'o
2012-04-28 22:58     ` Andreas Dilger
2012-04-29 19:39       ` Ted Ts'o [this message]
2012-04-30  4:08         ` Andreas Dilger
2012-05-18 22:51         ` djwong
2012-04-30 15:53     ` djwong
2012-04-30 16:51       ` Andreas Dilger
2012-03-06 20:49 ` [PATCH 16/23] jbd2: Enable journal clients to enable v2 checksumming Darrick J. Wong
2012-03-06 20:49 ` [PATCH 17/23] jbd2: Grab a reference to the crc32c driver only when necessary Darrick J. Wong
2012-03-06 20:50 ` [PATCH 18/23] jbd2: Checksum journal superblock Darrick J. Wong
2012-03-06 20:50 ` [PATCH 19/23] jbd2: Checksum revocation blocks Darrick J. Wong
2012-03-06 20:50 ` [PATCH 20/23] jbd2: Checksum descriptor blocks Darrick J. Wong
2012-03-06 20:50 ` [PATCH 21/23] jbd2: Checksum commit blocks Darrick J. Wong
2012-03-06 20:50 ` [PATCH 22/23] jbd2: Checksum data blocks that are stored in the journal Darrick J. Wong
2012-03-06 20:50 ` [PATCH 23/23] ext4/jbd2: Add metadata checksumming to the list of supported features Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2012-01-07  8:27 [PATCH v2.3 00/23] ext4: Add metadata checksumming Darrick J. Wong
2012-01-07  8:29 ` [PATCH 15/23] jbd2: Change disk layout for " Darrick J. Wong
2011-12-14  0:46 [PATCH v2.2 00/23] ext4: Add " Darrick J. Wong
2011-12-14  0:47 ` [PATCH 15/23] jbd2: Change disk layout for " Darrick J. Wong

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=20120429193921.GA7342@thunk.org \
    --to=tytso@mit.edu \
    --cc=adilger@dilger.ca \
    --cc=jlbec@evilplan.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=mfasheh@suse.com \
    /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).