History log of /external/e2fsprogs/e2fsck/recovery.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8d7a63921f6ea01d2dcc43667a2d0a74da9842ae 04-Sep-2016 Theodore Ts'o <tytso@mit.edu> Avoid crashing on unaligned pointers from corrupted file systems

On platforms that don't permit unaligned pointer dereferences,
corrupted file systems will as used by the regression test suite can
cause e2fsck and debugfs to crash. Avoid those crashes caused by
corrupted file systems. With this commit the full set of regression
test suites will pass on the sparc64 platform.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
478360f50b68356849813f97db46fd156da5248e 30-May-2016 Theodore Ts'o <tytso@mit.edu> Fix Android build warnings

Also fix some additional gcc -Wall build warnings in a traditional
Linux environment.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
b4f02c9f32e37d082b3828d138d405c10263beab 16-Apr-2016 Theodore Ts'o <tytso@mit.edu> e2fsck: use specific CRC and corruption errors in journal recovery

Sync up with kernel commit 6a797d27: "ext4: call out CRC and
corruption errors with specific error codes".

This allows us to distinguish between CRC errors and I/O errors.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
86f3b6cf98a72c6dad0738e3af2512ddcbd49be9 24-Oct-2015 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: clean up feature test macros with predicate functions

Create separate predicate functions to test/set/clear feature flags,
thereby replacing the wordy old macros. Furthermore, clean out the
places where we open-coded feature tests.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
04c66cb25f36d31c6f33196c9a7a8d206012cbba 17-May-2015 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: fix buffer overrun in revoke block scanning

Check the value of r_count to ensure that we never try to read revoke
records past the end of the revoke block. It turns out that the
journal writing code in debugfs was also playing fast and loose with
the r_count, so fix that as well.

The Coverity bug was 1297508.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
c10700f9748e54748f88a22554da3dca4b7fc234 19-Sep-2014 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: free bh when descriptor block checksum fails

Free the buffer head if the journal descriptor block fails checksum
verification. This has been patched before (see "e2fsck: free bh on
csum verify error in do_one_pass") but apparently the patch was never
committed to jbd2 in the kernel, so when we resync'd the recovery code
with 3.16, the bug came back. Sigh.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Cc: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
/external/e2fsprogs/e2fsck/recovery.c
38d5adf33993264d8db78ebb3d924e9d9e155590 09-Sep-2014 Darrick J. Wong <darrick.wong@oracle.com> 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>
/external/e2fsprogs/e2fsck/recovery.c
bf93a9685ea71db0a519e1df07c3ed850933034d 27-Aug-2014 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: fix infinite loop when recovering corrupt journal blocks

When recovering the journal, don't fall into an infinite loop if we
encounter a corrupt journal block. Instead, just skip the block and
proceed with the full filesystem fsck.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
97f168b67eb1d0b46ec08bf2751313604e67fc16 27-Aug-2014 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: resync jbd2 revoke code from Linux 3.16

Synchronize e2fsck's copy of revoke.c with the kernel's copy in
fs/jbd2.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
13af4b93fbfc1fd9a0bbce08c78e686b531ebd8a 27-Aug-2014 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: resync jbd2 recovery code from Linux 3.16

Synchronize e2fsck's copy of recovery.c with the kernel's copy in
fs/jbd2.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
26dacce72cb8d6d0d00e2377e255d9b3e900a09a 22-Jul-2014 Eric Sandeen <sandeen@redhat.com> e2fsck: free bh on csum verify error in do_one_pass

Coverity (re-)spotted this; it was triaged as a false positive,
but it seems pretty clear that the bh (which was just checked)
isn't currently freed before the function exits.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
bd78b1dae99b0f0d3c5456478c320f5ac0a98584 04-Jun-2013 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: fix journal block tag checksum verification

Al Viro complained of a ton of bogosity with regards to the jbd2 block tag
header checksum. This one checksum is 16 bits, so cut off the upper 16 bits
and treat it as a 16-bit value and don't mess around with be32* conversions.
Fortunately metadata checksumming is still "experimental" and not in a shipping
e2fsprogs, so there should be few users affected by this.

This is the e2fsprogs version of the kernel patch.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
fd9ca825996d61ad7c77edded827c661a458b500 20-May-2013 Theodore Ts'o <tytso@mit.edu> e2fsck: fix gcc -Wall nits

[For 1.43 branch]

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
581ecb6d8808a083add919f066f44cf7e70f9c4a 20-May-2013 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
e2fsck/pass1b.c
e2fsck/rehash.c
lib/ext2fs/crc32c.c
lib/ext2fs/gen_bitmap64.c
misc/tune2fs.c
68477355a9f3b4ca46dfa6c34d05105dcc6682ad 20-May-2013 Theodore Ts'o <tytso@mit.edu> e2fsck: fix gcc -Wall nits

Perhaps the most serious fix up is a type-punning warning which could
result in miscompilation with overly enthusiastic compilers.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
8c236c62c970aac0ad78ee588dd3ee0d4cba7392 13-Mar-2013 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next
d3f58ef166dea70f1e3e7a09b19c3ec964eb1730 13-Mar-2013 Theodore Ts'o <tytso@mit.edu> e2fsck: fix build failure with --enable-jbd-debug

Commit e3507739e4185 introduced a build failure if e2fsprogs is
configured with --enable-jbd-debug. Fix this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
1b8c4c1b45482363e29bd4cca483d84645f8ac9d 23-Jan-2013 Andreas Dilger <adilger@dilger.ca> build: quiet build warnings for "gcc -Wall"

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
b9b5e43ea81ecf575e3d96cbf51215aba3746b32 02-Jan-2013 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
RELEASE-NOTES
debian/changelog
lib/ext2fs/crc32c.c
lib/ext2fs/rw_bitmaps.c
resize/resize2fs.c
version.h
e3507739e4185bdb2394928eb6479e48f4e690a8 01-Jan-2013 Theodore Ts'o <tytso@mit.edu> Fix gcc -Wall nits

This fixes the last set of gcc -Wall complaints.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
00eb0eee0addfd3b7ede98b85e00dff1547838a0 29-Nov-2012 Andreas Dilger <adilger@dilger.ca> build: quiet some "gcc -Wall" compiler warnings

Quiet a number of simple compiler warnings:
- pointers not initialized by ext2fs_get_mem()
- return without value in non-void function
- dereferencing type-punned pointers
- unused variables

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
a8ed37054f554e83abc22066957e1fe4b5b9e31b 03-Aug-2012 Darrick J. Wong <djwong@us.ibm.com> e2fsck: refactor crc32_be code

Remove crc32_be in favor of the implementation in libext2fs.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
d920038068bbda80df9060be55da5726a6efe9a4 03-Aug-2012 Darrick J. Wong <djwong@us.ibm.com> e2fsck: verify data block checksums when recovering journal

Check the data block checksums when recovering the journal.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
721e065c6262371598d8490a32998d53bfe62ce8 03-Aug-2012 Darrick J. Wong <djwong@us.ibm.com> e2fsck: check commit block checksum during recovery

When recovering a journal with checksum v2, verify the commit block
checksum.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
5c8428513dc0e53af847b5435f58c94237d1cc3d 03-Aug-2012 Darrick J. Wong <djwong@us.ibm.com> e2fsck: check descriptor block checksum when recovering journal

Verify the descriptor block checksum when recovering a journal.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
d35ed158cf616c23512ce8e393ab00ed2f004b84 03-Aug-2012 Darrick J. Wong <djwong@us.ibm.com> e2fsck: check revoke block checksum during recovery

Verify the revoke block checksum when recovering the journal.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
2556373a33c694a277ebd6e35d16384dff2dc692 03-Aug-2012 Darrick J. Wong <djwong@us.ibm.com> libext2fs: change on-disk journal layout to support metadata checksumming

Define flags and change journal structure definitions to support v2 journal
checksumming.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
3b693d0b03569795d04920a04a0a21e5f64ffedc 22-May-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: fix 64-bit journal support

64-bit journal support was broken; we weren't using the high bits from
the journal descriptor blocks! We were also using "unsigned long" for
the journal block numbers, which would be a problem on 32-bit systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
79a4dddbf7636160c6506a42402505d676b9a6e0 08-Oct-2011 Darrick J. Wong <djwong@us.ibm.com> e2fsck: recover revoke blocks on 64bit filesystems correctly

Since the advent of 64bit filesystems, revoke blocks store 64-bit
block numbers instead of 32-bit block numbers. Therefore we need to
be able to handle that case.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
d1154eb460efe588eaed3d439c1caaca149fa362 18-Sep-2011 Theodore Ts'o <tytso@mit.edu> Shorten compile commands run by the build system

The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and
this was starting to cause some tools heartburn. It also made "make
V=1" almost useless, since trying to following the individual commands
run by make was lost in the noise of all of the defines.

So fix this by putting the configure-generated defines in lib/config.h
and the directory pathnames to lib/dirpaths.h.

In addition, clean up some vestigal defines in configure.in and in the
Makefiles to further shorten the cc command lines.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
c816ecb204a32e67788738e050ff2b14a721672b 14-Dec-2010 Eric Sandeen <sandeen@redhat.com> e2fsprogs: fix type-punning warnings

Flags used during RHEL/Fedora builds lead to a couple type-punning
warnings:

recovery.c: In function 'do_one_pass':
recovery.c:539: warning: dereferencing type-punned pointer will break strict-aliasing rules
./csum.c: In function 'print_csum':
./csum.c:170: warning: dereferencing type-punned pointer will break strict-aliasing rules

The two changes below fix this up.

Note that the csum test binary output changes slightly, but this does
not break any tests.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
2acad6b4895a0e218f9d9eece1ade23c2cf4ffc7 07-Jun-2008 Theodore Ts'o <tytso@mit.edu> Fix gcc -Wall warnings in e2fsck

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
185c4aeaf23d48375e3506218305031663203d0f 23-May-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Add support to check journal checksums

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
e5ea6b14eb93671525e01ec4a6100febe541bf67 20-May-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix potential data corruptor bug in journal recovery

While synchronizing e2fsck's recovery.c with the latest 2.6 kernel
sources, I discovered a serious bug that apparently had been fixed in
the kernel sometime between Deceber 2003 and April 2005, but which had
not been carried over to e2fsprogs. Specifically, when blocks whose
first 4 bytes are JFS_MAGIC_NUMBER (0xc03b3998) are written into the
journal, the first 4 bytes zero'ed out. A one character typo meant
that when the blocks were replayed by e2fsck, the JFS_MAGIC_NUMBER
would not be restored.

Oops.

Fortunately, it is *highly* unlikely that ext4 metadata blocks will
contain that magic number in the first four bytes, and data=journalled
is a relatively rarely used.

This commit fixes this bug, as well as updating e2fsck's recovery.c to
be in sync with 2.6.25.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
f6567a889f071c6b294f85792abc75fa76953d1a 30-May-2006 Matthias Andree <matthias.andree@gmx.de> Fix printf types (FreeBSD has u_long for ntohl).

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
/external/e2fsprogs/e2fsck/recovery.c
2aa362f54a9a486ffd495028b95532897551d619 14-May-2006 Theodore Ts'o <tytso@mit.edu> Fix memory leak in e2fsck's error paths

Add missing brelse() calls to avoid memory leaks in error paths. (Thanks
to Michael C. Thompson for pointing these out; they were originally
found using Coverity.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
8deb80a5d1078cbe43eaffcdeebf0a1a549d6a54 19-Mar-2006 Takashi Sato <sho@tnes.nec.co.jp> Fix format statements to make e2fsprogs programs 32-bit clean

Change the format string(%d, %ld) for a block number and inode number
to %u or %lu.

Signed-off-by: Takashi Sato <sho@tnes.nec.co.jp>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/recovery.c
3de085dd4109e6a7049dd6b85abf0313167cab5b 07-Dec-2003 Theodore Ts'o <tytso@mit.edu> recovery.c, jfs_user.h: Sync recovery.c with latest 2.5 kernel
version.
/external/e2fsprogs/e2fsck/recovery.c
8cf93332d180e6929d73cd8c855c3a83d6a6648c 16-Dec-2001 Theodore Ts'o <tytso@mit.edu> Fix e2fsck's handling of external journals,and update journal
recovery files from 2.4.17-pre8.
/external/e2fsprogs/e2fsck/recovery.c
725c474ffcf09bbdbd6cd396a867914fec7b4510 08-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, jfs.h:
jfs.h: Synchronize with ext3 0.7a
ChangeLog, recovery.c, revoke.c:
recover.c, revoke.c: Synchronize with ext3 0.7a
/external/e2fsprogs/e2fsck/recovery.c
a479fe6049a0dbd7104186d897b627a247561d1b 02-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, recovery.c:
recovery.c (scan_revoke_records): Fix bug in recovery code; missing
byte order conversion.
/external/e2fsprogs/e2fsck/recovery.c
1f73503816829b0362957798fbb8cd355337dc6a 29-Mar-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, recovery.c, revoke.c:
recovery.c, revoke.c: Synchronize with 0.6b ext3 files.
/external/e2fsprogs/e2fsck/recovery.c
53ef44c40a3e425d2c700d8fd77a6b655aa121fe 06-Jan-2001 Theodore Ts'o <tytso@mit.edu> Many files:
journal.c, pass1.c, pass1b.c, pass3.c, recovery.c, revoke.c, super.c,
unix.c, util.c: Fix random gcc -Wall complaints.
jfs_user.h: Use more sophisticated inline handling to allow building
with --enable-gcc-wall
/external/e2fsprogs/e2fsck/recovery.c
0e8a9560d89dd9cca73037a59efa93e46abdccda 09-Dec-2000 Theodore Ts'o <tytso@mit.edu> Many files:
jfs_e2fsck.h, jfs_user.h: Replaces jfs_compat.h. The jfs.h file has
been moved to the include/linux directory.
journal.c, revoke.c, recovery.c: Updated files from Stephen to support
the V2 superblock and revoke processing. The journal.c and revoke.c
files are copies from the ext3 kernel source.
Makefile.in: Added revoke.c to the list of source/object files.
Makefile.in:
Fix up some mistakes in the source file list, and regenerate the
dependencies.
Update Makefile dependencies.
ChangeLog, jfs.h:
jfs.h: Remove excess #include of JFS_DEBUG. Not needed for e2fsprogs,
since we optioanlly define it in the configuration file system.
/external/e2fsprogs/e2fsck/recovery.c
3b5386dca8e0008e13351be5de6323576329aa58 14-Aug-2000 Theodore Ts'o <tytso@mit.edu> Many files:
journal.c: implement loading of ext3 journal for recovery code
problem.c (fix_problem): return answer from PR_AFTER_CODE to caller.
Add journal problems.
recovery.c (journal_recover): user-space ext3 journal recovery code
unix.c (main) : check journal and do recovery in separate steps
jfs.h, recovery.c: Files ext3 kernel code.
jfs_compat.h: Compatibility header file to allow kernel code to be
linked to e2fsck.
/external/e2fsprogs/e2fsck/recovery.c