e2fsprogs/debugfs
Darrick J. Wong 38d5adf339 e2fsck/debugfs: fix descriptor block size handling errors with journal_csum
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.  These errors regrettably lead to the journal
corruption reported by Mr. Reardon.

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>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-11 12:40:54 -04:00
..
Makefile.in Merge branch 'maint' into next 2014-05-13 11:01:07 -04:00
debug_cmds.ct Merge branch 'maint' into next 2014-07-22 14:57:40 -04:00
debugfs.8.in Merge branch 'maint' into next 2014-08-08 17:02:34 -04:00
debugfs.c misc: fix gcc warnings 2014-08-24 12:22:11 -04:00
debugfs.h Merge branch 'maint' into next 2014-07-22 14:57:40 -04:00
dump.c Merge branch 'maint' into next 2014-08-08 17:02:34 -04:00
extent_cmds.ct debugfs: add the ability to manipulate the extent tree directly 2012-12-24 10:49:41 -05:00
extent_inode.c debugfs: restore and tweak original error messaging 2013-12-30 16:56:19 -05:00
filefrag.c libext2fs: handle inline_data in block iterator function 2014-03-04 08:46:13 -05:00
htree.c libext2fs: provide functions to safely access name_len and file_type 2013-06-08 17:03:05 -04:00
icheck.c debugfs: restore and tweak original error messaging 2013-12-30 16:56:19 -05:00
jfs_user.h e2fsck/debugfs: fix descriptor block size handling errors with journal_csum 2014-09-11 12:40:54 -04:00
logdump.c e2fsck/debugfs: fix descriptor block size handling errors with journal_csum 2014-09-11 12:40:54 -04:00
ls.c libext2fs: provide functions to safely access name_len and file_type 2013-06-08 17:03:05 -04:00
lsdel.c debugfs: fix two warning messages when compiling with LLVM 2014-05-27 13:20:06 -04:00
ncheck.c libext2fs: provide functions to safely access name_len and file_type 2013-06-08 17:03:05 -04:00
quota.c debugfs: fix debugfs/quota.c compile warnings 2014-05-22 17:57:21 -04:00
ro_debug_cmds.ct debugfs: add commands to query the quota information 2014-05-13 10:13:19 -04:00
set_fields.c Merge branch 'maint' into next 2014-08-25 18:37:37 -04:00
unused.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
util.c Merge branch 'maint' into next 2014-05-27 12:38:23 -04:00
xattrs.c misc: fix gcc warnings 2014-08-24 12:22:11 -04:00
zap.c misc: fix gcc warnings 2014-08-24 12:22:11 -04:00