linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] jbd2 checksum-related fixes
@ 2014-08-15 20:43 Darrick J. Wong
  2014-08-15 20:43 ` [PATCH 1/2] jbd2: fix infinite loop when recovering corrupt journal blocks Darrick J. Wong
  2014-08-15 20:43 ` [PATCH 2/2] jbd2: fix descriptor block size handling errors with journal_csum Darrick J. Wong
  0 siblings, 2 replies; 10+ messages in thread
From: Darrick J. Wong @ 2014-08-15 20:43 UTC (permalink / raw)
  To: tytso, darrick.wong; +Cc: linux-ext4

Hi all,

This is a pair of patches to jbd2 that fix some problems that have
been found when journal checksumming is enabled.

Patch 1 fixes a longstanding bug -- journal recovery goes into an
infinite loop when a non-revoked journal block fails its metadata
checksum test.  Instead, keep replaying the journal and proceed to the
e2fsck.

Patch 2 introduces journal_csum v3 to fix numerous journal block
tag size handling bugs.  The test of 64bitness should not rely on
guessing the tag size when it could simply query the feature flags.
Furthermore, the journal_csum v2 structure had memory access alignment
issues.  Just replace this all with a 16-byte tag with everything in
it; the overhead for checksums is no more than 0.1%.

Patches are against 3.16, and have been xfstest'd and checked against
debugfs creating test journals (see e2fsprogs patchbomb 5.1 later
tonight).

Comments and questions are, as always, welcome.

--D

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] jbd2: fix descriptor block size handling errors with journal_csum
@ 2014-09-02 19:28 TR Reardon
  2014-09-06  4:01 ` Darrick J. Wong
  0 siblings, 1 reply; 10+ messages in thread
From: TR Reardon @ 2014-09-02 19:28 UTC (permalink / raw)
  To: Theodore Ts'o, Darrick J. Wong; +Cc: linux-ext4

There may still be problems with this patch.  After applying to 3.16.1, I am now getting "can't enable checksumming v2 and v3 at the same time" errors on mount.  Initial mount/dismount work fine, but once fs is touched--forcing superblock update--it cannot be mounted anew.

Note results from dumpe2fs  (without recent patches)

Journal backup:           inode blocks
Checksum type:            crc32c
Checksum:                 0x39141b69
Journal features:         journal_incompat_revoke journal_64bit journal_async_commit journal_checksum_v2 FEATURE_I4
Journal size:             128M
Journal length:           32768
Journal sequence:         0x00012aa4
Journal start:            0
Journal checksum type:    crc32c
Journal checksum:         0x3952b695

Seems that the old v2 flag is not cleared on dismount?



--- Original Message ---

From: "Theodore Ts'o" <tytso@mit.edu>
Sent: August 25, 2014 10:44 PM
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-ext4@vger.kernel.org, "TR Reardon" <thomas_reardon@hotmail.com>
Subject: Re: [PATCH 2/2] jbd2: fix descriptor block size handling errors with journal_csum

On Fri, Aug 15, 2014 at 01:43:59PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> It turns out that there are some serious problems with the on-disk
> format of journal checksum v2.  The foremost is that the function to
> calculate descriptor tag size returns sizes that are too big.  This
> causes alignment issues on some architectures and is compounded by the
> fact that some parts of jbd2 use the structure size (incorrectly) to
> determine the presence of a 64bit journal instead of checking the
> feature flags.
>
> Therefore, introduce journal checksum v3, which enlarges the
> descriptor block tag format to allow for full 32-bit checksums of
> journal blocks, fix the journal tag function to return the correct
> sizes, and fix the jbd2 recovery code to use feature flags to
> determine 64bitness.
>
> Add a few function helpers so we don't have to open-code quite so
> many pieces.
>
> Switching to a 16-byte block size was found to increase journal size
> overhead by a maximum of 0.1%, to convert a 32-bit journal with no
> checksumming to a 32-bit journal with checksum v3 enabled.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reported-by: TR Reardon <thomas_reardon@hotmail.com>

Thanks, applied.

                                        - Ted
--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-09-08 23:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-15 20:43 [PATCH 0/2] jbd2 checksum-related fixes Darrick J. Wong
2014-08-15 20:43 ` [PATCH 1/2] jbd2: fix infinite loop when recovering corrupt journal blocks Darrick J. Wong
2014-08-26  2:44   ` Theodore Ts'o
2014-08-15 20:43 ` [PATCH 2/2] jbd2: fix descriptor block size handling errors with journal_csum Darrick J. Wong
2014-08-26  2:44   ` Theodore Ts'o
  -- strict thread matches above, loose matches on Subject: below --
2014-09-02 19:28 TR Reardon
2014-09-06  4:01 ` Darrick J. Wong
2014-09-06  4:27   ` Darrick J. Wong
     [not found]     ` <BAY179-W502087BB782D5AD3D06197FDC10@phx.gbl>
2014-09-08 15:10       ` TR Reardon
2014-09-08 23:18         ` Darrick J. Wong

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