• Home
  • History
  • Annotate
  • only in /external/e2fsprogs/e2fsck/
History log of /external/e2fsprogs/e2fsck/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a876a33317cbcc505a596014f5115861e54c9550 06-Mar-2014 JP Abgrall <jpa@google.com> e2fsck: remove unneeded type redefinitions

Or else ...:
In file included from e2fsck/pass5.c:21:
e2fsck/problem.h:13: error: redefinition of typedef ‘__u32’
lib/ext2fs/ext2_types.h:56: error: previous declaration of ‘__u32’ was here
e2fsck/problem.h:14: error: redefinition of typedef ‘errcode_t’
lib/et/com_err.h:22: error: previous declaration of ‘errcode_t’ was here

Change-Id: I0a1ff3b2455bfbaf1e3d0940034a7dbcc231a0f7
Signed-off-by: JP Abgrall <jpa@google.com>
roblem.h
e0ed7404719a9ddd2ba427a80db5365c8bad18c0 20-Mar-2014 JP Abgrall <jpa@google.com> Switch back to 1.42.9 now that there is a fix

Revert "Revert changes that moved from 1.41.14 to 1.42.9"

This reverts commit 65f0aab98b20b5994a726ab90d355248bcddfffd.
ndroid.mk
ODULE_LICENSE_GPL
akefile.in
akefile.pq
adblocks.c
irinfo.c
2fsck.8.in
2fsck.c
2fsck.conf.5.in
2fsck.h
a_refcount.c
handler.c
mptydir.c
scan.c
fs_user.h
ournal.c
ogfile.c
essage.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
roblem.c
roblem.h
roblemP.h
rof_err.c
rof_err.et
rofile.c
rofile.h
uota.c
ecovery.c
egion.c
ehash.c
cantest.c
igcatcher.c
uper.c
nix.c
til.c
65f0aab98b20b5994a726ab90d355248bcddfffd 06-Mar-2014 JP Abgrall <jpa@google.com> Revert changes that moved from 1.41.14 to 1.42.9

Revert "e2fsck: Don't use e2fsck_global_ctx unless HAVE_SIGNAL_H"
commit e80e74c41d85ff93f3d212ba6512340f48054a93.

Revert "Merge remote-tracking branch 'linaro/linaro-1.42.9' into aosp_master"
This reverts commit e97b2b6fc82f840e84dfc631b87f21be44ff2421, reversing
changes made to 7e2fb9d09c245eba70ee008b78007315e9c0f1df.

Revert "Prepare for upstream 1.42.9"
This reverts commit 7e2fb9d09c245eba70ee008b78007315e9c0f1df.

Bug: 13340735
Change-Id: If48b153a95ef5f69f7cdccb00e23524abff3c5a8
Signed-off-by: JP Abgrall <jpa@google.com>
ndroid.mk
ODULE_LICENSE_GPL
akefile.in
akefile.pq
adblocks.c
irinfo.c
2fsck.8.in
2fsck.c
2fsck.conf.5.in
2fsck.h
a_refcount.c
handler.c
mptydir.c
scan.c
fs_user.h
ournal.c
ogfile.c
essage.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
roblem.c
roblem.h
roblemP.h
rof_err.c
rof_err.et
rofile.c
rofile.h
uota.c
ecovery.c
egion.c
ehash.c
cantest.c
igcatcher.c
uper.c
nix.c
til.c
08b8eab0cbebe1b109037dd8ffcf813ad35bfc3e 04-Mar-2014 JP Abgrall <jpa@google.com> e2fsck: Don't use e2fsck_global_ctx unless HAVE_SIGNAL_H

Program received signal SIGSEGV, Segmentation fault.
0x56577382 in e2fsck_set_bitmap_type (fs=0x5658c2b8, default_type=2, profile_name=0x56580e12 "default", old_type=0x0) at external/e2fsprogs/e2fsck/util.c:797
797 profile_get_uint(e2fsck_global_ctx->profile, "bitmaps",

e2fsck_global_ctx is only ever initialized in unix.c PRS()
if HAVE_SIGNAL_H is defined.

Change-Id: Ic93fb8d9114054f7bf8512c622b2fb9b2ae60584
Signed-off-by: JP Abgrall <jpa@google.com>
til.c
18a1444b4f1e6a0948fd38fa0de382d86cfe04de 31-Dec-2013 Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org> Add files that would normally be generated by the e2fsprogs build system

Android doesn't run ./configure and friends, so it has to rely on
pre-populated versions of the autogenerated files.

This is somewhat bogus (e.g. hardcoded little-endian reference in
lib/ext2fs/ext2_types.h) and should at some point be fixed, but it's
what Android has always done, not a regression from the 1.41.14 branch.

Also, don't #include config.h which we don't generate (we pass what it
usually contains as -D parameters from Android.mk) anywhere.

Add a new Android.mk file for the quota library.

Change-Id: I162c6327fee5bd06261d9cdcc34bda10f04a6f21
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
ndroid.mk
rgv_parse.c
adblocks.c
rc32.c
rc32table.h
ict.c
irinfo.c
x_dirinfo.c
2fsck.c
a_refcount.c
handler.c
mptydir.c
xtend.c
lushb.c
scan.c
fs_user.h
ournal.c
ogfile.c
essage.c
trace.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
roblem.c
roblem.h
rof_err.c
rof_err.h
rofile.c
rofile_helpers.c
uota.c
ecovery.c
egion.c
ehash.c
evoke.c
cantest.c
igcatcher.c
uper.c
nix.c
til.c
5fe0b41dba699fa14432a633c863ea8cb7bf3f5d 31-Dec-2013 Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org> Re-add Android makefiles from AOSP master

Change-Id: I6c6dbe11baa395442f4cf845ad39801f1c426129
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
ndroid.mk
a8263cab57e57fa85ca2c281fe97554eb97441f1 24-Dec-2013 Eric Whitney <enwlinux@gmail.com> e2fsck: fix printf conversion specs in ea_refcount.c

Commit 130e961a6fb9d38997c83c6397cf9ddb5ed2491f changed the type
used to represent block numbers in ea_refcount.c from blk_t to blk64_t
to add support for 64 bit extended attribute refcounting. We also
need to adjust printf conversion specs that now don't match their new
blk64_t arguments. This will silence compiler warnings seen when
"make check" is run and will avoid truncation of printed values.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
a_refcount.c
2bc30417541deffca795db8ec4e7f7ccb616dc3f 23-Dec-2013 Andreas Dilger <adilger@dilger.ca> debugfs, e2fsck: fix s_desc_size handling

The s_desc_size in the superblock specifies the group descriptor
size in bytes, but in various places the EXT4_FEATURE_INCOMPAT_64BIT
flag implies that the descriptor size is EXT2_MIN_DESC_SIZE_64BIT
(64 bytes) instead of checking the actual size. In other places,
the s_desc_size field is used without checking for INCOMPAT_64BIT.

In the case of ext2fs_group_desc() the s_desc_size was being ignored,
and assumed to be sizeof(struct ext4_group_desc), which would result
in garbage for any but the first group descriptor. Similarly, in
ext2fs_group_desc_csum() and print_csum() they assumed that the
maximum group descriptor size was sizeof(struct ext4_group_desc).
Fix these functions to use the actual superblock s_desc_size if
INCOMPAT_64BIT.

Conversely, in ext2fs_swap_group_desc2() s_desc_size was used
without checking for INCOMPAT_64BIT being set.

The e2fsprogs behaviour is different than that of the kernel,
which always checks INCOMPAT_64BIT, and only uses s_desc_size to
determine the offset of group descriptors and what range of bytes
to checksum.

Allow specifying the s_desc_size field at mke2fs time with the
"-E desc_size=NNN" option. Allow a power-of-two s_desc_size
value up to s_blocksize if INCOMPAT_64BIT is specified. This
is not expected to be used by regular users at this time, so it
is not currently documented in the mke2fs usage or man page.

Add m_desc_size_128, f_desc_size_128, and f_desc_bad test cases to
verify mke2fs and e2fsck handling of larger group descriptor sizes.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
scan.c
11d1116a7c0b833af317249d12025413fecbcd70 23-Dec-2013 Andreas Dilger <adilger@dilger.ca> e2fsck: verify s_desc_size is power-of-two value

Add a LOG2_CHECK mode for check_super_value() so that it is easy
to verify values that are supposed to be power-of-two values
(s_desc_size and s_inode_size so far). In ext2fs_check_desc()
also check for a power-of-two s_desc_size.

Print out s_desc_size in debugfs "stats" and dumpe2fs output, if
it is non-zero.

It turns out that the s_desc_size validation in check_super_block()
is not currently used by e2fsck, because the group descriptors are
verified earlier by ext2fs_check_desc(), and even without an
explicit check of s_desc_size the group descriptors fail to align
correctly on disk. It makes sense to keep the check_super_block()
regardless, in case the code changes at some point in the future.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uper.c
e9a8c0c2d46a46c01c6a6daa5db14df72a7ad6aa 19-Dec-2013 Johan Erlandsson <johan.erlandsson@sonyericsson.com> e2fsck: read only parameter incorrectly compared

Don't check for lost+found in read only mode.

[Note: this patch was originally made against 1.41.14 version of
e2fsprogs found as part of the AOSP (Android Open Source Program)
tree. My Signed-off-by relies on the fact that the original patch
author would have had to have filed a contribution agreement with Open
Handset Alliance before this commit before this commit was allowed
into the AOSP tree. -- tytso]

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass3.c
f404167dda29a59d2be2882328aeb074b9899669 17-Dec-2013 Theodore Ts'o <tytso@mit.edu> Clean up sparse warnings

Mostly by adding static and removing excess extern qualifiers. Also
convert a few remaining non-ANSI function declarations to ANSI.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
irinfo.c
2fsck.c
ass1.c
ass2.c
nix.c
til.c
0047255f602ae725a37f24c9b3214a1400459a20 16-Dec-2013 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: try implied cluster allocation when expanding a dir

When we're expanding a directory, check to see if we're doing an
implied cluster allocation; if so, we don't need to allocate a new
block, and we certainly don't need to update the summary counts.

Reported-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass3.c
69beadcfb285cb5ee254d7f53c64a3f0dc42e229 16-Dec-2013 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: print cluster ranges when encountering bitmap errors

If pass5 finds bitmap errors in a range of clusters, don't print each
cluster number individually when we could print only the start and end
cluster number. e2fsck already does this for the non-bigalloc case.

Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
5797cb017cb8accbab8c69aaf83269c5d2d72e4e 11-Dec-2013 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: only release clusters when shortening a directory during a rehash

When the rehash process is running on a bigalloc filesystem, it
compresses all the directory entries and hash structures into the
beginning of the directory file and then uses block_iterate3() to free
the blocks off the end of the file. It seems to call
ext2fs_block_alloc_stats2() for every block in a cluster, which is
unfortunate because this function allocates and frees entire clusters
(and updates the summary counts accordingly). In this case e2fsck
writes out incorrect summary counts.

Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ehash.c
45ff69ffeb700012a7c052f5e45882557a40be7e 16-Dec-2013 Andreas Dilger <adilger@dilger.ca> build: quiet LLVM non-literal string format warning

Compiling with LLVM generates a large number of warnings due
to the use of _() for wrapping strings for i18n:

warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
./nls-enable.h:4:14: note: expanded from macro '_'
#define _(a) (gettext (a))
^~~~~~~~~~~~

These warnings are fixed by using "%s" as the format string,
and then _() is used as the string argument.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
adblocks.c
ournal.c
ass1b.c
nix.c
til.c
4b58df1a53f517d700d921714610d1cec524dc92 11-Dec-2013 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: in rehash, mark newly allocated extent blocks as found

When we're rehashing directories, it's possible that an extent block
(or a map block) could be (silently) allocated by the underlying
libext2fs when expanding the directory. This silent allocation is not
captured in block_found_map, which is disastrous if later the rehash
process expands another directory and uses that same block from
before without realizing that it's now in use.

Therefore, if we notice that the free block count has dropped by more
than what e2fsck allocated itself during the expansion, we iterate the
directory's blocks a second time to ensure that these silent
allocations are marked in the found blocks bitmap.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass3.c
f0131bdc6ff2b349e84e4767d9fe8b078a0ee521 12-Dec-2013 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: fix memory leaks (on error path)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ournal.c
ass3.c
rofile.c
nix.c
3b6c0938ec5aa401c7ae6c95e94e5ad30a7b8562 11-Dec-2013 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: fix tests that set LARGE_FILE

For each site where we test for a large file (> 2GB) and set the
LARGE_FILE feature, use a helper function to make the size test
consistent with the test that's in e2fsck. This fixes the fsck
complaints when we try to create a 2GB journal (not so hard with 64k
block size) and fixes the incorrect test in fileio.c.

Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
ass2.c
487c9e3016aeccaf87fcc69bb1aa5eb43e8297fb 12-Dec-2013 Andreas Dilger <andreas.dilger@intel.com> e2fsck: fix problem comments to match actual message

Fix the e2fsck problem comments to match the actual message printed,
so that it is possible to find the problem code when searching by
the message.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
2fe2d408a4e231eb5d2342b7f3dbd155563aa755 04-Dec-2013 Andreas Dilger <adilger@dilger.ca> mmp: fix 64-bit handling of s_mmp_block

Fix the checking of s_mmp_block in e2fsck_pass1() and
ext2fs_mmp_read() to handle the high 32 bits of s_blocks_count.
Remove redundant check of s_mmp_block in do_dump_mmp() right before
ext2fs_mmp_read() is called.

Also fix s_blocks_count_hi in check_backup_super_block(), since it
cannot use the ext2fs_blocks_count() helper easily.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
uper.c
3971bfe878d6c30f9b5be3a2c0310943982a4775 03-Dec-2013 Theodore Ts'o <tytso@mit.edu> e2fsck: use dgrp_t for block group numbers

Make e2fsck consistently use dgrp_t for bloc group numbers to avoid
-Wconveresion noise.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ournal.c
essage.c
ass1.c
ass2.c
ass4.c
ass5.c
roblem.h
130e961a6fb9d38997c83c6397cf9ddb5ed2491f 03-Dec-2013 Theodore Ts'o <tytso@mit.edu> e2fsck: add support for 64-bit extended attribute block refcounting

If we have a 64-bit file system with extended attribute blocks, e2fsck
would not correctly handle EA blocks that were located beyond the
32-bit block number boundary. Fix this by teaching
e2fsck/ea_refcount.c to use 64-bit block numbers.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
a_refcount.c
27dc24defdadbbb63d4c1ed8b6c06839f77388ef 03-Dec-2013 Theodore Ts'o <tytso@mit.edu> e2fsck: fix j_maxlen if the file system is exactly 1 << 32 blocks

If the external journal device has exactly 1 << 32 blocks,
journal->j_maxlen would get set to zero, which would cause e2fsck to
declare the journal to be invalid.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ournal.c
b849f712000fa48e11e7ee8342362876783542ab 03-Dec-2013 Theodore Ts'o <tytso@mit.edu> e2fsck: use blk_t instead of blk64_t in check_resize_inode()

The resize inode only works on 32-bit block numbers, so use blk_t
instead of blk64_t. This avoids some -Wconversion noise, and slims
the compiled code slightly, especially on 32-bit platforms.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uper.c
974d57d3b1f896d2064ba854d7c037ab6478ecf8 03-Dec-2013 Theodore Ts'o <tytso@mit.edu> e2fsck: use errcode_t to suppress some -Wconversion warnings

We need to store some error codes using an int to keep recovery.c as
close as possible to the recovery.c source file in the kernel.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
ournal.c
ass1b.c
ehash.c
nix.c
til.c
3c7c6d73f1a0bd45835966f1179fc3e8236a7d9c 03-Dec-2013 Theodore Ts'o <tytso@mit.edu> e2fsck: use problem_t to suppress some -Wconversion warnings

All code which stores a problem code should use the problem_t type.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
ass2.c
ass5.c
7bef6d52125ef3f1ef07d9da71a13546f6843c56 03-Dec-2013 Kit Westneat <kwestneat@ddn.com> e2fsck: use ext2fs_write_dir_block3() instead of ext2fs_write_dir_block()

The use of ext2fs_write_dir_block() meant that attempts to fix
deleted/unused inodes in a directory would not be fixed for file
systems with 64-bit block numbers. (And some random block with the
high 32-bits cleared would get corrupted.)

Fix a similar problem when expanding directories and when creating the
lost+found dirctory.

Signed-off-by: Kit Westneat <kwestneat@ddn.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
ass2.c
ass3.c
832cb612f8c1c10525fe438206d4fe5c6d38a4e7 12-Oct-2013 Darrick J. Wong <darrick.wong@oracle.com> e2fsprogs: add (optional) sparse checking to the build

Run sparse against source files when building e2fsprogs with 'make C=1'. If
instead C=2, it configures basic ext2 types for bitwise checking with sparse,
which can help find the (many many) spots where conversion errors are
(possibly) happening.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
27b2297d5726623c2d119c671a0e1778aae6010a 12-Oct-2013 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: enable extents on all 64bit filesystems

Since it's impossible to address all blocks of a 64bit filesystem
without extents, have e2fsck turn on the feature if it finds (64bit &&
!extents).

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
roblem.h
uper.c
4dbfd79d1458ce1259b951377e341aeb6197f8c1 07-Oct-2013 Darrick J. Wong <darrick.wong@oracle.com> e2fsprogs: fix blk_t <- blk64_t assignment mismatches

Fix all the places where we should be using a blk64_t instead of a
blk_t. These fixes are more severe because 64bit values could be
truncated silently.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
ournal.c
essage.c
ass1.c
ass3.c
ehash.c
nix.c
til.c
085757fcc22a86168ee6793dfad9a95d88fb09db 09-Sep-2013 Eric Whitney <enwlinux@gmail.com> e2fsck: don't report uninit extents past EOF invalid

Commit d3f32c2db8 introduced a regression that caused e2fsck failures
in xfstests generic 013, 070, 083, 091, and 263. Uninitialized
extents created by fallocate() at the end of file with the
FALLOC_FL_KEEP_SIZE flag were identified as invalid. However,
because the file size is not increased when FALLOC_FL_KEEP_SIZE is
used, uninitialized extents can correctly contain blocks located past
the end of file.

Fix this by filtering out possible invalid extents if they are
uninitialized and extend past the block containing the end of file.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
7ff040f30f0ff3bf5e2c832da3cb577e00a52d60 09-Sep-2013 Eric Sandeen <sandeen@redhat.com> e2fsck: don't try to stop mmp if there is no superblock set up

Under some failure cases, we can get to fatal_error()
without even having a superblock set up. In that case,
ext2fs_mmp_stop() will segfault when it tries to dereference
fs->super.

Check for the existence of a superblock before we go
down the ext2fs_mmp_stop() path to avoid this problem.

Reported-by: Hubert Kario <hkario@redhat.com>
Addresses-Red-Hat-Bugzilla: #997972
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
til.c
c8ec2bad18fdaa842f786f3b37c9320a3411aea3 29-Jul-2013 Theodore Ts'o <tytso@mit.edu> e2fsck: correctly deallocate invalid extent-mapped symlinks

The function deallocate_inode() in e2fsck/pass2.c was buggy in that it
would clear out the inode's mode and flags fields before trying to
deallocate any blocks which might belong to the inode.

The good news is that deallocate_inode() is mostly used to free inodes
which do not have blocks: device inodes, FIFO's, Unix-domain sockets.

The bad news is that if deallocate_inode() tried to free an invalid
extent-mapped inode, it would try to interpret the root of the extent
node as block numbers, and would therefore mark various file system
metadata blocks (the superblock, block group descriptors, the root
directory, etc.) as free and available for allocation. This was
unfortunate.

(Try running an older e2fsck against the test file system image in the
new test f_invalid_extent_symlink, and then run e2fsck a second time
on the fs image, and weep.)

Fortunately, this kind of file system image corruption appears to be
fairly rare in actual practice, since it would require a very unlucky
set of bits to be flipped, or a buggy file system implementation.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass2.c
dd50ef87432284d93b9f39178c4fab242d76654e 29-Jul-2013 Theodore Ts'o <tytso@mit.edu> e2fsck: check extent-mapped directories with really large logical blocks

E2fsck was missing a check for directories with logical blocks so
large that i_size > 2GB. Without this check the test image found in
the new test f_toobig_extent_dir will cause e2fsck to die with a
memory allocation failure:

Error storing directory block information (inode=12, block=0, num=475218819): Memory allocation failed
e2fsck: aborted

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reported-by: Andrey Melnikov <temnota.am@gmail.com>
ass1.c
3df6014a3d216d19be7d2286de24e8ee106f18ad 16-Jun-2013 Theodore Ts'o <tytso@mit.edu> Work around Debian Bug #712530

Add a test to see if the backtrace() function requires linking in a
library in /usr/lib.

Addresses-Debian-Bug: #708307

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
igcatcher.c
d3f32c2db8f11c87aa7939d78e7eb4c373f7034f 07-Jun-2013 David Jeffery <djeffery@redhat.com> e2fsck: detect invalid extents at the end of an extent-block

e2fsck does not detect extents which are outside their location in the
extent tree. This can result in a bad extent at the end of an extent-block
not being detected.

From a part of a dump_extents output:

1/ 2 37/ 68 143960 - 146679 123826181 2720
2/ 2 1/ 2 143960 - 146679 123785816 - 123788535 2720
2/ 2 2/ 2 146680 - 147583 123788536 - 123789439 904 Uninit <-bad extent
1/ 2 38/ 68 146680 - 149391 123826182 2712
2/ 2 1/ 2 146680 - 147583 18486 - 19389 904
2/ 2 2/ 2 147584 - 149391 123789440 - 123791247 1808

e2fsck does not detect this bad extent which both overlaps another, valid
extent, and is invalid by being beyond the end of the extent above it in
the tree.

This patch modifies e2fsck to detect this invalid extent and remove it.

Signed-off-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
ass1.c
roblem.c
roblem.h
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>
ournal.c
essage.c
ass1.c
ass1b.c
ass2.c
ecovery.c
ehash.c
igcatcher.c
uper.c
26991d026e4b555229a4466ae4d003420321bbd2 05-May-2013 Theodore Ts'o <tytso@mit.edu> e2fsck: don't use IO_FLAG_EXCLUSIVE for read-only root file systems

When opening the external journal, use the same logic to decide
whether or not to open the file system with EXT2_FLAG_EXCLUSIVE found
in main().

Otherwise, it's not posible to use e2fsck when the root file system is
using an external journal.

Reported-by: Calvin Owens <jcalvinowens@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ournal.c
10fc3a63d9b7efb14e810ee94ad1d2f254d44eae 25-Apr-2013 Eric Sandeen <sandeen@redhat.com> e2fsprogs: allow 0-length xattr values in e2fsck

e2fsck thinks that this:

# touch mnt/testfile1
# setfattr -n "user.test" mnt/testfile1

results in a filesystem with corruption:

Pass 1: Checking inodes, blocks, and sizes
Extended attribute in inode 12 has a value size (0) which is invalid
Clear? yes

but as far as I can tell, there is absolutely nothing wrong with
a 0-length value on an extended attribute. Just remove the check.

Reported-by: David Shaw <dshaw@jabberwocky.com>
Reported-by: Harald Reindl <h.reindl@thelounge.net>
Addresses-Red-Hat-Bugzilla: #557959
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass1.c
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>
ecovery.c
a046da5963649663933cf16d54ca2a892cc1a560 08-Jan-2013 Nickolai Zeldovich <nickolai@csail.mit.edu> e2fsck: avoid memory corruption on ext2fs_open2 failure

In try_open_fs(), if ext2fs_open2() returns an error, do not try to
access the struct ext2_filesys. The previous check 'if (ret_fs)' was
always true, but even 'if (*ret_fs)' might be incorrect in some cases,
so check 'retval==0' instead.

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
6dd83548f4193f8bfd7983240471db0d0c7af626 08-Jan-2013 Nickolai Zeldovich <nickolai@csail.mit.edu> e2fsck: do not crash on long log file names

Previously e2fsck would corrupt memory if the log file name was longer
than 100 bytes (e.g., a long log_filename value in e2fsck.conf or a
pattern that expands out to more than 100 bytes). This was due to
incorrectly calling realloc() in append_string() on the struct string
instead of the malloc'ed char* buffer, among other problems. This
patch fixes the call to realloc() and also ensures that the buffer is
grown by sufficiently many bytes (not just by 2x).

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ogfile.c
bf50beb9f6b4c4d4c9f8fc7fc81d716a9ee79218 07-Jan-2013 Eric Sandeen <sandeen@redhat.com> e2fsck: show size requested when memory allocation fails

"e2fsck: Can't allocate dx_block info array"
is only so helpful - it'd be nice to know how much it tried to allocate.

In particular, since I think malloc(0) can return NULL,
it'd be nice to know if maybe we passed in an uninitialized (or
0-initialized) size.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
til.c
027b0577d4e5081a4d28dff9289559d38a36d533 03-Jan-2013 Theodore Ts'o <tytso@mit.edu> Fix 32-bit overflow problems: dgrp_t * s_blocks_per_group

There are a number of places where we multiply a dgrp_t with
s_blocks_per_group expecting that we will get a blk64_t. This
requires a cast, or using the convenience function
ext2fs_group_first_block2().

This audit was suggested by Eric Sandeen.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
uper.c
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>
ass1.c
ecovery.c
ehash.c
nix.c
til.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>
essage.c
roblem.c
ecovery.c
egion.c
igcatcher.c
1d6fd6d0c3766a8165e69284c75812574a29c804 29-Nov-2012 Andreas Dilger <adilger@dilger.ca> misc: cleanup unused variables on MacOS

Clean up unused variables found by GCC on MacOS.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
nix.c
til.c
29e8e74e02ae742874c8c37012da1e04a858eb2f 21-Dec-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: make sure the extent tree is consistent after bogus node in the tree

Commit 789bd401c3 ("e2fsck: fix incorrect interior node logical start
values") surfaced a bug where if e2fsck finds and removed an invalid
node in the extent tree, i.e.:

Inode 12 has an invalid extent node (blk 22, lblk 0)
Clear? yes

It was possible for starting logical blocks found in the interior
nodes of the extent tree. Commit 789bd401c3 added the ability for
e2fsck to discover this problem, which resulted in the test
f_extent_bad_node to fail when the second pass of e2fsck reported the
following complaint:

Interior extent node level 0 of inode 12:
Logical start 0 does not match logical start 3 at next level. Fix? yes

This patch fixes this by adding a call to ext2fs_extent_fix_parents()
after deleting the bogus node in the extent tree.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
789bd401c3bce85d3c2ae4504ca62509aa0a8b88 20-Dec-2012 Eric Sandeen <sandeen@redhat.com> e2fsck: fix incorrect interior node logical start values

An index node's logical start (ei_block) should
match the logical start of the first node (index
or leaf) below it. If we find a node whose start
does not match its parent, fix all of its parents
accordingly.

If it finds such a problem, we'll see:

Pass 1: Checking inodes, blocks, and sizes
Interior extent node level 0 of inode 274258:
Logical start 3666 does not match logical start 4093 at next level. Fix<y>?

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
roblem.c
roblem.h
c7e293251fa28aebb201a884c074f0b36cbacc20 16-Dec-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: fix pass5 optimization for bigalloc file systems

Commit 53e3120c18 introduced a regression which would case e2fsck to
overrun an array boundary for bigalloc file systems, and most likely
crash. Fix this by correctly using blocks instead of clusters when
incrementing the loop counter in the fast path optimization case.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
53e3120c18c0cb88bc757a7800872a6ca794f163 25-Nov-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: optimize pass 5 for CPU utilization

Add a fast path optimization in e2fsck's pass 5 for the common case
where the block bitmap is correct. The optimization works by
extracting each block group's block allocation bitmap into a memory
buffer, and comparing it with the expected allocation bitmap using
memcmp(). If it matches, then we can just update the free block
counts and be on our way, and skip checking each bit individually.

Addresses-Google-Bug: #7534813

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
ass5.c
2ae49fd0cc964aca40e846b47d9bc347b05716eb 24-Nov-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: optimize pass1 for CPU time

Optimize e2fsck pass 1 by marking entire extents as being in use at a
time, instead of block by block. This optimization only works for
non-bigalloc file systems for now (it's tricky to handle bigalloc file
systems since this code is also responsible for dealing with blocks
that are not correctly aligned within a cluster). When the
optimization works, the CPU savings can be significant: ove a full CPU
minute for a mostly full 4T disk.

Addresses-Google-Bug: #7534813

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
ass1.c
dd0c9a3c9cfdd250bfac283da05fd8920c823977 10-Oct-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: only consult inode_dir_map if needed in pass4

In e2fsck_pass4(), we were consulting inode_dir_map using
ext2fs_test_inode_bitmap2() for every single inode in the file system.
However, there were many cases where we never needed the result of the
test --- most notably if the inode is not in use.

I was a bit surprised that GCC 4.7 with CFLAGS set to "-g -O2" wasn't
able to optimize this out for us, but here is the pass 4 timing for an
empty 3T file system before this patch:

Pass 4: Memory used: 672k/772k (422k/251k), time: 3.67/ 3.66/ 0.00

and afterwards, we see a 43% improvement:

Pass 4: Memory used: 672k/772k (422k/251k), time: 2.09/ 2.08/ 0.00

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass4.c
51fb43dd271b1413d8203d95fe40be05caef8dd1 06-Oct-2012 Theodore Ts'o <tytso@mit.edu> Fix makefiles to compile e2freefrag with profiling

Also fix a bug caused by a stray continuation backslash which caused
the e2fsck/Makefile to fail when profiling is enabled.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
akefile.in
ab3f5c5aad6310be1d1891c05f1bc8cf7ccf0cef 10-Sep-2012 Theodore Ts'o <tytso@mit.edu> Allow e2fsprogs to be built using the clang (LLVM) frontend

Since clang uses C99 semantics by default, the main changes required
to allow clang to build e2fsprogs was to add support the C99 inline
semantics, while still allowing us to be built when the legacy (but
still default for gcc) GNU C89 inline semantics are in force.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs_user.h
d45b67c5f2a66597d8e2915052e180203a9193b8 07-Aug-2012 Jim Keniston <jkenisto@us.ibm.com> e2fsck: fix potential segv when handling a read error in a superblock

When passed a negative count (indicating a byte count rather than
a block count) e2fsck_handle_read_error() treats the data as a full
block, causing unix_write_blk64() (which can handle negative counts
just fine) to try to write too much. Given a faulty block device,
this resulted in a SEGV when unix_write_blk64() read past the bottom
of the stack copying the data to cache. (check_backup_super_block ->
unix_read_blk64 -> raw_read_blk -> e2fsck_handle_read_error)

Reported-by: Alex Friedman <alexfr@il.ibm.com>
Signed-off-by: Jim Keniston <jkenisto@us.ibm.com>
Signed-off-by: Dan Streetman <ddstreet@us.ibm.com>
Reviewed-by: Mingming Cao <mcao@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
handler.c
87e56a995c303d84d9c5ca5bff1bd35e66956e8a 30-Jul-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: print the number of blocks and inodes in the verbose statistics

In addition to the free blocks and free inodes, also print the number
of blocks and inodes in the verbose statistics.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
da0fa8f4988243ca1f1797338cbc09be894af1e0 30-Jul-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: allow for bigger disks when printing verbose statistics

Disks have gotten bigger, so 8 digits might not be enough. Allow for
12 digits worth of blocks, which is more than enough for 3 petabytes.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
c0a849660d1aea86b9f3ff986aae7b705a059e3e 29-Jul-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: add e2fsck.conf options for extra reporting

Add report_time, report_verbose, and report_features options to
e2fsck.conf which enable additional, more verbose reporting by e2fsck.
This is useful for large cloud installations where there are a large
number file systems being managed, and where it may not be obvious
from the e2fsck log files exactly how a particular file system is
configured.

The report_time and report_verbose options, which are the same as the
-tt and -v command line options, respectively, are useful because they
are options specific to e2fsck, and the fsck program does not have a
way of passing certain options only to a specific /sbin/fsck.<fstype>
program.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.conf.5.in
nix.c
32d4eb2b04f62e5380d29089040af2f8ba7b066e 29-Jul-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: fix code which uniquifies names in directory entries

When checking to see whether or not a new name is unique, the code was
using the wrong length parameter, which could cause the anti-collision
loop for a long time trying to find what it thinks is a unique name.

Addresses-Sourceforge-Bug: #3540545

Reported-by: Vitaly Oratovsky <vmo@users.sourceforge.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ehash.c
78a0d2ba6decf41f541f6ff79433b2d23aad35e8 29-Jul-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: check a file system mounted read-only if forced

Previously e2fsck would only allow a mounted file system to be checked
if it was the root file system and it was mounted read-only. Now
allow any file system mounted read-only if the -f option is specified.

This makes it easier to test how e2fsck handles checking file systems
which are mounted without having to test on the root file system.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
a85f83503a6eabeed6913520c97f49877dc2a366 29-Jul-2012 Theodore Ts'o <tytso@mit.edu> Revert "e2fsck: Skip journal checks if the fs is mounted and doesn't need recovery"

This reverts commit 47c1b8e16668daa6e74cee3c7b8bdf237ffefe70.

The original reason for this commit was to speed up boots for hard
drives. However, I've measured the time difference on a 1TB laptop
drive, and it's not significant: 70ms vs 10ms when running e2fsck on a
clean file system.

The problem with this optimization is that we don't notice if the
journal superblock has a non-zero s_errno field. If we don't transfer
the error indicator from the journal superblock to the file system
superblock, then the kernel will transfer it when the file system is
remounted read-write, causing scary messages to appear in the syslog.
(And since there was a bug in the kernel code which didn't clear the
error indicator in the journal superblock, it would never get
cleared.)

Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
75e862ecd01d7559cdf02fb761786b21fd788b7f 14-Jul-2012 Aditya Kali <adityakali@google.com> e2fsck/quota: mark FS invalid if quotas are not fixed

If user chooses to not fix quota info, then the FS should be
marked as having errors. PR_NO_OK prevented this from happening.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
roblem.c
585545e1ee6288e2eafb02937b640301be4a1368 15-Jul-2012 Theodore Ts'o <tytso@mit.edu> Fix spelling typo's in man pages for tune2fs and mke2fs

Addresses-Debian-Bug: #680114

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.8.in
2d2abcc64604c831c2db1da03fe701baefa1cb68 06-Jul-2012 Andreas Dilger <adilger@whamcloud.com> e2fsck: rename "bool" variables

Since "bool" is a valid C type, declarations of the form "int bool"
will cause compiler errors if <stdbool.h> is included. Rename these
variables to avoid this name clash.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2fsck.h
ass1.c
roblem.c
c1986ecb6fc68427db7579d409929939117e45ff 13-Jun-2012 Theodore Ts'o <tytso@mit.edu> Fix blhc (Build Log Hardening Check) warnings

The Build Log Hardening Check is a debian tool which scans the output
of a package build making sure that the security hardening flags are
used when compiling and linking all of binaries in a package.

For the most part we were passing CFLAGS, CPPFLAGS, and LDFLAGS down
to the compiler and link commands, but there there were one or two
exceptions. In addition, there where a few places in "make install"
where the V=1 option was not being honored, which triggered blhc
warnings since it couldn't analyze those commands.

The e2fsck.static was the only binary that was not getting built and
packaged with the hardening flags, but I've fixed all of the blhc
warnings so in the future it will be obvious if we regress.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
e9e96584b316f14d117801c61da5192743136b6f 12-Jun-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: update global free blocks/inodes count when truncating orphan inodes

By the time we start processing the orphan inode list, we have already
calculated the total expected number of free blocks and inodes in
ctx->free_{blocks,inodes}. This is used to set the free blocks/inodes
count in the superblock in the case where we don't need to do a full
e2fsck.

We need to update these expected free block counts as we process the
orphan inode list so that superblock values are set correctly.
Otherwise we could have the following happen:

% e2fsck /tmp/test.img
e2fsck 1.42.3 (14-May-2012)
Truncating orphaned inode 12 (uid=0, gid=0, mode=0100644, size=0)
Setting free blocks count to 46 (was 79)
/tmp/test.img: clean, 12/16 files, 54/100 blocks

% e2fsck /tmp/test.img
e2fsck 1.42.3 (14-May-2012)
Setting free blocks count to 79 (was 46)
/tmp/test.img: clean, 12/16 files, 21/100 blocks

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uper.c
9c40d14841f04811097a123d6e8555e78ce56811 11-Jun-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: only check for zero-length leaf extents

The on-disk format for interior nodes in the extent tree does not
encode the length of each entry in the interior node; instead, it is
synthesized/simulated by the extent library code in libext2fs.
Unfortunately, this simulation is not perfect; in particular it does
not work for the last extent in the extent tree if there are
uninitialized blocks allocated using fallocate with
FALLOC_FL_KEEP_SIZE, and it leads to e2fsck incorrectly complaining
about an invalid zero-length extent.

We only need to worry about the extent length for the leaves of the
tree, since it is there were we are checking an on-disk value, as
opposed to a software-generated simulation. So restrict the check of
extent length to leaf nodes in the extent tree.

Reported-by: Tao Ma <tm@tao.ma>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
63b3913dbc0bc7cdf8a63f3bdb0c8d7d605e9a40 11-Jun-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: correctly propagate error from journal to superblock

If the file system is mounted read-only after a file system error has
been detected, the fact that an error occurred is written to the
journal. This is important because while the journal is getting
replayed, the error indication in the superblock may very well get
overwritten.

Unfortunately, the code to propagate the error indication from the
journal to superblock was broken because this was being done before
the old file system handle is thrown away and the file system is
re-opened to ensure that no stale data is in the file system handle.
As a result, the error indication in the superblock was never written
out.

To fix this, we need to move the check if the journal's error
indicator has been set after the file system has been freed and
re-open.

Reported-by: Ken Sumrall <ksumrall@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ournal.c
2ae58b6d5c73e044f3d498feea5d81892af2671f 04-Jun-2012 Jan Kara <jack@suse.cz> libquota: remove unnecessary definitions

Quite some definitions in quota library are not necessary. Remove them.
Also fold quota.h file into quotaio.h since it didn't contain that many
definitions.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
6d75685e2b76f4099589ad33732cf59f279b5d65 01-Jun-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: handle an already recovered journal with a non-zero s_error field

If a file system was remounted read-only after a file system
corruption is detected, and then that file system is mounted and
unmounted by the kernel, the journal would have been recovered, but
the kernel currently leaves the s_errno field still set. This is
arguably a bug, since it has already propgated the non-zero s_errno
field to the file system superblock, where it will be retained until
e2fsck has been run.

However, e2fsck should handle this case for existing kernel by
checking the journal superblock's s_errno field even if journal
recovery is not required.

Without this commit, e2fsck would not notice anything wrong with the
file system, but a subsequent mount of the file system by the kernel
would mark the file system's superblock as needing checking (since the
journal's s_errno field would still be set), resulting an full e2fsck
run at the next reboot, which would find nothing wrong --- and then
when the file system was mounted, the whole cycle would repeat again.

I had seen reports of this in the past, but it wasn't until recently
that I realized exactly how this had come about, since normally e2fsck
would be run automatically before the file system is mounted again,
thus avoiding this problem. However, a user using a rescue CD who
didn't run e2fsck before mounting the a file system in this condition
could trigger this situation, and unfortunately, with previous
versions of e2fsprogs and the kernel, there would be no way out no
matter what the user tried to do.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ournal.c
cd5bb7c87b1891e21c095b3ecd549ef44a067c08 31-May-2012 Andreas Dilger <adilger@whamcloud.com> e2fsck: allow checking on mounted root fs

Commit 732e26b98e5c79a4298dbe341f43b54b354bb241 added checks to
prevent e2fsck from being run in filesystem-modifying mode against
a mounted or otherwise busy device, due to several bug reports of
users doing this even with the verbose warnings in check_mount().

However, it also prevented e2fsck from checking a mounted root
filesystem, which will prevent the node from booting. Once again
allow e2fsck to run against the mounted root filesystem if it is
also mounted read-only at the time.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
nix.c
182acd17bef0cf8dcb66568448a528abb1dfcd71 28-May-2012 Andreas Dilger <adilger@whamcloud.com> libext2fs: don't inline ext2fs_open_file() and ext2fs_stat()

The creation of inline wrappers ext2fs_open_file() and ext2fs_stat()
in commit c859cb1de0d624caa0779fb17d1a53766143136e in ext2fs.h caused
difficulties with the use of headers, since the headers for open64()
and stat64() may already be included (and skip the declaration of the
64-bit variants) before ext2fs.h is ever read. There is no real way
to solve the missing prototypes and resulting compiler warnings inside
ext2fs.h.

Since ext2fs_open_file() and ext2fs_stat() are not performance
critical operations, they do not need to be inline functions at all,
and the needed function headers can be handled properly in one file.

Similarly, posix_memalloc() was having difficulties with headers, and
was being defined in ext2fs.h, but it is now only being used by a
single file, so move the required header there.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ogfile.c
732e26b98e5c79a4298dbe341f43b54b354bb241 24-May-2012 Andreas Dilger <adilger@whamcloud.com> e2fsck: fix checks done for mounted vs. read-only

Currently, if e2fsck is run without the "-n" flag (i.e. it
might modify the filesystem), there is no guarantee that it will
open the filesystem with the EXCLUSIVE flag (i.e. O_EXCL) to
prevent the block device from being checked (in most cases this
means mounted, but it could also be an MD/LVM member device).

Conversely, if e2fsck is run with "-n" (i.e. read-only), and
/etc/mtab or /proc/mounts does not report the block device as
mounted then e2fsck thinks the filesystem is unmounted. In this
case, e2fsck incorrectly sets the EXCLUSIVE flag, which causes
the check to fail, even though e2fsck is running read-only.

To fix this, do not open with EXCLUSIVE if it is a read-only check,
and always open with EXCLUSIVE if the filesystem might be changed.
This also prevents filesystem mounts while e2fsck is running.

Also refuse allow e2fsck to run at all if the filesystem is BUSY.
The e2fsck check_mount() was checking for MOUNTED, but not BUSY,
and it should refuse to run outright if the block device is BUSY.
The previous MOUNTED heuristics pre-date the O_EXCL reservation
by the kernel, so there could be uncertainty due to stale /etc/mtab
data, but with newer kernels a busy device should never be modified.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
nix.c
9b01faa8b24909fca2d220efbdc989285796f6c4 22-May-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: fix precedence bug in built-in quota support

The operator precedence bug means that we might pay atteion to
s_grp_quota_inum even if the RO_COMPAT_QUOTA feature flag is clear.
However, fortunately, this is unlikely to happen in practice.

Cc: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.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>
fs_user.h
ournal.c
ecovery.c
2788cc879bbe667d28277e1d660b7e56514e5b30 24-Apr-2012 Andreas Dilger <adilger@whamcloud.com> e2fsck: quiet harmless inode/blocks errors

Don't consider only an error in the superblock summary as incorrect.
The kernel does not update this field except at unmount time, so
don't print errors during a "-n" run if there is nothing else wrong.
Any other unfixed errors will themselves mark the filesystem invalid.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass5.c
roblem.c
7943ccf5f2fa76f1dc164ddd1ffd5044a1dca31a 24-Apr-2012 Aditya Kali <adityakali@google.com> e2fsck,libquota: Update quota only if its inconsistent

Currently fsck recomputes quotas and overwrites quota files
whenever its run. This causes unnecessary modification of
filesystem even when quotas were never inconsistent. We also
lose the limits information because of this. With this patch,
e2fsck compares the computed quotas to the on-disk quotas
(while updating the in-memory limits) and writes out the
quota inode only if it is inconsistent.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
roblem.h
nix.c
ec7686e3e723ac8644a48ade6b58a1ca8dab6599 24-Apr-2012 Aditya Kali <adityakali@google.com> e2fsck: Fix check for hidden quota files

Currently e2fsck always incorrectly detects that quota inodes
need to be hidden (even if they are already hidden) and
modifies the superblock unnecessarily. This patch fixes the
check for hidden quota files and avoids modifying the
filesystem if quota inodes are already hidden.
Also, zero-out the old quota inode so that next fsck scan
doesn't complain.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
roblem.c
uota.c
c1732c5a9ae9a8ad6e3f66d95d55e169aa4d2ad3 09-Apr-2012 Theodore Ts'o <tytso@mit.edu> e2fsck.conf.5: add buggy_init_scripts to the man page

We have renamed buggy_init_scripts to accept_time_fudge. Explain this
so that people who find buggy_init_scripts in older e2fsck.conf files
understand what is going on.

Addresses-Debian-Bug: #646963

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.conf.5.in
b24efa218794b567c27ad99db319b4bd5d696958 06-Apr-2012 Theodore Ts'o <tytso@mit.edu> Don't assume that the presence of mntent.h means that setmntent() exists

Change autoconf to test for setmntent() and use that to decide whether
to use getmntent() and setmntent(), since some systems don't have
setmntent() but they do have the mntent.h header file.

Also, remove the includes of mntent.h from e2fsck and mke2fs and other
places where it is not needed.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
scan.c
cantest.c
nix.c
25ff7725cc934fff9bca44add76b5557c71e4a4a 06-Apr-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: add portability fallback in case getpwuid_r is not present

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ogfile.c
e64e6761aa22f31123a91206a5686526f7b9c6c0 05-Apr-2012 Theodore Ts'o <tytso@mit.edu> Fix gcc -Wall nitpicks

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
uota.c
nix.c
010dc7b90d97b93907cbf57b3b44f1c1cad234f6 23-Mar-2012 Lukas Czerner <lczerner@redhat.com> e2fsck: remove EXT4_EOFBLOCKS_FL flag handling

We've decided to remove EOFBLOCKS_FL from the ext4 file system entirely,
because it is not actually very useful and it is causing more problems
than it solves. We're going to remove it from e2fsprogs first and then
after the new e2fsprogs version is common enough we can remove the
kernel part as well.

This commit changes e2fsck to not check for EOFBLOCKS_FL. Instead we
simply search for initialized extents past the i_size as this should not
happen. Uninitialized extents can be past the i_size as we can do
fallocate with KEEP_SIZE flag.

Also remove the EXT4_EOFBLOCKS_FL from lib/ext2fs/ext2_fs.h since it is
no longer needed.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass1.c
roblem.c
roblem.h
010c49cf499738c7a06de13077f31f2a12ecadeb 22-Mar-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: report ext2fs_open2() and ext2fs_check_desc() errors

Print the actual errors returned by ext2fs_open2() and
ext2fs_check_desc() before we fall back to the backup block group
descriptors so that it's easier to see if there is some obscure
failure that is causing e2fsck to think that it should use the backup
block group descriptors.

Addresses-Google-Bug: #6208183

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
roblem.h
nix.c
349b8a37c5077086f1cd57c6b1b13ec275af6a43 22-Mar-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: avoid unnecessary close/reopen for non-MMP filesystems

For file systems that do not use MMP, there's no reason to close the
file system and then re-open the file system a second time, since
EXT2_FLAG_SKIP_MMP has no meaning for non-MMP file systems anyway.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger@whamcloud.com>
nix.c
41cec3498f5991c0e44d977d17fe7a85acc7010a 22-Mar-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: abort if ext2fs_check_desc() returns a memory failure

We were checking for ENOMEM, but in fact if the malloc() fails,
ext2fs_check_desc() will return EXT2_ET_NO_MEMORY.

Addresses-Google-Bug: #6208183

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
b0e91c89257d906324d6081c952157f768dfc699 18-Mar-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: add logging capability

Add the ability to log messages about a file system to a specified
directory, using a file name templace that can be specified in
/etc/e2fsck.conf. This allows us to suppress the output of overly
verbose e2fsck outputs while still allowing the full logging output to
go to an appropriate file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
2fsck.c
2fsck.conf.5.in
2fsck.h
ogfile.c
essage.c
roblem.c
roblem.h
nix.c
til.c
d2594cc8630eace4715fe1b5884cdbbcd139cd96 16-Mar-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: add the max_count_problems setting in e2fsck.conf

Also add appropriate documentation for options/max_count_problems and
problems/0xXXXXXX/max_count settings in /etc/e2fsck.conf

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.conf.5.in
roblem.c
905ac34992252c1bf22e378f8e4c168291a9b881 16-Mar-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: print a notice when we've started suppressing a problem code

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
b9a64a519af790216b6cd5105ccce55ff7f41a09 16-Mar-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: print the current and expected block group checksums

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
essage.c
roblem.c
roblem.h
uper.c
0f5676f202f9b4edfcd2bf4dde38af54f1b4a101 15-Mar-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: add support for field widths in messages using %-expansion

This will come in handy when printing checksums, some of which are
32-bit and some of which are 16-bit.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
essage.c
def8da382927803a88d6003d5baa159f668a153b 14-Mar-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: add ability to limit the # of problems of a particular type

This throttles the output of a particular problem type, to avoid a
bottleneck caused by (for example) printing a large number of
characters over a rate-limited a serial console.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
roblemP.h
26c09eb8145a16dcba6c40810d46a78712d253f2 11-Mar-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: check for zero length extent

If an extent has e_len set to zero, the kernel will oops with a
BUG_ON. Unfortunately, e2fsck wasn't catching this case. The kernel
needs to be fixed to notice this case and call ext4_error() instead of
failing an assertion check, but e2fsck should catch this case and
repair it (by deleting the errant extent).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
roblem.c
roblem.h
c15386cdeed2464736f46bf1b19ec80ba8812dbf 11-Mar-2012 Lukas Czerner <lczerner@redhat.com> e2fsck: do not discard itable if discard doen't zero data

We do not want to discard inode table if the underlying device does not
return zeros when reading non-provisioned blocks. The reason is that if
the inode table is not zeroed yet, then discard would not help us since
we would have to zero it anyway. In the case that inode table was
already zeroed, then the discard would cause subsequent reads to contain
non-deterministic data so we would not be able to assume that the inode
table was zeroed and we would need to zero it again, which does not
really make sense.

This commit adds check to prevent inode table from being discarded if
the discard does not zero data.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass5.c
f0fe5daecdb0c88afb76c23c77494bbe86e1cd2b 11-Mar-2012 Lukas Czerner <lczerner@redhat.com> e2fsck: do not discard when in read only mode

When argument '-n' was specified and should run in read-only mode, we
should not attempt to discard anything. In order to do that we have to
check for E2F_OPT_NO flag and clear E2F_OPT_DISCARD flag if E2F_OPT_NO
is set.

This commit fixes the problem when we would mark inode tables as zeroed
(EXT2_BG_INODE_ZEROED) even when e2fsck is running in read-only mode. We
also move the check for E2F_OPT_NO so we can clear E2F_OPT_DISCARD as
early as possible.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass5.c
nix.c
d2c9c42a0b1c0776afe47c9bfbddbc170d8aa036 11-Mar-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: optimize CPU usage in check_{block,inode}_bitmaps()

The boolean expression (!skip_group || csum_flag) is always true,
since if csum_flag is FALSE, skip_group must also be FALSE. Hence, we
can just remove the expression from the conditional altogether, thus
simplifying the code and making it easier to read/understand.

Also, in the case where the bit is set in the bitmap, there's no point
repeatedly setting first_free to be ext2fs_block_count(fs->super).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
deae60a087fceb3418efb8dd23ab557b767f925a 05-Mar-2012 Lukas Czerner <lczerner@redhat.com> e2fsck: do not forget to discard last block group

Previously when running e2fsck with '-E discard' argument the end of
the last group has not been discarded. This patch fixes it so we
always discard the end of the last group if needed.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass5.c
467953263ebb406dcf27c92146d6e394bf2f94e5 11-Mar-2012 Lukas Czerner <lczerner@redhat.com> e2fsck: remove last argument from e2fsck_discard_blocks()

Simple code cleanup.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
57581c1064493b5eceff961b82b70cde6b41fc17 11-Mar-2012 Lukas Czerner <lczerner@redhat.com> e2fsck: discard only unused parts of inode table

When calling e2fsck with '-E discard' option it might happen that
valid inodes are discarded accidentally. This is because we just
discard the part of inode table which lies past the free inode count.
This is terribly wrong (sorry!).

This patch fixes it so only the free parts of an inode table
is discarded, leaving used inodes intact. This was tested with highly
fragmented inode tables with block size 4k and 1k.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reported-by: Phillip Susi <psusi@ubuntu.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass5.c
ad880a0e2bb1bef11382b4f38d440529e4cbdc2e 21-Feb-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: check new sysfs interface to determine if we are on battery

...since the old way is deprecated.

Addresses-SourceForge-Bug: #3439277

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
40b9cc517351dbedff43ab4f4da59af4921b6d25 06-Feb-2012 Theodore Ts'o <tytso@mit.edu> e2fsck: allow the block bitmap to be uninit when the inode bitmap is in use

Removing this check will allow us to eventually eliminate code from
the kernel which forcibly initialized the block bitmap when the inode
bitmap is first used. This would eliminate a required journal credit
and extra disk write.

Addresses-Google-Bug: #5944440

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
roblem.h
uper.c
830b44f4385eb255d08fe0c8b200f8d8e3e97a8d 16-Dec-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: use different bitmap types as appropriate

Now that we have multiple backend implementations of the bitmap code,
this commit teaches e2fsck to use either the most appropriate backend
for each use case.

Since we don't know for sure if we will get it all right, the default
choices can be overridden via e2fsck.conf. The various definitions
are shown here, with the current defaults (which may change as we add
more bitmap implementations and as learn what works better).

; EXT2FS_BAMP64_BITARRAY is 1
; EXT2FS_BMAP64_RBTREE is 2
; EXT2FS_BMAP64_AUTODIR is 3
[bitmaps]
inode_used_map = 2 ; pass1
inode_dir_map = 3 ; pass1
inode_reg_map = 2 ; pass1
block_found_map = 2 ; pass1
inode_bad_map = 2 ; pass1
inode_imagic_map = 2 ; pass1
block_dup_map = 2 ; pass1
block_ea_map = 2 ; pass1
inode_link_info = 2 ; pass1
inode_dup_map = 2 ; pass1b
inode_done_map = 3 ; pass3
inode_loop_detect = 3 ; pass3
fs_bitmaps = 2

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
ass1.c
ass1b.c
ass2.c
ass3.c
nix.c
til.c
e35ff9b92ac8e1038f9ab972e6f3a73e0091d3ee 17-Dec-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: fix pass5 bug when using two different bitmap backends

The pass5 checks would fail if the expected and current {inode,block}
bitmaps used different back ends that returned different non-zero
values from the test_*_bitmap() functions. Fix this by changing
"(actual == bitmap)" to "(!actual == !bitmap)".

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
24c91184d6577271f7387962c90626c973389f00 16-Dec-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: fix use of uninitialized value in the MMP code

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
ass1b.c
4e523bbe00cfa0240b4581eeca0c097b05c9fe3e 29-Nov-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: speed up runs when using tdb for large atypical filesystems

Optimize how the tdb library so that running with [scratch_files] in
/etc/e2fsck.conf is more efficient. Use a better hash function,
supplied by Rogier Wolff, and supply an estimate of the size of the
hash table to tdb_open instead of using the default (which is way too
small in most cases). Also, disable the tdb locking and fsync calls,
since it's not necessary for our use in this case (which is
essentially as cheap swap space; the tdb files do not contain
persistent data.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
irinfo.c
b23f2f4de0c427a8488d095adb06d3c0f38dfb0a 28-Nov-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: fix handling of duplicate blocks with bigalloc file systems

We need to do an accounting of duplicate clusters on a per-cluster
instead of a per-block basis so we know when we've correctly accounted
for all of the multiply claimed blocks in a particular inode.

Thanks to Robin Dong for reporting this bug.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1b.c
2f7d855c632a5dd507669abc90ec452635a4a248 28-Nov-2011 Theodore Ts'o <tytso@mit.edu> libquota: remove use of PATH_MAX and replace it with QUOTA_NAME_LEN

PATH_MAX is not portable (for example, it doesn't exist on the Hurd).
So replace it with a new define, which defines the maximum length of
the base quota name. As it turns out, this is substantially smaller
than PATH_MAX.

Also move the definitions relating to quotaio.c from mkquota.h to
quotaio.h, as a cleanup.

Addresses-Debian-Bug: #649689

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uota.c
66df14687d6a905aa111ec7327357a3ae1ad3236 26-Nov-2011 Kazuya Mio <k-mio@sx.jp.nec.com> e2fsck: fix the max size calculation for non-extent file

When I create a non-extent file with the maximum size in ext4,
e2fsck detects the following error:

Pass 1: Checking inodes, blocks, and sizes
Inode 12, i_size is 4402345721856, should be 4402345721856. Fix?

As we know, e2fsck checks the size field of the inode in pass 1.
However, in case of the ext4 with the feature of ^extent and huge_file,
the maximum file size calculated in e2fsck is less than the real one.
The patch fixes this problem.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass1.c
13dcce8bb46961fcab14e87343e25aaebef7f44c 01-Nov-2011 Eric Sandeen <sandeen@redhat.com> e2fsck: return more status if fsck aborts

If we abort fsck (due to ENOMEM for example) we exit
with only the FSCK_ERROR flag. It seems useful
to do the same sorts of checks as we do on normal
exit, and return whether the filesystem was modified,
whether there are still uncorrected errors, etc, even
in the abort case.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
til.c
a86d55da8bf41335aa2fc5ec16ca63859d918e81 14-Nov-2011 Aditya Kali <adityakali@google.com> libquota: cleanup libquota code

This patch cleans up the quota code as suggested in previous reviews. This
includes
* remove BUG_ON()s and 'exit()' calls from library code
* remove calls to malloc/free and instead use ext2fs_get/free_mem functions.
* lib/quota/common.c file in not needed anymore and is removed.
* rename exported functions to start with quota_
(ex: init_quota_context --> quota_init_context)
* better error handling in quota library

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
uota.c
nix.c
0c80c44bd08c60f3cd0ad87f12a71a75cac3bcaa 17-Oct-2011 Theodore Ts'o <tytso@mit.edu> libext2fs: ext2fs_[set_]file_acl_block needs to check for 64-bit feature flag

The ext2fs_file_acl_block() and ext2fs_set_file_acl_block() needs to
only check i_file_acl_high if the 64-bit flag is set. This is needed
because otherwise we will run into problems on Hurd systems which
actually use that field for h_i_mode_high.

This involves an ABI change since we need to pass ext2_filsys to these
functions. Fortunately these functions were first included in the
1.42-WIP series, so it's OK for us to change them now. (This is why
we have 1.42-WIP releases. :-)

Addresses-Sourceforge-Bug: #3379227

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
essage.c
ass1.c
ass1b.c
ass2.c
uper.c
3fcd8fe8acb269598390b35bbf6e4247d10bc64e 09-Oct-2011 Theodore Ts'o <tytso@mit.edu> Fix more spelling errors found by translators and add pluralization

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
rof_err.et
nix.c
5a1a785efe0b3e2a8928ce0105923c356a838a31 09-Oct-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: fix problem message for PR_1_QUOTA_BAD_MODE

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.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>
fs_user.h
ecovery.c
84888e55438c7aa70d5866c203c06aea7576542e 08-Oct-2011 Theodore Ts'o <tytso@mit.edu> Fix spelling errors pointed out by translators

Also remove the _("<foo>") marker from a string that was all numbers
and hence didn't need punctuation.

Thanks to Philipp Thomas and Goeran Uddeborg for reporting these
buglets.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
rof_err.et
048c0e46d4bf45ca9156d2ac5e2c8f53aa584898 05-Oct-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: make e2fsck sigcatcher use SIGCHLD rather than SIGCLD

SIGCHLD is more portable than SIGCLD, which is a Linux specific thing

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
igcatcher.c
9d4507c5b61007df968638623aa1b4c47dae6cf9 05-Oct-2011 Theodore Ts'o <tytso@mit.edu> Pass the gettext() function to libcom_err

For those e2fsprogs programs which use libcom_err and are
internationalized, pass the gettext() function to libcom_err during
program initialization.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
36e4e21f511423450285568ceb26b3ddb233e286 04-Oct-2011 Theodore Ts'o <tytso@mit.edu> libquota: remove get_qf_name()

The get_qf_name() function used PATH_MAX, which is non-portable.
Worse, it blindly assumed that PATH_MAX was the size of the buffer
passed to it --- which in the one and only place where it was used in
libquota, was a buffer declared to a fixed size 256 bytes.

Fix this by simply getting rid of the function altogether.

Cc: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uota.c
1c5ffb6820c6a86c05b14f052120393dbede6359 04-Oct-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: make the signal catcher more portable, take 2

One table got missed when adding #ifdef's so that e2fsck/sigcatcher.c
would compile on non-Linux systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
igcatcher.c
86db36abfb3e9ec77c482e02ed8de073de4148e3 01-Oct-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: avoid unnecessary reboots in some cases when checking the root fs

If e2fsck modifies certain superblock fields which the kernel doesn't
look at, mark the superblock as dirty without marking the file system
as changed. This will avoid e2fsck signalling the init scripts that a
reboot is necessary. This is safe, because the kernel doesn't
actually look at these superblock fields.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uper.c
1660034c0a0c7199b0843909c756f8f9e42b85f5 30-Sep-2011 Darrick J. Wong <djwong@us.ibm.com> e2fsck: zero ctx->fs after freeing fs when restarting due to MMP

If MMP is enabled and e2fsck determines that it needs to restart
itself on account of various MMP conditions, it will close the current
fs and jump back to the start of fs checking. However, closing fs
also frees it, which means that we need to set ctx->fs to NULL to
prevent subsequent open code from accessing the old deleted pointer.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
8c0de61a245d43cfafbdc7d3f2201934d9dbe8c6 30-Sep-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: simplify binary search in ea_refcount.c

Remove the interpolation search in ea_refcount. The added complexity
isn't worth the speed up.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
a_refcount.c
0dbb256124db6dbc4bc47e00839c07c32dc29637 29-Sep-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: make the signal catcher more portable

All of the signals which the signal catcher tries to interpret aren't
necessarily defined on all systems. So add #ifdef's to protect
various signals to avoid compilation failures on non-x86 platforms.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
igcatcher.c
96a8afa7c134ef9239a70f264c35e709737f42cd 28-Sep-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: check for invalid bad block inode

In some cases the bad block inode gets corrupted. If it looks insane,
offer to clear it before trying to interpret it does more harm than
good.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
roblem.c
roblem.h
0f5eba7501f467f757792ee449d16c9259b994fd 24-Sep-2011 Andreas Dilger <adilger@whamcloud.com> ext2fs: add multi-mount protection (INCOMPAT_MMP)

Multi-mount protection is feature that allows mke2fs, e2fsck, and
others to detect if the filesystem is mounted on a remote node (on
SAN disks) and avoid corrupting the filesystem. For e2fsprogs this
means that it checks the MMP block to see if the filesystem is in use,
and marks the filesystem busy while e2fsck is running on the system.

This is useful on SAN disks that are shared between high-availability
servers, or accessible by multiple nodes that aren't in HA pairs. MMP
isn't intended to serve as a primary HA exclusion mechanism, but as a
failsafe to protect against user, software, or hardware errors.

There is no requirement that e2fsck updates the MMP block at regular
intervals, but e2fsck does this occasionally to provide useful
information to the sysadmin in case of a detected conflict.

For the kernel (since Linux 3.0) MMP adds a "heartbeat" mechanism to
periodically write to disk (every few seconds by default) to notify
other nodes that the filesystem is still in use and unsafe to modify.

Originally-by: Kalpak Shah <kalpak@clusterfs.com>

Signed-off-by: Johann Lombardi <johann@whamcloud.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2fsck.c
2fsck.h
ournal.c
ass1.c
ass1b.c
roblem.c
roblem.h
nix.c
til.c
6b56f3d92d08806ab415e8fd883480f7f9c148e8 24-Sep-2011 Andreas Dilger <adilger@whamcloud.com> misc: quiet minor compiler errors

Several compiler errors are quieted:
- zero-length gnu_printf format string
- unused variable
- uninitalized variable (though it isn't actually used for anything)
- fixed a bug in ext2fs_stat() if stat64() does not exist

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
a_refcount.c
roblem.c
egion.c
af67c12f77f22b521486ea1e969a820039a1561e 20-Sep-2011 Theodore Ts'o <tytso@mit.edu> e2fsck.8: fix spelling mistake in man page

Addresses-Debian-Bug: #642193

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.8.in
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>
akefile.in
rgv_parse.c
adblocks.c
rc32.c
ict.c
irinfo.c
x_dirinfo.c
2fsck.c
2fsck.h
a_refcount.c
handler.c
mptydir.c
xtend.c
lushb.c
scan.c
ournal.c
essage.c
trace.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
roblem.c
rofile.c
rofile_helpers.c
uota.c
ecovery.c
egion.c
ehash.c
evoke.c
cantest.c
igcatcher.c
uper.c
nix.c
til.c
fe65f1ecfc501b2470a20cfd9d07f4c9efa520d2 16-Sep-2011 Eric Sandeen <sandeen@redhat.com> e2fsprogs: Don't try to close an fd which is negative

These reflect either file descriptors which aren't tested
for failure, or closures of fd's which may have failed.

In setup_tdb(), test for failure of mkstemp and return
without trying to open the file (again).

In reserve_stdio_fds, rather than closing the "extra"
fd == 3 due to the way the loop is written, just
don't go that far by using while (fd <= 2).

In logsave, it forks and retries forever if open fails,
but at least make coverity happy by explicitly not
trying to close a negative file descriptor.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
irinfo.c
nix.c
6d4ced2192766f09f021ed801797961ad2f8e258 16-Sep-2011 Eric Sandeen <sandeen@redhat.com> e2fsck: Fix leaks in error paths

fn and/or array was not freed in some error paths.

[ Also make sure the array is NULL terminated before we free it in
get_dirlist(). --tytso]

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
rofile.c
14ed2edb26e94b41ac06d81804b3e6af576b5c79 16-Sep-2011 Eric Sandeen <sandeen@redhat.com> e2fsck: remove extraneous memset

e2fsck_allocate_memory() already sets allocated memory to 0,
so remove the explicit memset.

Especially since it was setting the wrong size (iter not *iter)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
irinfo.c
f85a9ae6397ff074193322a12ed721dbf5751e41 16-Sep-2011 Eric Sandeen <sandeen@redhat.com> e2fsck: Don't store old_op from ehandler_operation if we don't restore it.

old_op is set but never used, because we restore "0"
not old_op. So don't bother with it.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass1.c
ass2.c
da05d1413090b6aa8f728423db3279a0d5d0ce14 16-Sep-2011 Eric Sandeen <sandeen@redhat.com> e2fsck: handle null fs in print_pathname()

testing fs for NULL in expand_percent_expression():

e2fsck_ctx = fs ? (e2fsck_t) fs->priv_data : NULL;

implies that fs could be NULL, but it's passed to print_pathname()
which defererences it without further testing.

So make this safe by returning "???" for a nul fs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
essage.c
11ba79b3a67c864d23e04d1a2977b173f594bee9 16-Sep-2011 Eric Sandeen <sandeen@redhat.com> e2fsprogs: Remove impossible name_len tests.

The name_len field in ext2_dir_entry is actually comprised of
the name length in the lower 8 bytes, and the filetype in the
high 8 bytes. So in places, we mask name_len with 0xFF to
get the actual length.

But once we have masked name_len with 0xFF, there is no point
in testing whether it is greater than EXT2_NAME_LEN, which
is 255 - or 0xFF. So all of these tests are extraneous.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
essage.c
ass2.c
89efc88e65136ece22708cc28ec4124a33feeecd 15-Sep-2011 Theodore Ts'o <tytso@mit.edu> libext2fs: add metadata checksum and snapshot feature flags

Reserve EXT4_FEATURE_RO_COMPAT_METADATA_CSUM and
EXT2_FEATURE_COMPAT_EXCLUDE_BITMAP. Also reserve fields in the
superblock and the inode for the checksums. In the block group
descriptor, reserve the exclude bitmap field for the snapshot feature,
and checksums for the inode and block allocation bitmaps.

With this commit, the metadata checksum and exclude bitmap features
should have reserved all of the fields they need in ext4's on-disk
format.

This commit also fixes an a missing byte swap for s_overhead_blocks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Darrick J. Wong <djwong@us.ibm.com>
Cc: Amir Goldstein <amir73il@gmail.com>
ass1.c
32318ff20f848a18d39e22c93ca06d5444651cd1 16-Sep-2011 Yongqiang Yang <xiaoqiangnk@gmail.com> e2fsck: fix error in computing blocks of the ending group

If the blocks of a filesystem is a multiple of blocks_per_group,
blocks of the ending group is computed wrongly. Use the
new ext2fs_group_blocks_count() helper instead.

Eric Sandeen: Converted to use new blocks per group helper

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass5.c
765e03f0374b655ba99c0881aebf6c101098c282 16-Sep-2011 Lukas Czerner <lczerner@redhat.com> e2fsck: do not attempt to discard if -n was specified

If '-n' option is specified there should be no changes made to the file
system hence we should not attempt to discard the file system. This
commit adds a check into the e2fsck_discard_blocks() condition so it skip
discard if E2F_OPT_NO flag is set.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass5.c
dd62d856062b184bcf8ea8a050bfb00fee0a92e3 03-Sep-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: fix valgrind commit in sigcatcher

Thanks to Andreas Dilger for catching this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
igcatcher.c
624e4a6466dba9889f5f80dc168f2bb7c2a3f5d0 20-Jul-2011 Aditya Kali <adityakali@google.com> e2fsck: add support for checking the built-in quota files

This patch adds support for doing quota accounting during full
e2fsck scan if the 'quota' feature was set on the superblock.
If user-visible quota inodes are in use, they will be hidden
and converted to the reserved quota inodes.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
akefile.in
2fsck.h
essage.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
roblem.c
roblem.h
uota.c
uper.c
nix.c
9b3018a82e843d860e05dc8d75f9358d4436547e 11-Aug-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: catch termination signals and print information about them

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
2fsck.h
igcatcher.c
nix.c
95a7f15f4606fe69b2b025e061ebd230baae2bb4 10-Jul-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: teach e2fsck how to deal with bigalloc in non-extent-mapped inodes

Currently the bigalloc implementation in the kernel requires extents,
but this restriction might get relaxed in the future. Also, old
versions of mke2fs that supported bigalloc during early testing
created the root and lost+found directories without using
extent-mapped inodes. This makes it possible for e2fsck to better
support these old legacy file systems if it comes across them.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
f51b4d3341fd7e04ecb9e7dcdf03c5ed25209540 10-Jul-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: fix pass1b handling for bigalloc file systems

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1b.c
0bd0e5932046401049502ee99529b984d7cd316e 09-Jul-2011 Andreas Dilger <adilger@whamcloud.com> misc: use EXT2_I_SIZE() consistently to get size

Use the EXT2_I_SIZE() macro consistently to access the inode size.
The i_size/i_size_high combination is open coded in several places.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
essage.c
ass1.c
ass2.c
uper.c
25567a7b0fa98b390fd1ff0d4702b29c23a75bbb 05-Jul-2011 Theodore Ts'o <tytso@mit.edu> e2fsck, libext2fs: support for bigalloc file systems with a blocksize of 1024

Filesystems with a blocksize of 1024 have the superblock starting at
block #1. However, the first data block in the superblock is 0 to
simplify the cluster calculations. So we must compensate for this in
a number of places, mostly in the ext2fs library, but also in e2fsck.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uper.c
b2e6c86d61fccc39956c0cb8a8333f42d1569e8d 16-Jun-2011 Theodore Ts'o <tytso@mit.edu> mke2fs, e2fsck: fix i_blocks handling for bigalloc file systems

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
fe75afbf33389f71f8588af388d0c01db0cbf753 16-Jun-2011 Theodore Ts'o <tytso@mit.edu> Fix superblock field s_blocks_count for bigalloc file systems

Treat the s_blocks_count field in the superblock as a free block count
(instead of the number of free clusters) for bigalloc file systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
uper.c
a3efe4842054175d01b465fbe0b29b9be8b800a1 16-Jun-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: fix mysterious "FILE SYSTEM WAS MODIFIED" with no changes

Commit 2a77a784a3 (firest released in e2fsprogs 1.33) compared
superblock summary free blocks and inode counts with the allocation
bitmap counts before starting the file system check proper, and if
they differed, set the superblock and marked it as dirty. If no other
file systme changes were required, this would cause a "*** FILE SYSTEM
WAS MODIFIED ***" message without any explanation of what e2fsck had
changed.

We fix this by only setting the superblock summary free block/inodes
counts if we are skipping a full check, and in non-preen mode, e2fsck
will now print an explicit message stating how the superblock had been
updated.

In a full check, any updates to the superblock free blocks/inodes
fields will be noted in pass5.

This change requires changing a few test results (essentially
reversing the changes made in commit 2a77a784a3).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
roblem.c
roblem.h
uper.c
nix.c
3385a25408f7ecc1eac3bfcb619a2bf474687a14 16-Jun-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix pass5 handling for bigalloc && uninit_bg file systems

The code which simulated handling uninitialized block bitmaps didn't
take bigalloc file systems into account correctly. Fix it.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
931b58e1cb2158c1f5218059cce92e94917ef485 11-Jun-2011 Andreas Dilger <adilger@whamcloud.com> ext2fs: Handle internal journal over 2^32 bytes

The write_journal_inode() code is only setting the low 32-bit i_size
for the journal size, even though it is possible to specify a journal
up to 10M blocks in size. Trying to create a journal larger than 2GB
will succeed, but an immediate e2fsck would fail. Store i_size_high
for the journal inode when creating it, and load it upon access.

Use s_jnl_blocks[15] to store the journal i_size_high backup. This
field is currently unused, as EXT2_N_BLOCKS is 15, so it is using
s_jnl_blocks[0..14], and i_size is in s_jnl_blocks[16].

Rename the "size" argument "num_blocks" for the journal creation functions
to clarify this parameter is in units of filesystem blocks and not bytes.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ournal.c
nix.c
cf5301d7f2c3bbed3d26600335102414cbf0c4ba 11-Jun-2011 Andreas Dilger <adilger@whamcloud.com> misc: clean up compiler warnings

Fix several types of compiler warnings (unused variables/labels),
uninitialized variables, etc that are hit with gcc -Wall.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
essage.c
ass1.c
ass2.c
ass5.c
ehash.c
44fe08f1fa1e9a994ff304aa02022c53c9341519 11-Jun-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: add basic bigalloc support to check (but not yet repair) file systems

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
ass5.c
roblem.c
roblem.h
uper.c
7501ce3ee331b7cdb965ab95036090f2de91b5e0 01-Jun-2011 Eric Sandeen <sandeen@redhat.com> e2fsck: don't check/clone duplicate xattr blocks in fs without xattr feature

I had an extremely corrupted customer filesystem which, after thousands
of lines of e2fsck output, found one more problem on an immediately
subsequent e2fsck. In short, a file had had its i_file_acl block
cloned due to being a duplicate. That ultimately got cleared
because the fs did not have the xattr feature, and the inode
was subsequently removed due to invalid mode.

The 2nd e2fsck pass found the cloned xattr block as in use, but
not owned by any file, and had to fix up the block bitmaps.

Simply skipping the processing of duplicate xattr blocks on a
non-xattr filesystem seems reasonable, since they will be cleared
later in any case.

(also fix existing brace misalignment)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass1b.c
d3859af33f5bbbc432dedb20e85a5ae62e0fff03 10-May-2011 Aditya Kali <adityakali@google.com> mke2fs: Allow specifying reserved_ratio via mke2fs.conf

This patch adds support for specifying 'reserved_ratio' (percent blocks
reserved for super user, same as '-m' command line option) in mke2fs.conf.
It adds profile_get_double function in profile.c that allows reading
floating point values from profile files.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
rofile.c
rofile.h
b18c5fd51e829e5fb1a434604d4373409379744b 08-May-2011 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next
1760d167b2c0f91069a8b6e4a8fef1a5bc0f9ed1 08-May-2011 Theodore Ts'o <tytso@mit.edu> e2fsck: make the "fs is mounted; continue?" prompt more paranoid

A user received the "file system is mounted; do you really want to
continue" prompt, and then instead of typing "n" for no, forgot that
he hadn't declined to continuation question, and typed the up-arrow
key, which in his locale, the 'A' in "^[[A" was interpreted as "yes",
and he lost data.

This was clearly the user's fault, but to make e2fsck a bit safer
against user stupidity/carelessness, we will change the "fs is
mounted; continue?" prompt to default to no, and treat the escape
character (along with the return and space characters, currently) as a
request for the default answer.

Addresses-Debian-Bug: #619859
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
til.c
5af9eeaa7d36dd6f3a434697747ba8db3434eced 18-Mar-2011 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
lib/e2p/ls.c
d4a9330212280e0ff1204a4052f09f18691ed1cf 10-Mar-2011 Eric Sandeen <sandeen@redhat.com> e2fsprogs: man page typo fixes

Fix a few typos in manpages.

Reported-by: Branislav Náter <bnater@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2fsck.conf.5.in
829d9994880394e48c883510799b1536812d6efb 28-Feb-2011 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
lib/ext2fs/initialize.c
412376efff3c0e0c2fea00666c2457e6f2ae1878 26-Feb-2011 Theodore Ts'o <tytso@mit.edu> Add basic BIGALLOC support for cluster-based allocation

This adds the superblock fields needed so that dumpe2fs works and the
code points and renames the superblock fields from describing
fragments to clusters.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uper.c
0edcc2702106ef8ea0d4ab60ef06c0c38b0b87ee 15-Feb-2011 Aditya Kali <adityakali@google.com> e2fsprogs: reserving code points for new ext4 quota feature

This patch adds support for detecting the new 'quota' feature in ext4.
The patch reserves code points for usr and group quota inodes and also
for the feature flag EXT4_FEATURE_RO_COMPAT_QUOTA.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
essage.c
562f264243f4d4385910b6f06872730214977736 20-Dec-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
lib/ext2fs/block.c
lib/ext2fs/csum.c
resize/main.c
25623feab4789b86880da8ded5605ff17ebf3908 17-Dec-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'master' into next

Conflicts:
e2fsck/e2fsck.h
e2fsck/unix.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>
ecovery.c
0358c9f9a43ce0ef33f7891ca9f9d67abd3b4853 13-Dec-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
e2fsck/pass4.c
misc/dumpe2fs.c
resize/online.c
71873b17307993c08b38b97c9551bed231e6048c 13-Nov-2010 Bernd Schubert <bs_lists@aakef.fastmail.fm> e2fsck: add an option which causes it to only do a journal replay

As recently discussed on linux-ext4@vger.kernel.org add an option to e2fsck
to allow to replay the journal only. That will allow scripts, such as
pacemakers 'Filesystem' RA to first replay the journal and if that sets
an error state from the journal replay, further check for that error
(dumpe2fh -h | grep "Filesystem state:") and if that shows and error
to refuse to mount. It also allows automatic e2fsck scripts to first
replay the journal and on a second run after the real pass1 to passX checks
to test for the return code.

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2fsck.8.in
2fsck.h
nix.c
b95ca92811e182c10150f8d2d08d6113af2abdf9 06-Dec-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Do blkid interpretation on the external journal specifier

If the user specifies "e2fsck -j UUID=XXX", e2fsck should do blkid
interpretation, since e2fsck does it with the base file system name.
So from the sake of consistency and user convenience, we should do it
here too.

Addresses-Debian-Bug: #559315

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
75990388365c5688dbade9c33a3394e40f757526 06-Dec-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Add the ability to force a problem to not be fixed

The boolean options "force_no" in the problems stanza of e2fsck.conf
allows a particular problem code be treated as if the user will answer
"no" to the question of whether a particular problem should be fixed
--- even if e2fsck is run with the -y option.

As an example use case, suppose a distribution had widely deployed a
version of the kernel where under some circumstances, the EOFBLOCKS_FL
flag would be left set even though it should not be left set, and a
customer had a workload which exercised the fencepost error all the
time, resulting in many large number of inodes that had EOFBLOCKS_FL
set erroneously. Enough, in fact, the e2fsck runs were taking too
long. (There was such a bug in the kernel, which was fixed by commit
58590b06d in 2.6.36).

Leaving EOFBLOCKS_FL set when it should not be isn't a huge deal, and
is certainly than having high availability timeout alerts going off
left and right. So in this case, the best fix might be to put the
following in /etc/e2fsck.conf:

[problems]
0x010060 = { # PR_1_EOFBLOCKS_FL_SET
force_no = true
no_ok = true
no_nomsg = true
}

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.conf.5.in
roblem.c
roblemP.h
992016c5afde0f77a9ff10c4fc5be02f83eb055c 27-Nov-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix inode nlink accounting that could cause PROGRAMMING BUG errors

This fixes two possible causes for the error message:

WARNING: PROGRAMMING BUG IN E2FSCK!
OR SOME BONEHEAD (YOU) IS CHECKING A MOUNTED (LIVE) FILESYSTEM.
inode_link_info[X] is Y, inode.i_links_count is Z. They should be the same!

One cause which can trigger this message is when an inode has an
illegal link count > 65500 --- for example, 65535. This was the case
in the Debian Bug report #555456.

Another cause which could trigger this message is if an ext4 directory
previously had more than 65000 subdirectories (thus causing
i_link_count to be set to 1), but then some of the subdirectories were
deleted, such that i_link_count should now be the actual number of
subdirectories.

Addresses-Debian-Bug: #555456

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass4.c
6a81b40ae7f1334dc8b3872534d2abb0646eafbd 27-Nov-2010 Theodore Ts'o <tytso@mit.edu> e2fsck.conf.5: Clarify man page

Clarify the e2fsck.conf(5) man page to make it clear that it applies
for ext4 file systems.

Addresses-Debian-Bug: #591083

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.conf.5.in
efa1a355a1e4142b2d057be06931eb8fc0903ba3 18-Nov-2010 Lukas Czerner <lczerner@redhat.com> e2fsck: Discard free data and inode blocks.

In Pass 5 when we are checking block and inode bitmaps we have great
opportunity to discard free space and unused inodes on the device,
because bitmaps has just been verified as valid. This commit takes
advantage of this opportunity and discards both, all free space and
unused inodes.

I have added new set of options, 'nodiscard' and 'discard'. When the
underlying devices does not support discard, or discard ends with an
error, or when any kind of error occurs on the filesystem, no further
discard attempt will be made and the e2fsck will behave as it would
with nodiscard option provided.

As an addition, when there is any not-yet-zeroed inode table and
discard zeroes data, then inode table is marked as zeroed.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2fsck.8.in
2fsck.h
ass5.c
nix.c
f35c7b55946788a4e3a9c9a73885e9a2e6e045e4 22-Nov-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'
8718359b4057bf2b998f4ac6125e33f20efe60cb 26-Sep-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Open the external journal in exclusive mode

This prevents accidentally replaying and resetting the journal while
it is mounted, due to an accidental attempt to run e2fsck on an LVM
snapshot of a file system with an external journal.

Addresses-Debian-Bug: #587531

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ournal.c
b70506bffba208daa2dc176be9370bc198ecd221 25-Sep-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Set i_blocks_hi when correcting the i_blocks field in pass #1

For file systems with 64-bit block numbers, we need to make sure we
correct the i_blocks_hi field as well as the i_blocks field when
setting it to the correct value.

Thanks to Justin Maggard for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
9d92a201deec7bbb1911e6e5ee98abf3c83882d4 25-Sep-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
configure
configure.in
lib/ext2fs/ext2fs.h
misc/mke2fs.c
32f66cc791f597a3522607b233cefc4f1e673fc1 08-Sep-2010 Jan Kara <jack@suse.cz> e2fsck: Improve error message when device name misspelled

When a device name is misspelled, we output the full text about specifying
alternate superblock. This is slightly misleading because when the device
cannot be open because of ENOENT, this certainly won't help. So just print
that device does not exist and exit.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
nix.c
db0bdb49f49fc3dd14c12439d934a3403a3be9f1 19-Jul-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
resize/extent.c
ac92f3cc0443f5980775e6c3e86724ed817587f6 06-Jul-2010 Theodore Ts'o <tytso@mit.edu> e2fsck, resize2fs: fix a fp precision error that can lead to a seg fault

Commit 641b66b fixed a floating point precision error which can result
in a search algorithm looping forever. It can also result in an array
index being out of bounds and causing a segfault. Here are two more
cases in e2fsck and resize2fs that need to be fixed. I've just used
the same fix from the that commit.

Signed-off-by: Lachlan McIlroy <lmcilroy@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
a_refcount.c
22ff06d5f7a90914f7a90bae420e5be7d2e02ce3 05-Jul-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Add missing ext2fs_close() call when going back to original superblock

In the case where the original superblock and the backup superblock
are both invalid in some way, e2fsck will try to go back to the
orignal superblock. To do that, it must close the attempted open
using the backup superblock first (since otherwise the exclusive open
will prevent the subsequent open from succeding).

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
b887f08f959fa3ef4ead9b6e2fd71becf4877a40 05-Jan-2010 Mike Frysinger <vapier@gentoo.org> e2freefrag: Fix getopt bug on machines with unsigned chars

The getopt() function returns an int, not a char. On systems where the
default char is unsigned (like ppc), we get weird behavior where -1 is
truncated to 0xff but compared to (int)-1.

Also fix this same bug for two test programs, test_rel and iscan,
which aren't currently used at the moment.

Addresses-Gentoo-Bug: #299386

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
scan.c
993988f65527e5665181b3e4a6161f317e396489 25-Jun-2010 Theodore Ts'o <tytso@mit.edu> Add superblock fields which track first and most recent fs errors

Add superblock fields which track where and when the first and most
recent file system errors occured. These fields are displayed by
dumpe2fs and cleared by e2fsck.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
6dc64392c052839f373b7bbbb58efa3048bfb355 13-Jun-2010 Valerie Aurora Henson <vaurora@redhat.com> e2fsck: Fix up to be 64-bit block number safe

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
mptydir.c
fs_user.h
ournal.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass5.c
ehash.c
uper.c
nix.c
97d26ce9e3589e9f5fa17014467a9730a884d158 07-Jun-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
e2fsck/journal.c
e2fsck/pass1.c
e2fsck/pass2.c
misc/mke2fs.c
ae2272f8459f75c064b2644320db4ec5213d40a9 19-May-2010 Eric Sandeen <sandeen@redhat.com> e2fsck: correct test for EOFBLOCKS

This test, added to e2fsprogs-1.41.12, is backwards.

If EOFBLOCKS is set, then the size -should- be less than
the last physical block...

xfstests 013 caught this.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass1.c
2e6436d459307af8d6be6fb0da6ab24860d8e677 18-May-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Don't set the group descriptor checksums if the fsck was cancelled

It's a bad idea to set the checksums if e2fsck is aborted by the user,
and it often causes an error message, "Inode bitmap not loaded while
setting block group checksum info".

Addresses-Launchpad-Bug: #582035

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
5aa6c3f61c0559f03b68bdeef886f34ece106757 18-May-2010 Theodore Ts'o <tytso@mit.edu> Add configure options --enable-symlink-build and --enable-symlink-install

These options allow e2fsprogs to be built using symlinks instead of
hard links, and to be installed using symlinks instead of hard links,
respectively.

Addresses-Sourceforge-Bug: #1436294

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
e6238d3708d328851bfdff7580d1b8504c7cf2e4 15-May-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Explicitly reject extents that begin at physical block 0 as illegal

In the case where s_first_data_block is 1, we need to explictly reject
an extent whose starting physical block is zero.

Thanks to Jiaying Zhang <jiayingz@google.com> for finding this bug.

Addresses-Google-Bug: #2573806

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
ee74cf16b5aa98fc210da23ba3a6c64d5a63289d 17-Mar-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix segmentation fault when checking a file system

If a corrupted file system causes us to want to delete an extent, and
that causes us to want to release a block in e2fsck pass #1, it would
be preferable if e2fsck didn't seg fault. This tends to get users
craky, as users are wont to do. :-)

Thanks to Dirk Reiners for reporting this bug:

e2fsck crashes fixing a corrupted 3.5 TB filesystem:

0x0000000000432002 in ext2fs_unmark_generic_bitmap (bitmap=0x0, bitno=623386749)
at gen_bitmap.c:183
183 if ((bitno < bitmap->start) || (bitno > bitmap->end)) {
(gdb) bt
bitno=623386749) at gen_bitmap.c:183
block=623386749) at ../../lib/ext2fs/bitops.h:319
inuse=-1) at alloc_stats.c:78
extent.c:1509
pb=0x7fffffffdfe0, start_block=0, ehandle=0x6dcf50) at pass1.c:1709
pb=0x7fffffffdfe0, start_block=0, ehandle=0x6dcf50) at pass1.c:1737
pctx=0x7fffffffe100, pb=0x7fffffffdfe0) at pass1.c:1842
block_buf=0x6c4330 "\373\212#") at pass1.c:1920

The source of the NULL bitmap is fs on stack frame 2:

(gdb) up 2
inuse=-1) at alloc_stats.c:78
78 ext2fs_unmark_block_bitmap(fs->block_map, blk);

Addresses-SourceForge-Bug: #2971800

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
177839e2454dcc298244481da9c72a19b41836be 13-May-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Skip time-based checks if the time looks insane or broken_system_clock

There are broken embedded devices that have system clocks that always
reset to January 1, 1970 whenever they boot (even if no power is
lost). There are also systems that have super cheap clock crystals
that can be very inaccurate. So if the option broken_system_clock is
given, disable all time based checks. E2fsck will also try to detect
incorrect system clock times, and automatically mark the system clock
as insane.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.c
2fsck.conf.5.in
2fsck.h
roblem.c
uper.c
nix.c
65d71894c9f254ea1a5eb836e454dd263b13a867 30-Mar-2010 Eric Sandeen <sandeen@redhat.com> e2fsck: make block counting variable in pass1 64 bits

Justin reported that creating a 4T file with posix_fallocate led
to fsck errors:

e2fsck 1.41.10 (10-Feb-2009)
Pass 1: Checking inodes, blocks, and sizes
Inode 12, i_blocks is 8589935432, should be 840. Fix? yes

This looks like a 32-bit overflow.

commmit 8a8f36540bbf5d4397cf476e216e9a720b5c1d8e added handling of
the high i_blocks number, but we accumulate blocks in the num_blocks
field, and that's still just 32 bits.

Note: we don't need to expand max_blocks for now, that's only used
in the non-extents case, and those files have smaller max sizes.

I haven't been able to replicate the problem, oddly, but Justin
reports that this patch fixed his situation.

Reported-by: Justin Maggard <jmaggard10@gmail.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass1.c
5750e5f9246ead0bc2af7da0cb5bcdfc916cace6 13-Apr-2010 Eric Sandeen <sandeen@redhat.com> e2fsck: mark sparse journal as invalid

For a filesystem that fails with:

journal_bmap: journal block not found at offset 7334 on loop0
JBD: bad block at offset 7334

e2fsck won't actually fix this; it will mark the fs as clean,
so it will mount, but it does not fix that block, and when the
journal reaches this point again it will fail again.

The following simple change to process_journal_block() might be
a little drastic; it will clear & recreate the journal inode if
it's sparse - i.e. if it gets block 0.

I suppose we could be more complicated and try to replay the journal
up to the error, but I'm not sure it's worth it since we're fscking
it anyway.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ournal.c
a6217f5ae2ca02f2f12c259b34615cbd7f4110d6 13-May-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix a number of problems that were inappropriately using PROMPT_ABORT

There were a number of problems that were prompting the user whether
or not to ABORT, but then would abort regardless of whether the user
answered yes or no. Change those to be PROMPT_NONE, PR_FATAL.

Also, fix PR_1_RESIZE_INODE_CREATE so that it recovers appropriately
after failing to create the resize inode. This problem now uses
PROMPT_CONTINUE instead of PROMPT_ABORT, and if the user says, "no",
the code will abort.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
roblem.c
roblem.h
0433c1f1b72bb85d9ea11e7716a415a878a655c8 11-May-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Don't clear inodes if we found inodes that are in the unused region

Commit 6267ee4 avoided repeating pass #1 over and over again if
multiple block groups are found with inodes in the bg_itable_unused
region during pass #2. This caused a regression because the problem
with not restarting pass #1 right away is that e2fsck will offer to
clear directory entries for inodes that are deleted, and e2fsck can't
easily distinguish between deleted inodes and inodes that were skipped
because of an incorrect bg_itable_unused value. So once an inode is
found in an unused region and we know that we're going to restart the
e2fsck pass, don't offer to clear any deleted inodes --- since those
will be caught in the second round.

Addresses-Google-Bug: #2642165

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass2.c
2291fbb0358be8251df0d611913f49fbb9beb740 10-May-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Check for cases where EOFBLOCKS_FL is unnecessarily set

Some kernels will crash if EOFBLOCKS_FL is set when it is it not
needed, and this if it is left set when it isn't needed, it is a sign
of a kernel bug.

Addresses-Google-Bug: #2604224

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
roblem.c
roblem.h
d9af85b50bbabf6f099d6732e77d6b1443e651cf 08-Apr-2010 Theodore Ts'o <tytso@mit.edu> Revert "e2fsck: fix spurious complaints about i_size caused by preallocated blocks"

This reverts commit 0ea910997b3c2ba09b65b852b9bb4dd7b4d68999.

Since the Linux kernel now has support for the EXT4_EOFBLOCKS_FL flag
starting in 2.6.34, we don't need this workaround any more.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
19f433a5214e720a95bdbf78bdcdca353c25b770 17-Mar-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix segmentation fault when checking a file system

If a corrupted file system causes us to want to delete an extent, and
that causes us to want to release a block in e2fsck pass #1, it would
be preferable if e2fsck didn't seg fault. This tends to get users
craky, as users are wont to do. :-)

Thanks to Dirk Reiners for reporting this bug:

e2fsck crashes fixing a corrupted 3.5 TB filesystem:

0x0000000000432002 in ext2fs_unmark_generic_bitmap (bitmap=0x0, bitno=623386749)
at gen_bitmap.c:183
183 if ((bitno < bitmap->start) || (bitno > bitmap->end)) {
(gdb) bt
bitno=623386749) at gen_bitmap.c:183
block=623386749) at ../../lib/ext2fs/bitops.h:319
inuse=-1) at alloc_stats.c:78
extent.c:1509
pb=0x7fffffffdfe0, start_block=0, ehandle=0x6dcf50) at pass1.c:1709
pb=0x7fffffffdfe0, start_block=0, ehandle=0x6dcf50) at pass1.c:1737
pctx=0x7fffffffe100, pb=0x7fffffffdfe0) at pass1.c:1842
block_buf=0x6c4330 "\373\212#") at pass1.c:1920

The source of the NULL bitmap is fs on stack frame 2:

(gdb) up 2
inuse=-1) at alloc_stats.c:78
78 ext2fs_unmark_block_bitmap(fs->block_map, blk);

Addresses-SourceForge-Bug: #2971800

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
c5b23f6c0e17503630455fb16d1b2035f844acc9 15-Mar-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next
59119646bd7e079aaed70366c405322d2dc7fa53 15-Mar-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Don't blow up if the physical device is too big

If the user grows a partition bigger than 2**32 blocks, e2fsprogs
1.41.x is not going to be able to support resizing the filesystem,
since it doesn't have > 2**32 block support. However, e2fsck should
still work, so the system administrator doesn't get stuck.

Addresses-Launchpad-Bug: #521648

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
nix.c
751265b0b49a5ff7c746d111a11bb883aa300841 13-Mar-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Make the "filesystem is mounted" message more scary

I guess the message wasn't scary enough for users who are just smart
enough to really get themselves in deep doo-doo. Let's make it even
scarier.

Addresses-Launchpad-Bug: #537483

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
298c9c2f2e7cbe4250d054d2e0f4bef007a940ac 13-Mar-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Make the -n always open the file system read-only

A user was surprised when -n -D caused the file system to be opened
read/write, and then outsmarted himself when e2fsck asked the question:

WARNING!!! Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.

Do you really want to continue (y/n)?

This is partially our fault for not documenting the fact that -D
overrode opening the filesystem read-write. But the bottom line is it
much safer if -n *always* opens the file system read-only, so there
can be no confusion. This means that we have to disable certain
combination of options, such as "-n -c", "-n -l", and "-n -L", and
"-n -D", but the utility of these combinations is pretty low, and
is more than offset by making e2fsck idiot-proof.

Addresses-Launchpad-Bug: #537483

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.8.in
nix.c
4ffafee26cf791c0c651c08d3dcefcdd363bf127 24-Feb-2010 Eric Sandeen <sandeen@redhat.com> e2fsck: don't complain about i_size for known blocks past EOF

This is the userspace side of Jiaying's EOFBLOCKS patch. With
Aneesh's patches for .33, Jiaying's patch, and this one, xfstests
013/fsstress (even with direct IO enabled) has held up through many
runs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
53fbfb2bc3490d0ff317666322dd077c08116e0c 23-Feb-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix bug which can cause e2fsck -fD to corrupt non-indexed directories

E2fsprogs 1.41.10 introduced a regression (in commit b71e018) where
e2fsck -fD can corrupt non-indexed directories when are exists one or
more file names which alphabetically sort before ".". This can happen
with ext2 filesystems or for small directories (take less than a
block) which contain filenames that begin with a space or some other
punctuation mark.

Fix this by making sure we never reorder the '.' or '..' entry in the
directory, since they must be first.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ehash.c
cc84d866e2f29d92b5a732fead4df2dd9f814f2b 11-Feb-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
e2fsck/pass1.c
1ec42a00a5354c342f213722382a4d1987af74ca 05-Feb-2010 Nick Dokos <nicholas.dokos@hp.com> e2fsck: Fix the check if a file is really a directory to understand extents

Pass 1 has a test to see if a special file is really a directory.

Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
2d07b3ad98bfe1db5fb1071f53a5338ab6c35522 31-Jan-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
configure
lib/ext2fs/alloc_tables.c
misc/mke2fs.c
2884320016e633d987203c0286a9dbf9e62a3fd4 31-Jan-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Remove some erroneously leftover blk_t casts

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
c70674387ee0c038bca16098f7869181beeabe0a 04-Jan-2010 Theodore Ts'o <tytso@mit.edu> e2fsck: Add new e2fsck.conf option: broken_system_clock

The broken_system_clock allows the time to be in the future when in
preen mode. It's useful for people who have, as the name implies,
broken system clocks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.conf.5.in
roblem.c
8a2cbe2c6deb93ccfed58fd755c886fce16586a3 29-Nov-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Try to update on-disk bitmap in e2fsck_get_alloc_block() callback

The e2fsck_get_alloc_block() callback is used so that if the ext2fs
library needs to allocate blocks internally (most notably by the
extents functions), e2fsck's internal block usage map is consulted
since it is the only thing that can be trusted during a large part of
e2fsck's operation.

Change it to update the on-disk bitmap if it is loaded. This reduces
the number of spurious differences found in pass #5.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
f4e14505ed19a1527aa69a0474fe3b15ddf8b188 29-Nov-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Don't rehash directories which can fit in a single directory block

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ehash.c
3a6be7bc18f593789728fa9887bc74c9bf9d1930 29-Nov-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix block allocation for holes in extent-mapped directories

In pass 2, when allocating new blocks for holes in directories, use
ext2fs_set_bmap() instead of ext2fs_block_iterate2() with a helper
function so that the newly allocated directory blocks are correctly
assigned in extent-mapped directories.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass2.c
4607ef7d53304c00f6259ab671e597d5493b9786 29-Nov-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: detect holes in extent-mapped directories

Directories are not allowed to be sparse; the code for scanning
extent-mapped directories was not calling ext2fs_add_dir_block() for
missing directory blocks, so we weren't catching this form of file
system corruption. Fix this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
a49249d2e314d503f203ed1cce73fdf7f5d09ddc 28-Nov-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Move check to add an index to a directory after fixing i_size

The check that determines whether an directory needs to be have an
index added to it depends on i_size. So move it after we have fixed
up i_size so that we reliable will rehash a directory that needs it,
even if its i_size field was originally incorrect. Otherwise, a
second run of e2fsck would be needed before the directory gets an
index added.

Thanks to Mikulas Patocka for providing a sample file system which
demonstrated this problem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
4dbe79bcf3c693f9ae607506850eda7ea92892ab 28-Nov-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix directory with holes even when i_size is wrong

The old method for detecting directories with holes depended on i_size
being correct, even though the correct value of i_size hadn't been
calculated yet. Hence, a directory inode with holes and an i_size of
0 would require two e2fsck passes to fix completely.

The replacement method for determining whether or not
ext2fs_add_dir_block() should be called is more reliable, and reduces
the size of e2fsck and makes the code more readable as a bonus.

Thanks to Mikulas Patocka for providing a sample file system which
demonstrated this problem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
b71e01835ff844d5be09ecbf7e51acad4d75447b 17-Nov-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix duplicate directory entries for non-indexed directories

Duplicate directory entries were not necessarily getting found and
fixed for non-indexed directories, since we were sorting these
directories by inode number, and the duplicate entry code assumed the
entries were getting sorted by name or directory name hash.

Addresses-Sourceforge-Bug: #2862551

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ehash.c
de43f224d4b6565266f8c2caacfe2a82f03cabb0 05-Nov-2009 Matthias Andree <matthias.andree@gmx.de> Add $(LIBINTL) to tst_problem linked libs.

Fixes build problem on systems where gettext() isn't in libc,
such as FreeBSD.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
akefile.in
b49f78fe6e19fe63b6f989d5e1afb04f59069197 26-Oct-2009 Theodore Ts'o <tytso@mit.edu> Convert ext2fs_group_{first,last}_block() to *block2()

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
uper.c
48f23054bb8ad0506c0baa9f06ba182acc2aa88b 26-Oct-2009 Valerie Aurora Henson <vaurora@redhat.com> Convert ext2fs_block_alloc_stats() calls to block_alloc_stats2()

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1b.c
ass2.c
ass3.c
ehash.c
uper.c
d7cca6b06f366f998ed43346f9b6fca9e163692f 26-Oct-2009 Valerie Aurora Henson <vaurora@redhat.com> Convert to use block group accessor functions

Convert direct accesses to use the following block group accessor
functions: ext2fs_block_bitmap_loc(), ext2fs_inode_bitmap_loc(),
ext2fs_inode_table_loc(), ext2fs_bg_itable_unused(),
ext2fs_block_bitmap_loc_set(), ext2fs_inode_bitmap_loc_set(),
ext2fs_inode_table_loc_set(), ext2fs_bg_free_inodes_count(),
ext2fs_ext2fs_bg_used_dirs_count(), ext2fs_bg_free_inodes_count_set(),
ext2fs_bg_free_blocks_count_set(), ext2fs_bg_used_dirs_count_set()

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ournal.c
ass1.c
ass1b.c
ass2.c
ass5.c
uper.c
cd65a24e756b8f6770a5961fd94c67eb00dd7baa 26-Oct-2009 Theodore Ts'o <tytso@mit.edu> libext2fs: Convert ext2fs_bg_flag_test() to ext2fs_bg_flags_test()

After cleaning up ext2fs_bg_flag_set() and ext2fs_bg_flag_clear(),
we're left with ext2fs_bg_flag_test(). Convert it to
ext2fs_bg_flags_test().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass2.c
ass5.c
uper.c
e633b58ac75f2f544b7d6572e37d4b63da31e59c 26-Oct-2009 Eric Sandeen <sandeen@redhat.com> libext2fs: clean up ext2fs_bg_flags_ interfaces

The ext2fs_bg_flag* functions were confusing.

Currently we have this:

void ext2fs_bg_flags_set(ext2_filsys fs, dgrp_t group, __u16 bg_flags);
void ext2fs_bg_flags_clear(ext2_filsys fs, dgrp_t group,__u16 bg_flags);

(_set (unused) sets exactly bg_flags; _clear clears all and ignores bg_flags)

and these, which can twiddle individual bits in bg_flags:

void ext2fs_bg_flag_set(ext2_filsys fs, dgrp_t group, __u16 bg_flag);
void ext2fs_bg_flag_clear(ext2_filsys fs, dgrp_t group, __u16 bg_flag);

A better interface, after the patch below, is just:

ext2fs_bg_flags_zap(fs, group) /* zeros bg_flags */
ext2fs_bg_flags_set(fs, group, flags) /* adds flags to bg_flags */
ext2fs_bg_flags_clear(fs, group, flags) /* clears flags in bg_flags */

and remove the original ext2fs_bg_flags_set / ext2fs_bg_flags_clear.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass2.c
ass5.c
uper.c
72a729dbf962e8fba58a06ee0a11a01b15e743fc 24-Oct-2009 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
configure
configure.in
ba5131f6d48eded504e84c2a8ffc8131df8a512e 17-Oct-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Accept superblock times to be fudged by up to 24 hours by default

Unfortunately, due to Windows' unfortunate design decision to
configure the hardware clock to tick localtime, instead of the more
proper and less error-prone UTC time, many users end up in the
situation where the system clock is incorrectly set at the time when
e2fsck is run.

Historically this was usually due to some distributions having buggy
init scripts and/or installers that didn't correctly detect this case
and take appropriate countermeasures. However, it's still possible,
despite the best efforts of init script and installer authors to not
be able to detect this misconfiguration, usually due to a buggy or
misconfigured virtualization manager or the installer not having
access to a network time server during the installation process. So
by default, we allow the superblock times to be fudged by up to 24
hours. This can be disabled by setting options.accept_time_fudge to
the boolean value of false in e2fsck.conf. The old
options.buggy_init_scripts is left for backwards compatibility.

Since we are now accepting the 24 hour time fudge by default, there is
no longer a need to install an Ubuntu-specific e2fsck.conf file, so we
can remove it.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.conf.5.in
2fsck.conf.ubuntu
roblem.c
uper.c
8a8f36540bbf5d4397cf476e216e9a720b5c1d8e 13-Oct-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix handling of non-zero i_blocks_high field

E2fsck was not properly printing the i_blocks field in filesystem
corruption messages, and it was not properly checking i_blocks_hi and
i_blocks_lo, either. This commit fixes this.

Thanks to Felipe Conteras for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
essage.c
ass1.c
95bcea9fc149e349865f9eb30988ad1b4e1c1342 05-Oct-2009 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
configure
configure.in
misc/mke2fs.c
695706ca214d9d04666ee46a48f63f6127154a23 05-Oct-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Interpret negative blkcount in file system problem reports

Non-expert users get confused when they see messages like this:

Illegal block #-1 (2291965952) in inode 176. CLEARED.

So change it to be something a little bit more understandable:

Illegal indirect block (2291965952) in inode 176. CLEARED.

Addresses-SourceForge-Bug: #2871782

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
essage.c
roblem.c
e1f085079525c0ed4c5ab1f2abedaf9407a7b8da 04-Oct-2009 Theodore Ts'o <tytso@mit.edu> Don't use in-tree header files if using system uuid or blkid libraries

This commit forces the use of the system-provided blkid or uuid header
files if we are using the system-provided blkid or uuid libraries.
This avoids using the in-tree header files with the system libraries.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
61a9d2b33e5c7afa4f03d6cc0ed4d81b2caf7023 04-Oct-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Use the correct problem code in the case of LAST_WRITE_FUDGED

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uper.c
4efbac6fed75c29d3d5f1b676b932754653a2ac5 08-Sep-2009 Valerie Aurora Henson <vaurora@redhat.com> Convert uses of super->s_*_blocks_count to ext2fs_*_blocks_count()

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
adblocks.c
ournal.c
ass1.c
ass2.c
ass5.c
uper.c
nix.c
a63745e81cbb476b90c75ca3ca60b9ba4be95cae 08-Sep-2009 Valerie Aurora Henson <vaurora@redhat.com> Use ext2fs_file_acl_block() instead of using .i_file_acl directly

This provides support for 48-bit file acl blocks.

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
essage.c
ass1.c
ass1b.c
ass2.c
uper.c
c5b7b6babe658a2037af6c9d2b7a3c23208f98f1 08-Sep-2009 Valerie Aurora Henson <vaurora@redhat.com> Fix overflow in calculation of total file system blocks

Blocks per group and group desc count are both 32-bit; multiplied they
produce a 32-bit quantity which overflowed.

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
82b59ca1ed0c2d6311f2e4b6e315d7ef82b62833 02-Sep-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Avoid scary failure messages on low-memory systems

On a very low-memory system, where ext2fs_check_desc() fails because
it can't allocate a block bitmap, catch this error and report it
immediate. This avoids something like this, which could scare and
mislead the user:

e2fsck: Group descriptors look bad... trying backup blocks...
Media was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Error allocating block bitmap (1): Memory allocation failed
e2fsck: aborted

Addresses-Debian-Bug: #509529

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
732c8cd58ff30ffae0d3276c411a08920717a46c 08-Sep-2009 Theodore Ts'o <tytso@mit.edu> Use accessor functions fields for bg_flags in the block group descriptors

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass2.c
ass5.c
uper.c
24a117abd0340d247befbf7687ffb70547fdf218 08-Sep-2009 Valerie Aurora Henson <vaurora@redhat.com> Convert to use io_channel_read_blk64() and io_channel_write_blk64()

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
handler.c
ournal.c
ass1.c
ass1b.c
ass3.c
uper.c
til.c
dc615a21c3c43cd9071926df2633d5b23e2e726b 07-Sep-2009 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next
c5d2f50dee996e48e96066155f85d7c925fcba0d 23-Aug-2009 Valerie Aurora Henson <vaurora@redhat.com> e2fsck: Convert e2fsck to new bitmap interface

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
mptydir.c
ournal.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
ehash.c
uper.c
nix.c
60139154878ebdafd4b372cdcf179c5a957c519d 19-Aug-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Add a global latch question for bad group descriptor checksums

Very often all the block group descriptors will have bad checksums, so
don't force the user answer 'yes' many, many times.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
roblem.h
9a7fe4bdc9725bbf84af0c174c9102e8ac05983c 19-Aug-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Only ask to relocate a block group's inode table once

If multiple blocks of a block group's inode table overlaps with other
file system blocks, only ask once for each block group.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
617446e4aad5acdc82bad8bb36d896f9ad480cf8 19-Aug-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Teach new_table_block() to allocate new itables/bitmaps with FLEX_BG

If the filesystem feature FLEX_BG is enabled, the inode table and
bitmap blocks can be located anywhere in the inode table. So for
FLEX_BG filesystems, new_table_block() now tries allocate in the block
group's flex_bg first, and if there is no space in the local flex_bg,
then try to allocate from the whole filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
fe26a55ac923f4cce17c27ef51de84d2e3b6eebb 08-Aug-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix and enhance superblock dates in future problem reports

Fixed a bug where e2fsck would report that last mount time was in the
future when it was really the last write time that was in the future.

Also, since people can't seem to believe that (a) their distribution
has buggy init scripts, or (b) their CMOS/RTC clock or backup battery
is dead, print the incorrect time and the current system time.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
essage.c
roblem.c
uper.c
bee24f364ca921e10cefa0d3241b61383aa62866 05-Aug-2009 Valerie Aurora Henson <vaurora@redhat.com> e2fsck: Allow cancellation during group descriptor checks.

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uper.c
1d72214658d339bd4725fe74aa42397df419e914 22-Aug-2009 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next
26ea4899d1fea0fbc5d28120944d2c2758ac1b11 17-Jul-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix superblock times in the future even if buggy_init_scripts=1

Unfortunately, distributions like Ubuntu seem to have buggy init
scripts that run e2fsck and mount the root filesystem before making
sure the system time and time zone is correctly set. As a result, a
filesystem's last write and last mounted time can be set in future.
The buggy_init_scripts configuration option will stop e2fsck from
aborting the boot process, but it also inhibits the superblock times
from getting fixed. This causes resize2fs to refuse to resize the
filesystem, even after running e2fsck on the file system. To deal
with this, we need to fix the superblock write times unconditionally.

Addresses-Launchpad-bug: #373409

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
roblem.h
uper.c
e31b32721df24a0794de4f8925112e21dc4699b4 06-Jul-2009 Kazuya Mio <k-mio@sx.jp.nec.com> e2fsck: remove unused variable in check_block_bitmap()

check_block_bitmap() calculates the block number of superblock in the current
block group but it's not used.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass5.c
01ec1268a57b3cc0689ee17035613bebfaea9f87 06-Jul-2009 Kazuya Mio <k-mio@sx.jp.nec.com> e2fsck: optimize loop counter when fixing bitmap padding

If unused range of the bitmap has an unmarked bit, check_[inode/block]_end()
marks all bits in the range. However, we know that the checked bits are marked.
So this patch fixes loop counter to mark from the unmarked bit.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass5.c
f27aea2fbaf03e5d63a8e3000e616ea3cd4774f8 06-Jul-2009 Kazuya Mio <k-mio@sx.jp.nec.com> e2fsck: remove unnecessary continue statement

Remove the continue statement because it calls at the end of the loop.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass2.c
c13351f6c53f175696044c0203bb3009af606c64 02-Jul-2009 Theodore Ts'o <tytso@mit.edu> Add support for configure --enable-verbose-makecmds

Some people don't want to see the concise "kernel-style" make output.
This configure option allows build engines that want to see the full
set of commands executed by the makefile to get what they want. Most
people will find this more distracting than useful, unless they need
to debug the Makefiles.

(It is not necessary to rerun configure to enable this verbose make
output temprarily; if a developer wants to do a quick debug of a
directory's makefile, he or she can simply edit the definition of the
$(E) and $(Q) variables in the Makefile; instructions can be found in
the MCONFIG file which is included in at the beginning of every
Makefile.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
a6a1c0815c045fd12f65546e16d495338097f32a 02-Jul-2009 Theodore Ts'o <tytso@mit.edu> Fix Makefile dependencies for libcom_err

The e2fsprogs makefiles were using the same Makefile variable
LIBCOM_ERR for the link-line arguments as well as the dependencies.
Since LIBCOM_ERR can now include non-file arguments such as
"-lpthread", we need to use a separate DEPLIBCOM_ERR variable that
only has build file dependencies.

Do the same thing for STATIC_LIBCOM_ERR and PROFILED_LIBCOM_ERR.

Addresses-Sourceforge-Patches: #2813809

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
8a480350952f6f0fdbce54326b6d847e66368897 22-Jun-2009 Theodore Ts'o <tytso@mit.edu> Fix encoding for rec_len in directories for >= 64k blocksize file systems

Previously e2fsprogs interpreted 0 for a rec_len of 65536 (which could
occur if the directory block is completely empty in 64k blocksize
filesystems), while the kernel interpreted 65535 to mean 65536. The
kernel will accept both to mean 65536, and encodes 65535 to be 65536.
This commit changes e2fsprogs to match.

We add the encoding agreed upon for 128k and 256k filesystems, but we
don't enable support for these larger block sizes, since they haven't
been fully tested.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
essage.c
ass1.c
ass2.c
ehash.c
23f75f6efaac6b756e0f3e4e1d33b6798347f66a 15-Jun-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: fix miscellaneous memory leaks

Fix various miscellaneous memory leaks which were discovered using valgrind.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
irinfo.c
x_dirinfo.c
ass1b.c
ass2.c
nix.c
5635e75c918866849746cf50d1a9a301c241fed4 21-Jul-2009 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next
20f2ccb3262b11d3a7b892cb9a11ea1c8c2ddd3b 12-Jul-2009 Jose R. Santos <jrs@us.ibm.com> Use new ext2fs_super_and_bgd_loc2 call in libext2fs

The new ext2fs_super_and_bgd_loc2() function has some changes aside
from just blk64_t support. Lets make sure that the interfaces are
sane by adding libext2fs support early to get the new API tested here.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
479463aaf641d9b2c46bd4cda4e5e941fd767c73 09-Jul-2009 Kazuya Mio <k-mio@sx.jp.nec.com> e2fsck: Speed up pass 5 processing for ext4 filesystems

e2fsck_pass5() checks whether the inode and block allocation bitmaps
are consistent. However, if EXT2_BG_[INODE/BLOCK]_BITMAP is set to a
ext4's block group, most of its bitmap is uninitialized (0). In that
case, we can optimize e2fsck's pass 5 by checking the entire range of
an uninitalized block group instead of checking bit by bit.

This can speed up e2fsck pass 5 by up to 80%:

+-----+--------------------+--------------------+
| | old e2fsck | new e2fsck |
|Pass | time(s) | time(s) |
| | real | user |system| real | user |system|
+-----+------+------+------+------+------+------+
| 1 | 5.70| 3.29| 0.50| 5.66| 3.21| 0.54|
| 2 | 3.33| 0.80| 0.19| 3.40| 0.82| 0.23|
| 3 | 0.01| 0.00| 0.00| 0.01| 0.00| 0.00|
| 4 | 1.04| 1.04| 0.00| 1.05| 1.04| 0.00|
| 5 | 19.60| 17.27| 0.06| 3.53| 1.21| 0.05|
+-----+------+------+------+------+------+------+
|Total| 29.94| 22.57| 0.80| 13.90| 6.47| 0.86|
+-----+------+------+------+------+------+------+

Comparison of e2fsck time on an ext4 500GB partition (20% blocks used)

Machine environment:
CPU: Intel(R) Xeon(TM) CPU 3.00GHz
Memory: 1GB
Kernel: linux-2.6.29-git2

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
4f858546e1c3c452f400a34198b10cb7a1ed2760 30-May-2009 Theodore Ts'o <tytso@mit.edu> Update man pages to include ext4 in the synposis, instead of just "ext2/ext3"

The e2fsprogs programs have historically just said that they operate
on ext2 and ext3 file system in their man pages. Update them to say
that they also operate on ext4 file systems.

Addresses-Launchpad-bug: #381854

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.8.in
606638906a0229323d1b2871fdb0d45ea0e7ff62 29-May-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Go back to the original superblock if the backup sb is invalid

In the case where the block group descriptors appear corrupt, e2fsck
will try to use the backup superblock. However, it could be that the
backup superblock itself is completely corrupted, in which e2fsck
should go back to the original superblock instead of refusing to fix
the file system.

Addresses-Debian-Bug: #516820

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
b6bb99feb9f7fc32835feeddc5648a10e29f070e 28-May-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: if i_file_acl_hi is non-zero, fix it and don't abort e2fsck -p

Ext3 filesystems don't care if i_file_acl_hi is non-zero in some
inode, and newer kernels should ignore this field (although 2.6.29 and
older kernels will not). So e2fsck should fix this without aborting
an e2fsck preen operation.

Addresses-Debian-Bug: #526524

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
84b239aea4da04c7a569b428d3abf6c720e82645 19-May-2009 number9652 <number9652@yahoo.com> libext2fs: add ext2fs_extent_open2

The patch below adds a function, ext2fs_extent_open2(), that behaves
as ext2fs_extent_open(), but will use the user-supplied inode
structure when opening an extent instead of reading the inode from
disk. It also changes several of the calls to extent_open() to use
this enhancement.

Signed-off-by: Nic Case <number9652@yahoo.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
9facd076ae8af6e908e228392cea866ce0faf1bc 28-May-2009 Ken Chen <kenchen@google.com> Add empty function for init_resource_track() and print_resource_track()
in the case of ! defined RESOURCE_TRACK, so that we can clean up #ifdef
throughout e2fsck source.

Signed-off-by: Ken Chen <kenchen@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
ehash.c
nix.c
til.c
fea390e2534907dad42159437e01bd9a4ead2c55 05-May-2009 Ken Chen <kenchen@google.com> e2fsck: add resource tracking for passes 1[b-d]

On ext2, time tracking for pass1 includes both error detection and
specific type of fs fix-up phase (e.g. block referenced by multiple
inodes). The multi-reference fix-up phase some time take significant
amount of time to complete. We would like to track time spent in sub
component of pass1 by having a finer granularity during pass1b through
pass1d phase.

Signed-off-by: Ken Chen <kenchen@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass1b.c
70eabde9a581d340837c98b11d3ced324155d1ae 28-May-2009 Andreas Dilger <adilger@sun.com> e2fsck: use unsigned values for memory tracking stats

Use unsigned values for printing memory tracking to avoid overflows.
The mallinfo() data is currently signed ints, but it might change in
the future so we may as well compute/print unsigned longs.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
til.c
6267ee49be64035d8a9772c3bafed18a09874fa5 28-May-2009 Andreas Dilger <adilger@sun.com> e2fsck: only restart e2fsck once for inodes in uninit range

Restart e2fsck only once in case of multiple inodes in uninit range.
Display correct inode number during BG_INO_UNINIT and INOREF_IN_USED errors.

Signed-off-by: Kalpak Shah <kalpak.shah@sun.com>
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2fsck.h
ass2.c
27a407df546eafa54f3f50c470e3a0a4c788fae5 26-May-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix journal replay bug which reverts changes to the bg descriptors

Fix a regression in e2fsprogs 1.41.5 which would undo updates to the
block group descriptors after a journal replay, caused by commit
b7c5b403. We now use ext2fs_free() instead of ext2fs_close() to make
sure we the library will never try to write out superblock or block
group descriptors.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ournal.c
14c5af32f2fea57f558766ae9b32ce1d3675021b 18-May-2009 Andreas Dilger <adilger@sun.com> e2fsck: initialize error handling before journal replay

One of our customers hit a temporary IO error during an e2fsck run during
the read from the journal. It seems that the read error resulted in
e2fsck automatically discarding the journals and recreating them on several
filesystems on this node without any prompting from the user:

end_request: I/O error, dev sdg, sector 484832
Buffer I/O error on device sdg, logical block 60604
fsck-sdg[8276]: ls2-OST024c: Superblock has an invalid ext3 journal (inode 8).
fsck-sdg[8276]: CLEARED.
fsck-sdg[8276]: *** ext3 journal has been deleted - filesystem is now ext2
only ***
fsck-sdg[8276]: ls2-OST024c was not cleanly unmounted, check forced.
fsck-sdg[8276]: ls2-OST024c: Journal inode is not in use, but contains data.
CLEARED.
fsck-sdg[8276]: ls2-OST024c: Recreate journal to make the filesystem ext3
again?
fsck-sdg[8276]: FIXED.
fsck-sdg[8276]: Creating journal (32768 blocks): Done.
fsck-sdg[8276]:
fsck-sdg[8276]: *** journal has been re-created - filesystem is now ext3 again
***
fsck-sdg[8276]: ls2-OST024c: 39818/20183248 files (8.2% non-contiguous), 222122257/779902976 blocks
fsck-sdg[8276]: exit code 1 (file system errors corrected)

The following patch moves the e2fsck error handler initialization earlier
in the e2fsck startup code before the journal is processed, so that the
user will be prompted for an action. This is the first IO that is not
part of ext2fs_open() where fs->io is first initialized.

It doesn't seem possible to initialize the error handlers for the initial
filesystem open without changing the prototype for ext2fs_open2(). If we
are getting a new ext2fs_open3() prototype for 64-bit it might make sense
to add at least "read_error" as a parameter ("write_error" is not strictly
necessary for the open and could be set afterward).

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
0a68b181c1c1d59a284c9cb524b301d183825099 17-May-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Don't crash if an inode with a bad extent header is not cleared

If ext2fs_extent_open() fails due to a corrupt extent header, and the
user declines to clear the inode, check_blocks_extents() should bail
out; otherwise, it will cause a core dump due a null pointer
dereference.

Addresses-Sourceforge-Bug: #2791794

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
ae33f578c01b7171e556a75158baf7b713bfe68f 28-Apr-2009 Andreas Dilger <adilger@sun.com> e2fsck: cleanup whitespace in problem.c and problem.h

Cleanup whitespace in the problem.h and problem.c files. Removes a
bunch of places where tabs follow spaces, whitespace on empty lines, etc.
I didn't reformat the indenting of the entire problem.h error codes,
but there is some room for doing this...

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
roblem.c
roblem.h
7494cbfd59eb61301e168dd8aa4b19c2f4b73532 28-Apr-2009 Andreas Dilger <adilger@sun.com> e2fsck: Add test code in problem.c to verify problem codes

We've hit a number of cases where the error codes in problem.h have
been assigned duplicate values compared to problems in our own e2fsck
patches, and this can lead to confusing and difficult to find bugs
in e2fsck (e.g. wrong problem messages, incorrect repair action, etc).

Attached is a test case for the problem.c file to ensure that the
problem table is sorted and does not contain any duplicate values.
Having the problem table sorted allows the correctness checking to be
very simple, and if it ever became important for performance we could
use binary searching of the problem table for the specific problem code.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
akefile.in
roblem.c
roblem.h
47c1b8e16668daa6e74cee3c7b8bdf237ffefe70 28-Apr-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Skip journal checks if the fs is mounted and doesn't need recovery

If we are checking a mounted filesystem (typically the root
filesystem, mounted read/only) and the NEEDS_RECOVERY flag is not set,
skip all of the checks associated with making sure the journal is
consistent. There is the very slight possibility we could lose if the
NEEDS_RECOVERY flag was somehow cleared even though there was data in
the journal, but this has practically never happend in practice, and
it reduces the number of reads required at boot-time, which is a big
deal when trying to reduce boot times with HDD's.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
911ec6261568ca56d2d7b9a15f00578c4d127cf4 24-Apr-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: On a 32-bit filesystem, make sure i_file_acl_high is zero

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
ass2.c
roblem.c
roblem.h
982dd30ce87d5fdfb9a6de5732633f31b3840090 23-Apr-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Reduce unnecessary I/O when checking backup superblock

E2fsck needs to check to see if the backup superblock differs from the
primary superblock. Previously it was doing so by calling
ext2fs_open(), which does a lot of unnecessary work, including reading
all of the backup block group descriptors. Avoid this by reading in
the backup superblock directly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uper.c
69d0edfd01ef81efd9f880231999975582ea8b60 23-Apr-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Don't test the resize_inode if the filesystem is clean

Move check_resize_inode() out of check_super_block(), since we only
need to test the resize_inode for correctness only if the filesystem
requires checking. This change avoids a lot of I/O operations which
slows down a 1 second boot.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
uper.c
nix.c
b0258cbcd89862b927707258c67f2eeac769adc2 22-Apr-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix warn_unused_result warnings from gcc

Fixed a potential bug where by partial returns from the write(2)
system call could lost characters to be sent to external progress bar
display program.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
nix.c
til.c
611378fe20777da83fcc8fe77ff2c515b7dc1e42 28-Oct-2008 Andreas Dilger <adilger@sun.com> e2fsck: print unsigned RAM usage statistics

Running e2fsck against a 14.5TB filesystem with -tt it reported
-200904kB for RAM usage in pass3 instead of the correct 2300773kB.
The RAM usage statistics were being printed with %d instead of %u.

Also fix a few places using %ld for inode numbers instead of %lu.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
til.c
d9ff474b742f700e049f336f055918060f21a543 22-Nov-2008 Eric Sandeen <sandeen@redhat.com> e2fsck: ignore differing NEEDS_RECOVERY flag on backup sbs

When we resize online, the primary superblock gets copied to all
the backups, and of course since we're mounted the NEEDS_RECOVERY
flag is set. A subsequent fsck will find the backups have the
NEEDS_RECOVERY flag set while the primary does not, and this
forces a full fsck pass.

I think this flag can be safely ignored in the flag comparisons.

Addresses-Red-Hat-Bugzilla: #471925

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uper.c
45e338f5332a54295893dba2e32cc093d1316f60 23-Feb-2009 Jim Meyering <jim@meyering.net> remove useless if-before-free tests

In case you're wondering about whether this change is safe from a
portability standpoint, fear not. This has been beaten to death
in other forums. Here are a few threads:

http://thread.gmane.org/gmane.comp.version-control.git/74187
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/12712
http://thread.gmane.org/gmane.emacs.devel/98144
http://thread.gmane.org/gmane.comp.lib.glibc.alpha/13092

There has been debate about whether it's a good idea from a
performance standpoint, too, but imho you'll have a hard time
finding an instance where this sort of change induces a
measurable performance penalty. If you do, please let me know.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
rgv_parse.c
irinfo.c
rofile.c
ehash.c
f2fe5da31deebc689bb64e71c8e873efc925d312 24-Feb-2009 Eric Sandeen <sandeen@redhat.com> e2fsprogs: fix potential null ptr defef in check_for_modules()

The coverity scanner found this one.

If a line in modules.dep has a ":" but no "/" then:

if ((cp = strchr(buf, ':')) != NULL)
*cp = 0;
else
continue;
if ((cp = strrchr(buf, '/')) != NULL)
cp++;
/* XXX else cp is still null */
i = strlen(cp);

... we will deref a null pointer (cp). This can be
demonstrated by putting a line like:

foo.ko:

into modules.dep. The below change just says that if no "/" is
found, treat the whole string as the module name.

Addresses-Red-Hat-Bugzilla: #486997

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
til.c
cf9fbcccbc16d881f97f2f98e46b693e2364922d 26-Jan-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Add missing newlines when reporting errors in pass 3A

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
206d2ade6e3682ac5b196aaa7a9c54b6874e5060 22-Jan-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Change PR_3_CREATE_LPF_ERROR to be a non-fatal problem

The other problem codes associated with failing to create the
lost+found directory are non-fatal, and this one should be non-fatal
as well. The two places which call e2fsck_get_lost_and_found()
already deal with a failure to create the directory, so there's no
point making this be a fatal error.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
1f790a7cc1fbb0dc2d2f621d2508f52a62f80150 22-Jan-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Add superblock check to make sure s_first_ino is valid

An deliberately corrupted filesystem with an insanely large
s_first_ino field could cause e2fsck to crash with a seg fault.

Thanks to Eric Sesterhenn for supplying test cases which demonstrated
this issue.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uper.c
e35d548b59e24af9f7fc18396e8880df96d1bc51 03-Jan-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix journal replay for block sizes greater than 8k

E2fsck was using a fixed-size 8k buffer for replaying blocks from the
journal. So attempts to replay a journal on filesystems greater than
8k would cause e2fsck to crash with a segfault.

Thanks to Miao Xie <miaox@cn.fujitsu.com> for reporting this problem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs_user.h
ournal.c
dd04d05f702be151d6a7312da2b64147d2751de1 02-Jan-2009 Theodore Ts'o <tytso@mit.edu> e2fsck: Remove "ext3" from problem descriptions of the journal

The ext4 filesystem uses journals too, so remove "ext3" from the
problem descriptions involving journals.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
7518c176867099eb529502103106501861a71280 26-Dec-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix an unhandled corruption case in scan_extent_node()

A corrupted interior node in an extent tree would cause e2fsck to
crash with the error message:

Error1: Corrupt extent header on inode 107192
Aborted (core dumped)

Handle this and related failures when scanning an inode's extent tree
more robustly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
roblem.c
roblem.h
7dca4c88f166561031011ed27287818eaa343486 24-Dec-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: When repacking directories, leave slack space for more efficiency

If the directory is packed with no slack space, as soon as any new
directory entries are added, leaf nodes end up getting split and
directory ends up getting very inefficient.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.c
2fsck.conf.5.in
2fsck.h
ehash.c
d5a74ff10be2afe155f8b7c1397c75f4275ebeba 09-Dec-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix double-counting of non-contiguous extent-based inodes

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
100d4701d5338807a99565aa528970da644e0953 09-Dec-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Enhance fragcheck report with file/directory information

Report whether a fragmented inode is a directory or a file, as this is
highly useful for determining what is going on with an ext4 filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
ce44d8cafa36e5c57f056be5b340d51c8ab819c6 09-Dec-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: In verbose mode, distinguish between fragmented directories/files

Track the number of non-contiguous files and directories so we can
give more detailed information in verbose mode.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.c
2fsck.h
ass1.c
nix.c
42e89ce7f8823ad14099b03469c2f4e4f6530d05 27-Nov-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Don't cancel the fsck run after clearing an errant INODE_UNINIT flag

Thanks to Kelly Kane from Dreamhost for reporting this bug and then
helping us find and fix it.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass2.c
03fa6f8ae28a87018325c892f731097cc97d9eac 16-Nov-2008 Theodore Ts'o <tytso@mit.edu> Fix various signed/unsigned gcc warnings

Some of these could affect filesystems between 2^31 and 2^32-1 blocks.

Thanks to Valerie Aurora Henson for pointing out the problems in
lib/ext2fs/alloc_tables.c, which led me to do a "make gcc-wall" scan
over the source tree.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
ass2.c
992a2f7f68f879121c28ebc50c3e9a1615db2bfa 15-Nov-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix build of e2fsck.profiled if profiling is enabled

It's been a while since I've done a build using "configure
--enable-profile", and some bitrot had set into the Makefiles...

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
80875db58a6db58e3e2f01caf1adabca068d3ffb 13-Oct-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Offer to clear the test_fs flag if ext4 is available

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.conf.5.in
2fsck.h
roblem.c
roblem.h
uper.c
til.c
4758835c280082e38f0b96816ea4f60351a49053 11-Oct-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Print the correct inode number for uninit-bg related problem reports

Fix the reporting for problem codes PR_2_INOREF_BG_INO_UNINIT and
PR_2_INOREF_IN_UNUSED.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
79cc33628256e817610e921ddf600f72e4f879e1 11-Oct-2008 Eric Sandeen <sandeen@redhat.com> e2fsck: exit from preenhalt if IO errors were encountered

If a block device is read-only, e2fsck -p gets into an infinite loop
trying to preenhalt, closing and flushing the fs, which tries to flush
the cache, which gets a write error and calls preenhalt which tries to
close and flush the fs ... ad infinitum.

Per Ted's suggestion just flag the ctx as "exiting" and short-circuit
the infinite loop.

Tested by running e2fsck -p on a block device set read-only by BLKROSET.

Thanks to Vlado Potisk for reporting this.

Addresses-Red-Hat-Bugzilla: #465679

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2fsck.h
handler.c
til.c
0f589a4d5701b0cc95d90685f8cbbdc66a7be3a6 02-Oct-2008 Theodore Ts'o <tytso@mit.edu> Fix spelling mistake in e2fsck man page

Addresses-Launchpad-Bug: #275272

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.8.in
0eeec8ac61bf1eaa31533b2be825cd75580829c9 12-Sep-2008 Theodore Ts'o <tytso@mit.edu> Fix compiling under diet libc

Some recent changes had caused diet libc support to bitrot. Fix up
missing header files and other portability fixups needed for dietlibc.
(Many of these changes also improve general portability.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
rc32.c
a_refcount.c
essage.c
ass1.c
egion.c
52771ab59145d66b50399a8b953b8181cb2d5b04 09-Sep-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix e2fsck automatic blocksize detetion

This fixes a regression that was introduced in commit dcc91e10 (it
showed up first in e2fsprogs 1.40.7). Since we weren't freeing the
filesystem handle, ext2fs_open2() was returning EBUSY, and so this
caused a failure in the code that would automatically determine the
filesystem block size when only the superblock number was specified by
the user.

This was discussed in http://ubuntuforums.org/showthread.php?t=789323,
and Matthias Bannach pointed this out to me, for which I am very
grateful.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
4efd17cccb38bf4ab6110e7756fdf24d8774e4bd 07-Sep-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Don't print the PO header when printing problems with PROMPT_NULL

A few e2fsck problem messages supply their own prompt, and set a
prompt value of PROMPT_NULL. We have to check for this case, and not
pass the null string to _(), since that will result in the translation
header getting printed, like this:

Run journal anywayProject-Id-Version: e2fsprogs
Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>
POT-Creation-Date: 2008-02-28 21:45-0500
PO-Revision-Date: 2006-05-23 11:12+0000
Last-Translator: Somebody32 <som32@mail.ru>
Language-Team: Russian <ru@li.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 &&
n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
X-Launchpad-Export-Date: 2008-05-28 00:43+0000
X-Generator: Launchpad (build Unknown)
<y>? yes

Addresses-Launchpad-Bug: #246892

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
55da987650b36a1b910a5968f7d83a190827f8bb 03-Sep-2008 Theodore Ts'o <tytso@mit.edu> Improve ELF shared library handling

Pass in -rpath-link option to the linker so that blkid will build
correctly on systems that don't have libcom_err.so.2 installed.

Fix debugfs to only try to link with -ldl when building without shared
libraries; with ELF shared libraries, the library which requires -ldl
(libss.so) can required the library dependency itself.

Fix how we build tune2fs.static so that we use @LDFLAG_STATIC@, via
$(LDFLAGS_STATIC), instead of hard-coding the use of -static.

Addresses-Sourceforge-Bug: #2088537

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
f38cf3cb34addaa53d1f855d7607b151082a4229 01-Sep-2008 Theodore Ts'o <tytso@mit.edu> Only use the test_io manager if the right environment variables are set

In order to make it possible for the test_io manager to be compiled in
by default, make all of the programs that might try to use it to only
do so if the environment variables TEST_IO_FLAGS and TEST_IO_DEBUG are
set.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
efc6f628e15de95bcd13e4f0ee223cb42115d520 28-Aug-2008 Theodore Ts'o <tytso@mit.edu> Remove trailing whitespace for the entire source tree

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
rgv_parse.c
rgv_parse.h
adblocks.c
ict.c
x_dirinfo.c
2fsck.c
2fsck.h
a_refcount.c
handler.c
mptydir.c
xtend.c
lushb.c
scan.c
fs_user.h
ournal.c
essage.c
trace.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
roblemP.h
rofile.c
rofile.h
rofile_helpers.c
egion.c
ehash.c
evoke.c
cantest.c
uper.c
nix.c
til.c
5dd77dbe5a0ac6d78c1c6441fae4087be56d9088 26-Aug-2008 Theodore Ts'o <tytso@mit.edu> Add support for with empty directory blocks in 64k blocksize filesystems

The rec_len field in the directory entry is 16 bits, so if the
filesystem is completely empty, rec_len of 0 is used to designate
65536, for the case where the directory entry takes the entire 64k
block.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
ass2.c
roblem.c
ehash.c
e5e12db959d3c18f6cf4ac938a14f68be0a89acc 24-Aug-2008 Andreas Dilger <adilger@sun.com> fix e2fsck error message for bad htree depth

Fix error message to print the depth of a corrupt htree directory.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Kalpak Shah <kalpak.shah@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass2.c
roblem.c
ba7b0feef658456c514b51ded5bb1d9a3909d967 25-Aug-2008 Andreas Dilger <adilger@sun.com> e2fsck: Change comments in problem array to match what is printed

This makes it easier to locate the problem code in question.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
864b8d4eab6a8b38fa9f89ac1475ad364f5a40b8 25-Aug-2008 Andreas Dilger <adilger@sun.com> Fix miscellaneous compile warnings

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
1bb6f6c87e860f8c021f966fc36aa8768590a227 24-Aug-2008 Andreas Dilger <adilger@sun.com> e2fsck_write_bitmaps() optimization

This patch changes the e2fsck_write_bitmaps() function to write out the
block and inode bitmaps together, instead of writing them in two passes.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
til.c
094c2d43939533113ededfd6fe49ad1c7726df29 23-Aug-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Portability fix: Use WORDS_BIGENDIAN instead of __LITTLE_ENDIAN

__LITTLE_ENDIAN is set by the glibc headers, and isn't portable. We
should be using WORDS_BIGENDIAN, which is set by autoconf.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
rc32.c
0ea910997b3c2ba09b65b852b9bb4dd7b4d68999 18-Aug-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: fix spurious complaints about i_size caused by preallocated blocks

For inodes with blocks preallocated with FALLOC_FL_KEEP_SIZE, e2fsck
complained about i_size being too small. Fix this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
3ec7be439ab8fafb7b82632948e0adb067dde6ab 17-Aug-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix max size calculation for extent files

A misunderstanding C's precedence rules and the meaning of
s_log_block_size meant that we were capping the maximum size of
extent-based files at 8GB instead of the 64TB that it should be for
filesystems with 4k block sizes.

Addresses-Kernel-Bugzilla: #11341

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
8da6d1a18a29d505b97231f98470c8f24a538d4e 14-Aug-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix ind/dind/tind statistics and add extent depth statistics

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.c
2fsck.h
ass1.c
nix.c
f4e2c991efb1e31990a2515b59a7c3c20711fbe6 13-Aug-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix signed/unsigned error in fragcheck report for indirect blocks

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
63b5e354d926413d365eeff8a6d5347b3fb212d0 11-Aug-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix check to see if an extent-based file is fragmented

Also added support for "e2fsck -E fragcheck" which issues a
comprehensive report of discontiguous file extents.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.8.in
2fsck.h
ass1.c
nix.c
3467f2db22fb5893ddca11da2a81b1fafa5505c4 19-Jul-2008 Theodore Ts'o <tytso@mit.edu> Fix cross compilation issues in e2fsck/gen_crc32table

The Makefile should use BUILD_CFLAGS instead of ALL_CFLAGS since it
will be built for the host, not the target.

Addresses-Sourceforge-Bug: #2019287

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
ceebf84fbd5514a4b8abebc7d0e749bb3e8f5c19 13-Jul-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Set LD_LIBRARY_PATH before running "make check" programs

This is needed so that "make check" works in the e2fsck library even
if the shared libraries are not yet installed, and so that we run
those programs against the version of the libraries built in the build
tree.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
ebabf2ad6d19af5c674b624bafe619dedbc94403 13-Jul-2008 Theodore Ts'o <tytso@mit.edu> Define _XOPEN_SOURCE to 600 consistently for Solaris C99 support

Solaris's header files are very picky about which C compiler can be
used for SUSv3 conformance. Use of C99 is not compatible with SUSv2
(_XOPEN_SOURCE=500), and C89 is not compatible with SUSv3
(_XOPEN_SOURCE=600). Since we need some SUSv3 functions, consistently
use SUSv3 so that e2fsprogs will build on Solaris using c99.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
387df00577fa94f49da58bc74de4f9c4afd2cb41 13-Jul-2008 Theodore Ts'o <tytso@mit.edu> Only use __builtin_expect if __GNUC__ > 3

Gcc only supports __builtin_expect for gcc versions 2.96 and up.
Since it's tricky to check for gcc 2.95 vs 2.96 (and either are only
used on really ancient systems anyway), we only use this optimization
on 3.x and newer versions of gcc.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
rc32defs.h
1911bf113ef0f9c71090f26279e4a4082fae0abc 13-Jul-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Change kmem_cache_t to lkmem_cache_t for Solaris

Solaris polutes the C namespace with kmem_cache_t when
you include in/netinet.h is included, so rename kmem_cache_t
to lkmem_cache_t.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs_user.h
evoke.c
7c1e090ce129e093c88403087ed03509d6d07d6a 07-Jul-2008 Eric Sandeen <sandeen@redhat.com> e2fsck: Fix i_size checking for large extent-based files

This:

Truncating bigfile to 14680064000000
Pass 1: Checking inodes, blocks, and sizes
Inode 49154, i_size is 14680064000000, should be 0. Fix<y>?

is a bit unexpected. It's because the size is being checked against
the max sizes for bitmap files, not extent-based files.

Nick saw this with his 14TB file.

Patch below applies different size limits to the different file
formats.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
6f2ca692ecb993c23aabfcf3bb44376a03394cc0 19-Jun-2008 Theodore Ts'o <tytso@mit.edu> Fix "make check" in e2fsck subdirectory to use the in-tree com_err library

Thanks to Jose Santos for pointing this out

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
9329866d3d92578495f8f05ef559bb2c9a15d7cb 18-Jun-2008 Theodore Ts'o <tytso@mit.edu> Add a reference to e2fsck.conf(5) to the e2fsck man page

Addresses-Debian-Bug: #393313

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.8.in
68eb092dda44ea24d490085f6941e50eebfd674f 07-Jun-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Add better explanatory message when s_lastcheck is in the future

Addresses-Debian-Bug: #446005

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.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>
en_crc32table.c
fs_user.h
ass1.c
ecovery.c
nix.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>
fs_user.h
ournal.c
roblem.c
roblem.h
ecovery.c
51d12cebb61ca00f5455fe6e25938cd79fea15ab 24-May-2008 Theodore Ts'o <tytso@mit.edu> Add CRC32 (big-endian) routine for use by journal checksums

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
rc32.c
rc32defs.h
2fsck.h
en_crc32table.c
d5a8f9a9f25a85b69335915e5dac2a359334b5d7 03-Jun-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Detect unordered extents in an extent node

The logical block numbers must be monotonically increasing, and there
must not be any overlapping extents. If any are found, report them as
filesystem corruption.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
roblem.c
roblem.h
16bd349e1f9e24e5c936a409953264b09b1231db 02-Jun-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Wire up callback functions for _alloc_block() and _block_alloc_stats()

Wire up callback functions for ext2fs_alloc_block() and
ext2fs_block_alloc_stats() so that we use the ctx->block_found_map
block bitmap to determine which new block we should allocate, and then
to update the block_found_map bitmap if the extent functions need to
allocate or release blocks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
11de9261c156e2b274aab0997808a1eb3cf1ddb5 30-May-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Don't double count an extent after deleting the last extent

ext2fs_extent_delete() will leave the extent handle pointing at the
next extent --- except if the last extent in the node. To deal with
this last case, call ext2fs_get_extent_info() and stop scanning after
processing info->num_entries extents.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
73e5abcfe43d6bbd5b4793769d41d097ba7aed84 28-May-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Don't skip an extent after deleting an invalid extent

ext2fs_delete_extent() deletes the current extent and moves to the
next extent (if present). So we need to skip moving to the next
extent and get the (new) current extent and check it before moving on.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
c0af709e52dd4952d78f051ea5c082437ee3412b 21-May-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'

Conflicts:

README
version.h
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>
fs_user.h
ecovery.c
eda08d45bd984547f87ad3770fad559c7ccede31 15-May-2008 Theodore Ts'o <tytso@mit.edu> Install {mkfs,fsck}.{ext4,ext4dev} binary and man pages

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
16b851cdae98244e117fe91d93b267fcad1102b3 21-Apr-2008 Theodore Ts'o <tytso@mit.edu> Remove LAZY_BG feature

This simplifies the code, and using the uninit_bg with the inode table
lazily initialized is just as good.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
uper.c
4a2924eaa371da712d610062367b7e9c3478b055 19-Apr-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix pass5 handling of meta_bg and uninit_bg combination

The pass5 lazy block group support didn't understand meta_bg formats
correctly. Fix this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
2930dad2b20fe4b04ee3e9f5c7a76d8bf63342b0 18-Apr-2008 Theodore Ts'o <tytso@mit.edu> Rename the feature uninit_groups to uninit_bg

Allow the old name of uninit_groups when converting feature names for
backwards compatibility for scripts running mke2fs and tune2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
7a1eac2fbe8bcd6588a198af51f66347bb10f5ab 02-Apr-2008 Eric Sandeen <sandeen@redhat.com> e2fsck: Only check PR_1_EXTENT_ENDS_BEYOND for leaf nodes

pass1 was checking that an "extent's" start+len did not extend
past the last filesystem block, but unless we are at a leaf
block, the physical block is that of a node in the tree, and
the length may include sparseness. The test is only valid
for leaf blocks.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass1.c
1ca1059fd0126fd2c065f272a566c18f14bab16d 09-Apr-2008 Theodore Ts'o <tytso@mit.edu> Add support for the HUGE_FILE feature

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
mptydir.c
essage.c
ass1.c
ass2.c
ass3.c
ehash.c
uper.c
60dc00b28565ee09d1c93845237240f7d17ca075 07-Apr-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'
bb0224a77161d49f76879066b4486e759f4e94f1 07-Apr-2008 Matthias Koenig <mkoenig@suse.de> e2fsck: avoid double free of ctx->filesystem_name

In current git there is a double free on ctx->filesystem_name in the
end of main() and in e2fsck_free_context, causing e2fsck to abort at
the end of pass5.

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
01c196b4f121cb77f50b9af2c54838aa4c6e06a0 30-Mar-2008 Eric Sandeen <sandeen@redhat.com> Fix a couple of implicit function declarations

Fedora seems to be gearing up to add
-Werror-implicit-function-declaration
to the standard build flags, so I thought I'd get out ahead
of this one...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
dfc870c718d22054ee6e8d607fcec76dd6f8e17d 01-Apr-2008 Eric Sandeen <sandeen@redhat.com> e2fsck: Fix extent flag validity tests in pass1 on big endian boxes.

Extent data is shared with the i_block[] space in the inode,
but it is always swapped on access, not when the inode is read.

In e2fsck/pass1.c we must be careful when checking validity
of the extents flag on the inode. If the flag was set when
the inode was read & swapped, then the extents data itself
(in ->i_block[]) was NOT swapped, so testing for a valid
extent header requires some swapping first. Then, if we
ultimately set the extents flag, all of i_block[] must be
re/un-swapped.

This passes the f_extent regression test on both ppc & x86.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
db0691b55521a072e05b47a4862bf5a30d550e7d 31-Mar-2008 Theodore Ts'o <tytso@mit.edu> Fix trailing whitespace in e2fsck/problem.[ch]

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
roblem.h
0d5439c8e0bc63438f45315755e7f0d9dcb09ccf 31-Mar-2008 Andreas Dilger <adilger@dilger.ca> e2fsck: Add check to enforce a valid block bitmap in last block group

Add a check for the UNINIT_BLOCKS flag set in the last group. The kernel
patch doesn't handle this gracefully, because it assumes there are a full
set of blocks in each group marked UNINIT_BLOCKS. The kernel should be
fixed up, but in the meantime this avoids hitting the problem, and is
more consistent with lazy_bg not marking the last group UNINIT.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
roblem.h
uper.c
f628acea2671dda839fc086f1017718e41e34eca 31-Mar-2008 Andreas Dilger <adilger@dilger.ca> ext2fs_set_gdt_csum(): Return an error code on errors instead of void

Change the function signature so that ext2fs_set_gdt_csum() returns an
error code.

If the inode bitmap hasn't been loaded return EXT2_ET_NO_INODE_BITMAP.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
a70f10dbc493c4eae488cadd8512e873220037d9 30-Mar-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'
a2447f8c8aaaa4732b8ab950cb29699a1ff0d694 29-Mar-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Avoid core dump when using the -N option

This bug was accidentally introduced by commit 1dc506cb.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
1dc506cbe956419f0eafb8e84bae108ec2f0b2de 26-Mar-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Include the device name in the progress information

Also make sure the device name has no spaces in it, to avoid confusing
displays, and make ctx->filesystem_name and ctx->device_name allocated
memory to avoid potential problems in the future.

Addresses-Launchpad-Bug: #203323
Addresses-Sourceforge-Bug: #1926023

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.c
nix.c
be62523be2307123886934f258cf36f4b33b1c38 26-Mar-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Support a negative argument to -C to suppress progress information

If a negative progress argument is given to -C, initially suppress the
progress information. It can be enabled later by sending the e2fsck
process a SIGUSR1 signal.

Addresses-Launchpad-Bug: #203323
Addresses-Sourceforge-Bug: #1926023

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.8.in
nix.c
cb23cad5b750084212ca068a7212618e4b903730 24-Mar-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Don't object to extents flags on deleted fast symlinks

Thanks to Aneesh Kumar for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
85b59c40f4b37e43e58aef188b07a3b6678ce782 19-Mar-2008 Eric Sandeen <sandeen@redhat.com> Fix ext2fs_extent_get for uninit leaf extents

The ext2fs_extent_get() function was not OR-ing together UNINIT
and LEAF flags in the case where an extent was both; so if we
had an extent which was both uniint and leaf, pass1 would bail
out where depth == max_depth but was not marked as leaf, and
e2fsck (from the next branch) would abort with:

e2fsck 1.40.8 (13-Mar-2008)
Pass 1: Checking inodes, blocks, and sizes
Error1: No 'down' extent
Aborted

Also, if the error is encountered again, print the inode number
to aid debugging until it's properly handled, at least.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
49a7360ba6b986242d9f0f33e102291d2e0dfb47 22-Oct-2007 Jose R. Santos <jrs@us.ibm.com> Make e2fsck uninit block group aware

This patch has all the necesary pieces to open and fix filesystems created
with the uninit block group feature.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
ournal.c
ass2.c
ass5.c
roblem.c
roblem.h
uper.c
nix.c
til.c
2d328bb76d2d63bdfdba923b54c28bd686bd8fec 18-Mar-2008 Theodore Ts'o <tytso@mit.edu> Fix miscellaneous gcc -Wall warnings

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uper.c
a7c9cb7d0dc464eda26958595b728a6c3a4cacbc 02-Feb-2008 Andreas Dilger <adilger@sun.com> Add support for the DIR_NLINK feature.

This patch includes the changes required to e2fsck to understand the
nlink count changes made in the kernel.

In e2fsck pass 4, when we fetch the actual link count, if it is
exceeds 65,000 we set the link count to 1. We silently fix the
situation where the nlink count of the directory is 1, and there are
fewer than 65,000 subdirectories, since since that can happen
naturally.

Patch originally from CFS, significantly rewritten by Theodore Ts'o.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass4.c
ee19c902e6f09ae058577f6b742d60692e7fb853 14-Mar-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Check for fast symlinks that have EXTENTS_FL set

These shouldn't show up in the wild, but if they do, e2fsck will offer
to clear them.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
roblem.c
roblem.h
7cadc57780f3e3e8e644e8976e11a336902d4a25 14-Mar-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Support long symlinks which use extents

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
ass1.c
ass2.c
a040a99b6cc4bf9f10d39747ca6947f0462a2eb2 13-Mar-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'

Conflicts:

lib/ext2fs/ext2_err.et.in
2a60480627b28a368c82b87c0795c771c1f8769a 13-Mar-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Use "Clear Htree" instead of "Clear" when the Htree is corrupt

Change the prompt so it is clear to the user that e2fsck will be
clearing the htree information, not the directory inode itself, when
the htree information has proven to be corrupt.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
2cd12338395fda301826a88ec7005f4362cc756e 13-Mar-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix directory i_size handling

If a directory's i_size is bigger than the number of blocks, don't try
to allocate extra empty blocks to the end of the directory; there's no
real point to do that. Also, if a directory's i_size is not a
multiple of the blocksize, flag that as a mistake so it can be fixed.

This more elegantly addresses the problem which was found on Bas van
Schaik's filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
d45edec0fb2e5d100d122fdda0914560c64def44 12-Mar-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Handle a pass 2 "should never happen" error gracefully

Turns out a "should never happen" error can indeed happen very easily
if a directory with an htree index has an incorrect, and too-large,
i_size field. This patch fixes this so that we handle this situation
gracefully, allowing filesystems with this error to be fixed.

In another patch I will clean up the specific problem which caused the
internal "should never happen" error from happening at all, but patch
will prevent e2fsck from crashing, and prompt the user to remove the
htree index, so it can be rebuilt again after pass 3.

Thanks to Bas van Schaik at Tetra for giving me access to his system
so this problem could be debugged.

Addresses-Launchpad-Bug: #129395

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass2.c
roblem.c
roblem.h
46d9a7462b7e796fb34c09c02e635ab77012c2bb 12-Mar-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Fix obvious typo in an "internal error" message

Thanks to Philipp Thomas for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1b.c
399033a6ab713bc1f8ebad90e47fced0e7491b62 29-Feb-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'
1f803990b8ebd27f49904896a73d596d1deb7c20 29-Feb-2008 Mike Frysinger <vapier@users.sourceforge.net> Fix makefile dependency issues for various install targets

Addresses-Sourceforge-Patches: #1903484
Addresses-Sourceforge-Patches: #1903466
Addresses-Sourceforge-Patches: #1903456

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
a49670e64e28ac3b15e36cb6bd0a8135d3ecdbbb 28-Feb-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'

Conflicts:

lib/blkid/devname.c
lib/blkid/probe.c
misc/mke2fs.c
misc/tune2fs.c
4f9abdcb306ff515a8009a1e0fd35041688133c9 27-Feb-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Print an explicit message when the bad block inode is updated

Some users were confused about why the filesystem was modified.

Addresses-Sourceforge-Bug: #756460

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
adblocks.c
77175ca20cbfd8d8f3473a060bdbcb7f18505d1f 27-Feb-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Don't clear the LARGE_FILES feature flag

Stop clearing the EXT2_FEATURE_RO_COMPAT_LARGE_FILE flag automatically
if there are no large files in the filesystem. It's been almost a
decade since there have been kernels that don't support this flag, and
e2fsck clears it quietly without telling the user why the filesystem
has been changed.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass2.c
dcc91e1053c357efca35e0d5674aa78989ee44bf 27-Feb-2008 Theodore Ts'o <tytso@mit.edu> Enhance e2fsck's reporting for reporting unsupported filesystem features

Addresses-Sourceforge-Feature-Request: #1175808

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
nix.c
a3d9d376646e6afd2677dbb35734ef2f402cba15 26-Feb-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Document that the -D option finds duplicate file names

Document in the e2fsck man page that e2fsck finds duplicate filenames
only when the -D option is passed to e2fsck.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.8.in
7dc099887c3f922834e88dc55907dc0fa385b346 22-Feb-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: Account for index nodes in the extent tree for i_blocks

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass1.c
fefaef39e046781ddc75d15a8f12369f17dbd17d 02-Feb-2008 Andreas Dilger <adilger@sun.com> Improve support for in-inode EA's

Add vertificaton of the in-inode EA information, and allow in-inode
EA's to have a checksum.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
ass1.c
ass4.c
roblem.c
til.c
15d482ba6e46b6979d8d9e9b3b28e0942b626c2e 21-Aug-2007 Theodore Ts'o <tytso@mit.edu> e2fsck: Add support for extents

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
essage.c
ass1.c
ass1b.c
roblem.c
roblem.h
e3df15abdb288c3519000c639ed40429a82b63cd 15-Sep-2007 Theodore Ts'o <tytso@mit.edu> e2fsck: factor out code to clear an inode into e2fsck_clear_inode()

Factor out code to clear a bogus inode and update e2fsck's internal
data structures accordingly into a common routine,
e2fsck_clear_inode(). This saves about 200 bytes in the compiled x86
e2fsck executable, and makes the code more maintainable in the
long-term.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
ass1.c
ass1b.c
ass2.c
ass4.c
ef80fdc8ad014c55e601018f4f6ec22065c37030 10-Feb-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next
414025e542d66a34e164286e783143cb256dd75e 31-Jan-2008 Theodore Ts'o <tytso@mit.edu> Fix bug in e2fsck which caused it to core dump if --enable-jbd-debug is used

Missing curly braces from a python programmer; my bad for noticing it!

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
428f6b32a9029e1f0bc2559233954955a6aae64c 28-Jan-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:

configure
lib/ext2fs/ext2_fs.h
misc/e2image.c
7e8fe327b51051adcbb0d44169b1a933173ce1ff 27-Jan-2008 Theodore Ts'o <tytso@mit.edu> Don't build e2fsck statically by default anymore

Also removed the --enable-dynamic-static configure option.

Unfortunately the usefulness of building e2fsck statically is gone on
all modern distributions, since everything else on the system is built
dynamically these days. In fact on some distributions it is almost
impossible to build programs statically any more.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
a8cde73acbf6e0f9c0a3601e4f5fac2b01a27bd2 27-Jan-2008 Theodore Ts'o <tytso@mit.edu> Ignore "safe" flag differences when e2fsck compares superblocks

Recent e2fsprogs (1.40.3 and higher) fsck compares primary superblock to
backups, and if things differ, it forces a full check. However, the
kernel has a penchant for updating flags the first time a feature is
used - attributes, large files, etc.

This is a bad idea, and we should break the kernel of this habit,
especially for the ext4 feature flags. But for now, let's make e2fsck
avoid forcing a full check and backup except when absolutely
necessary.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
uper.c
fef2b38d8e5b475655771f8208265a8fa9246601 01-Jan-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:

configure
debian/rules
e2fsck/swapfs.c
lib/ext2fs/ext2_fs.h
d66c38329e9897563bd29908043e5187f868b46d 01-Jan-2008 Theodore Ts'o <tytso@mit.edu> e2fsck: When optimizing non-htree directories, sort by inode number

Previously "e2fsck -fD" on a non-htree directory would sort the
directory alphabetically by name. That's stupid. Better to sort the
directory by inode number, since that will optimize performance much
more significantly than sorting by name!

Addresses-Sourceforge-Feature-Request: #532439

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ehash.c
1e5c6d34e7fb538ab3417bd7cdcc3d3b4d392c2d 01-Jan-2008 Theodore Ts'o <tytso@mit.edu> Expand discussion of the -D option in e2fsck's man page

Add an explanation of how e2fsck might decide to optimize a few
directories even without the -D option being specified.

Addresses-Debian-Bug: #441872

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.8.in
e5aace908e9d1161a594944d9360f9f0cdd18099 27-Dec-2007 Theodore Ts'o <tytso@mit.edu> Convert use of ext2fs_get_mem to ext2fs_get_array for overflow detection

Add some additional checks, primarily in resize2fs and in the rarely
used (and soon to-be-deprecated) e2fsck byte-swap filesystem function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
wapfs.c
e6a4571eec5ce0e75fb8a5a41c30bf0e68d90efe 09-Dec-2007 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:

lib/ext2fs/closefs.c
7ce238977a4bc9c5965617d76848477abad0f76a 06-Dec-2007 Theodore Ts'o <tytso@mit.edu> Add Ubuntu-specific e2fsck.conf file to work around Ubuntu issues

Ubuntu has init script and installer issues which cause them to have
significant problems with time zones. This is compounded with a
relatively inexperienced user base who want to dual boot with Windows
and so have their hardware clocks tick localtime.

Addresses-Ubuntu-Bug: #131201

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.conf.ubuntu
5ea565fd37821b2708c2b7f1e49fe6fc94587794 04-Nov-2007 Theodore Ts'o <tytso@mit.edu> Merge basic FLEX_BG support

Merge commit 'c2d4300b8a4a13d8a78b86c386f76259f23feec2' into next
88b34b1f87c2d7c3dfc9be7ff6e5d916f06d960a 14-Aug-2007 Jose R. Santos <jrs@us.ibm.com> Relax group descriptor checking for FLEX_BG

The FLEX_BG feature allows the inode table, block bitmap, and inode
bitmaps to be located anywhere in the filesystem. Update e2fsck and
libext2fs's checking code to recognize this.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
--

e2fsck/super.c | 14 ++++++++++++--
lib/ext2fs/check_desc.c | 15 +++++++++++++--
2 files changed, 25 insertions(+), 4 deletions(-)
uper.c
d9099eec8e8f801932f01b707513b330908080d7 01-Nov-2007 Theodore Ts'o <tytso@mit.edu> Merge branch 'cl/remove-masix' into next
5b57d921b4b9d9b0c4c678e2078887776eb43bbf 23-Aug-2007 Coly Li <coyli@suse.de> e2fsck: remove masix support

This patch remove masix support from e2fsck.

Signed-off-by: Coly Li <coyli@suse.de>
ass1.c
ass2.c
da938f20ac22a6b748640206b76e60616fde2668 20-Oct-2007 Dmitry V. Levin <ldv@altlinux.org> check_ea_in_inode: Cleanup e2fsck_write_inode_full() call

Avoid pointer cast and call e2fsck_write_inode_full() the same way
as check_inode_extra_space() does.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ass1.c
5d38ef1d049bf56d1c1e88b8b4d287c0f9470e61 30-Aug-2007 Valerie Clement <valerie.clement@bull.net> libext2fs: cleanup usage of unsigned int or __u32 and replace it with blk_t

Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
uper.c
2628a1d3e1e581512d136486768685542d2649b1 06-Oct-2007 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'
0c37f456d929dac47fcf87374f1c1b9a9a96c9fa 01-Oct-2007 Theodore Ts'o <tytso@mit.edu> e2fsck: backup superblocks if key constants have changed

If the primary superblock differs from the backup superblock in
certain key respects, force a full check (if e2fsck was invoked in
preen mode). If the filesystem check passes cleanly, and the
filesystem was opened in read/write mode, then write the primary
superblock to all of the backups.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
uper.c
nix.c
0cfce7f749ea519522929d91e705cf90518594c4 06-Oct-2007 Theodore Ts'o <tytso@mit.edu> e2fsck: update the backup superblocks if the feature bitmasks are changed

If e2fsck adds or deletes any of the feature bitmasks, clear
EXT2_FLAG_MASTER_SB_ONLY so the backup superblocks are updated when
e2fsck finishes.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ournal.c
ass2.c
uper.c
nix.c
d006b8cee78fc415f7c5666af41afdd6ceda42a1 23-Sep-2007 Theodore Ts'o <tytso@mit.edu> e2fsck: Don't mark the filesystem invalid because of time errors

If superblock mount time or last write time is in the future, and the
user refuses to fix the problem, don't mark the filesystem as being
invalid and needing to be checked.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
roblem.c
60702c267d83bc75ca22e8efb5eff0e1a8821800 23-Sep-2007 Theodore Ts'o <tytso@mit.edu> Work around lame Ubuntu init scripts / installer bugs

The Ubuntu init scripts don't properly set the system time correctly
from hardware clock if the hardware clock is configured to tick local
time instead of GMT time.

Work around this as best as we can by providing an option in
/etc/e2fsck.conf which can be set on Ubuntu systems:

[options]
buggy_init_scripts = 1

Addresses-Debian-Bug: #441093
Addresses-Ubuntu-Bug: #131201

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.conf.5.in
2fsck.h
uper.c
nix.c
cd538080ab6e4bf64886b42f0bfa2fa47d44d20d 07-Sep-2007 Theodore Ts'o <tytso@mit.edu> e2fsck: If the superblock is corrupt, automatically retry with the backup sb

E2fsck currently only retries with the backup superblock if the
primary superblock is missing (e.g., overwritten with garbage). If
the superblock is just corrupted enough that it looks like ext2/3/4
superblock, but it is corrupt enough that ext2fs_open2() returns an
error, e2fsck stops without retrying. Let's fix this oversight.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
e9e9602246e4a0ece7a07beceae63346b0d75801 21-Aug-2007 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'
5845caa464d51e1dceeb6282c3a00957ae435de1 21-Aug-2007 Theodore Ts'o <tytso@mit.edu> Use sscanf instead of atoi when parsing e2fsck options

atoi() does not check for errors so it shouldn't be used for human
input. For example, if the user enters the command "e2fsck -C -n" and
forgets that -C requires an argument, the -n will be used as the
argument to -C, and not parsed as an option. When using sscanf(),
this error case can be detected.

Addresses-Debian-Bug: #435381

Signed-off-by: Bernd Schubert <bs@q-leap.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
2eae093081a097a0a611fe2817e1533825dfdd86 11-Aug-2007 Theodore Ts'o <tytso@mit.edu> Clean up applications to not use EXT2FS_ENABLE_SWAPFS or EXT2_FLAG_SWAP_BYTES

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ournal.c
til.c
1a855cb21f3c5d1c1b0acaf2beab879e9b5cd118 11-Aug-2007 Theodore Ts'o <tytso@mit.edu> Remove e2fsck's -s and -S options to byte-swap ancient PPC filesystems

The need for fixing byte-swapped filesystems is long-gone, and this is
getting in the way of cleaning up e2fsprogs's bitmaps code. So let's
get rid of it; modern kernels haven't been able to deal with a
byte-swapped filesystem in in about 9 years.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
2fsck.8.in
2fsck.h
wapfs.c
nix.c
aef2283196667d3b843a55c0fd6e6ebd8b6239c7 04-Aug-2007 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'
9f0288d3bbbf47bb05e5abf1e570df368476a8cd 04-Aug-2007 Theodore Ts'o <tytso@mit.edu> e2fsck: Allow i_size to be rounded up to the size of a VM page

Allow files to be preallocated on-disk up to the next multiple of the
system's page size without complaining about extra blocks.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.c
2fsck.h
ass1.c
nix.c
6d96b00d57d236e2746f8245df6c8ea64abc64c1 04-Aug-2007 Theodore Ts'o <tytso@mit.edu> Add I/O statistics to e2fsck

This patch instruments the libext2fs unix I/O manager and adds bytes
read/written and data rate to e2fsck -tt pass/overall timing output.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2fsck.h
ass1.c
ass2.c
ass3.c
ass4.c
ass5.c
ehash.c
wapfs.c
nix.c
til.c
f1f115a78f5ea599fc5f8815a741d43fedd5840d 23-Jul-2007 Theodore Ts'o <tytso@mit.edu> libext2fs: 32-bit bitmap refactorization, part 3

Create new functions ext2fs_{set,get}_{inode,block}_bitmap_range()
which allow programs like e2fsck, dumpe2fs, etc. to get and set chunks
of the bitmap at a time.

Move the representation details of the 32-bit old-style bitmaps into
gen_bitmap.c.

Change calls in dumpe2fs, mke2s, et. al to use the new abstractions.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass5.c
5e9ba85c2694926eb784531d81ba107200cf1a51 11-Jul-2007 Theodore Ts'o <tytso@mit.edu> Fix e2fsck segfault on very badly damaged filesystems

A recent change to e2fsck_add_dir_info() to use tdb files to check
filesystems with a very large number of filesystems had a typo which
caused us to resize the wrong data structure. This would cause a
array overrun leading to malloc pointer corruptions. Since we
normally can very accurately predict how big the the dirinfo array
needs to be, this bug only got triggered on very badly corrupted
filesystems.

Thanks to Andreas Dilger for submitting the test case which discovered
this problem, and to Kalpak Shah for writing a random testing script
which created the test case.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
irinfo.c
575307cc63d24766ff789262a5cea7b4faf2fa13 09-Jul-2007 Kalpak Shah <kalpak@clusterfs.com> e2fsck: Fix salvage_directory when the last entry's rec_len is too big

Recently, one of our customers found this message in pass2 of e2fsck
while doing some regression testing:

"Entry '4, 0x695a, 0x81ff, 0x0040, 0x8320, 0xa192, 0x0021' in ??? (136554) has
rec_len of 14200, should be 26908."

Both the displayed rec_len and the "should be" value are bogus. The
reason is that salvage_directory sets a offset beyond blocksize
leading to bogus messages.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass2.c
424a3e4a2367f582edeb062ab12f3f95fdf9e31b 08-Jul-2007 Theodore Ts'o <tytso@mit.edu> Remove Changelog files since they're not used after the git migration

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
6f890e516d1eddb52a566d1f77888c9edf5772f2 04-Jul-2007 Theodore Ts'o <tytso@mit.edu> Add new function: profile_set_default()

profile_set_default() sets the value of the pseudo file "<default>".
If the file "<default>" had previously been passed to profile_init(),
then def_string parameter will be parsed and used as the profile
information for the "<default>" file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
rofile.c
rofile.h
6bde5c28ba25600f02f6d8cd2e8de39017bc421d 04-Jul-2007 Theodore Ts'o <tytso@mit.edu> Add PROFILE_FILE_NO_RELOAD flag which is used by profile_update_file()

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
rofile.c
1a191d6648c8511d389cd9bea11dedb671f64456 03-Jul-2007 Theodore Ts'o <tytso@mit.edu> e2fsck: Detect recursive loops in @-expansions

The Turkish translation has a bug in it where it has the translation
of "E@e '%Dn' in %p (%i)" to "E@E". This causes @E to be expanded at
@E, recursively, forever, until the stack fills up e2fsck core dumps.

Fix it by stopping after a recursive depth of 10, which is far more
than we need.

Addresses-Sourceforge-Bug: 1646081

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
essage.c
roblem.c
roblem.h
d7b64725eecb06b2bbc5e90dc338d8d08152a932 24-Jun-2007 Theodore Ts'o <tytso@mit.edu> Update Release Notes, Changelogs, version.h, etc. for 1.40 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
a34c6ffd687aef4941bbc32793078c13914d3864 22-Jun-2007 Andreas Dilger <adilger@clusterfs.com> e2fsck: added sanity check for xattr validation

Add an extra validity test in check_ext_attr(). If an attribute's
e_value_size is zero the current code does not allocate a region for it
and as a result the e_value_offs value is not verified. However, if
e_value_offs is very large then the later call to
ext2fs_ext_attr_hash_entry() can dereference bad memory and crash
e2fsck.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Jim Garlick <garlick@llnl.gov>
hangeLog
ass1.c
df361363011a1d68e78e31c0f10e9606a79cdb12 21-Jun-2007 Theodore Ts'o <tytso@mit.edu> Fix gcc -Wall bug in e2fsck

Remove extraneous return after fatal_error().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
051afbe0d7f49429c26d2a7a33f1f3857d07c3d0 21-Jun-2007 Theodore Ts'o <tytso@mit.edu> e2fsck: Check the all of journal blocks for validity

The original code only checked the direct blocks to make sure the
journal inode was sane. Unfortunately, if some or all of the indirect
or doubly indirect blocks were corrupted, this would not be caught.
Thanks to Andreas Dilger and Kalpak Shah for noticing this problem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ournal.c
ded28ac2ab67300f39783184a8f8930b548fc5f0 21-Jun-2007 Kalpak Shah <kalpak@clusterfs.com> Write the updated journal inode if s_jnl_blocks was successfully used

If the journal inode was corrected from s_jnl_blocks, write the fixed
journal inode back to disk.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
ournal.c
5107d0d196b9c51cf18380b6996b1074afe51df2 21-Jun-2007 Kalpak Shah <kalpak@clusterfs.com> Recreate journal that had been removed previously due to corruption

If the journal had been removed because it was corrupt, the
E2F_FLAG_JOURNAL_INODE flag will be set. If this flag is set, then
recreate the filesystem after checking the filesystem.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
ournal.c
roblem.c
roblem.h
nix.c
058ad1c70c9a097d282270c6f76d3c3493e15fe2 19-Jun-2007 Theodore Ts'o <tytso@mit.edu> Don't write changes to the backup superblocks by default

This patch changes ext2fs_open() to set EXT2_FLAG_MASTER_SB_ONLY by
default. This avoids some problems in e2fsck (reported by Jim Garlick)
where a corrupt journal can end up writing the bad superblock to the
backups. In general, only e2fsck (after the filesystem is clean),
tune2fs, and resize2fs should change the backup superblocks by default.
Most callers of ext2fs_open() should not be touching anything where the
backups should be touched. So let's change the defaults to avoid
potential problems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ournal.c
nix.c
d2af1bdd0526603b762c875630e82e0dd9eff059 04-Jun-2007 Theodore Ts'o <tytso@mit.edu> Fix e2fsck's get_size logic so it will work with the Linux floppy driver

The Linux floppy driver is a bit different from the other block device
drivers, in that if the device has been opened with O_EXCL, it disallows
another open(), even if the second open() does not have the O_EXCL flag.
So this patch moves the call to ext2fs_get_device_size() so that if it
returns EBUSY, e2fsck can close the filesystem, retry the device size,
and then reopen it. This rather complicated approach is required since
we need to know the blocksize of the filesystem before we can call
ext2fs_get_device_size().

Addresses Debian Bug: #410569

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
2fsck.h
uper.c
nix.c
e7b5d3c0b2bb1bafc5be57796ac1b68b1ac8e983 31-May-2007 Daniel Drake <d.drake@mmm.com> e2fsck: Add blocksize sanity check when finding a backup superblock

I've been investigating why e2fsck refuses to restore the backup superblock
of a partition with a broken primary superblock.

The partition in question has a block size of 4096, and mke2fs reports that
backup superblocks were created on blocks 32768, 98304, 163840, ...

When running e2fsck, get_backup_sb starts by guessing a block size of 1024
and backup superblock at block 8193. I'm not sure why, but it actually finds
a superblock at this location, so returns a context with superblock 8193,
blocksize 1024.

Later on, ext2fs_open2() tries to process this superblock. It then realises
that the block size value stored in the superblock (4096) does not match what
it was told (1024), so it bails out with EXT2_ET_UNEXPECTED_BLOCK_SIZE. fsck
aborts without fixing the partition.

The following patch solves the problem by discounting superblocks which do
not meet the currently-sought block size.
As a result, block 32768 (blocksize=4096) is now used to restore the backup,
which agrees with the first location that mke2fs listed.

Signed-off-by: Daniel Drake <d.drake@mmm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
til.c
8f234d9650eb6f6a897148d5136cb27f373de4a7 31-May-2007 Brian Behlendorf <behlendorf1@llnl.gov> [COVERITY] Free potential null dereference bug in e2fsck

At the second conditional iter->file could still be NULL. We need to
check for it again. Should never happen in practice, but better to be
sure.

Coverity ID: 6: Forward Null

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
rofile.c
de8f3a76218255e443ba57dec5d74850180fa75d 25-May-2007 Andreas Dilger <adilger@clusterfs.com> Fix gcc -Wall warnings, especially on 64-bit systems

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
essage.c
f954ba012fbff61730890115308e78de6720ad5f 23-May-2007 Theodore Ts'o <tytso@mit.edu> Fix gcc -Wall issues in e2fsck sources

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
hangeLog
irinfo.c
ass1.c
32460c1e4c7259b532bdd1e74583c80f573b467a 23-May-2007 Theodore Ts'o <tytso@mit.edu> Add new function profile_get_uint() in the e2fsck sources

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
rofile.c
rofile.h
1a8c2c4a89d380db07e9e95c49fdd8b46d893417 08-May-2007 Kalpak Shah <kalpak@clusterfs.com> Remove check in e2fsck which requires EA's in inodes to be sorted

This patch removes a code snippet from check_ea_in_inode() in pass1 which checks
if the EA values in the inode are sorted or not. The comments in fs/ext*/xattr.c
state that the EA values in the external EA block are sorted but those in the
inode need not be sorted. I have also attached a test image which has unsorted
EAs in the inodes. The current e2fsck wrongly clears the EAs in the inode.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
hangeLog
ass1.c
5113a6e32b298671c86ae7da097bcd24540cebc9 08-May-2007 Eric Sandeen <sandeen@redhat.com> Fix mke2fs and debugfs to support large (> 16 bit) uid's and gid's

Mke2fs is supposed to set the uid/gid ownership of the root directory when
a non-rooot user creates the filesystem. This wasn't working correctly
if the uid/gid was > 16 bits. In additional, debugfs wasn't displaying
large uid/gid's correctly. This patch fixes these two programs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
essage.c
81cae650b7356ce493f93a33370d6a8c00f5948e 20-Apr-2007 Jim Garlick <garlick@llnl.gov> e2fsck: Count the root directory as found if it has shared blocks in pass1c

Another small bug I think: if the root directory contains shared
blocks, e2fsck pass1c search_dirent_proc() will be looking for
one more containing directory than it will ever find, and thus
loses an opportunity to terminate early.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
ass1b.c
a4d7d90deb8a56b1d1f5e3cb881d070843231186 19-Apr-2007 Theodore Ts'o <tytso@mit.edu> Fix minor typo in e2fsck.conf.5.in man page

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
2fsck.conf.5.in
d5b753ee4d798a9869a1ba819a55dea9d81e0f68 19-Apr-2007 Theodore Ts'o <tytso@mit.edu> Remove unused variable in e2fsck/pass2.c:check_dir_block()

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ass2.c
3f4c46e3f9871011a3d4dffbf7a0beb35bd27d08 14-Apr-2007 Bryn M. Reeves <breeves@redhat.com> Correct byteswapping for fast symlinks with xattrs

Fix a problem byte-swapping fast symlinks inodes that contain extended
attributes.

Addresses Red Hat Bugzilla: #232663
Addresses LTC Bugzilla: #27634

Signed-off-by: "Bryn M. Reeves" <breeves@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass2.c
0eeb15493755329fe4d85be913d5eff657cefec3 14-Apr-2007 Theodore Ts'o <tytso@mit.edu> Fix e2fsck's check_is_really_dir logic

Fix a typo which could cause e2fsck to throw an I/O error while doubling
checking whether or not a special device file was really an inode.
Also, don't do this tests on symbolic links since for filesystems with a
large numbers of symlinks it could degrade performance and increases the
risk for false positives.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass1.c
e94bc631648299dca43a6015520b18f6232d50df 14-Apr-2007 Theodore Ts'o <tytso@mit.edu> Improve I/O error messages in e2fsck

Add better ehandler_operation() markers so it is clearer what e2fsck was
doing when an I/O error is reported.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass1.c
ass2.c
til.c
3d51ff876e707248a26031beb80ce29c395cd51e 11-Apr-2007 Jim Garlick <garlick@llnl.gov> e2fsck: pass1c terminates early if hard links

I think this is a small buglet in e2fsck: if a file has multiple hard
links, e2fsck pass1c search_dirent_proc() doesn't maintain its count
properly and may return DIRENT_ABORT before it has found containing
directories for all inodes sharing blocks.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass1b.c
39efa4c500fc965da9085dd9a8138bb9cf867d36 07-Apr-2007 Theodore Ts'o <tytso@mit.edu> Update the e2fsck.conf(5) man page to document the [scratch_files] section

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
2fsck.conf.5.in
a1f642728fe6fd2c361343fec349808ea8a524f4 07-Apr-2007 Theodore Ts'o <tytso@mit.edu> Fix memory leaks from using the tdb library

We weren't freeing allocated memory from calls to tdb_fetch, tdb_firstkey,
and tdb_nextkey. Oops.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
irinfo.c
25a9fe2894a147f5d0d2320357f78c7ff9de09e3 07-Apr-2007 Theodore Ts'o <tytso@mit.edu> Enable e2fsck to use the tdb library to store the dirinfo abstraction

If e2fsck.conf configures a scratch_files directory which is available,
and the number of directories exceeds scratch_files.numdirs_threshold,
then try to use the tdb library to store the directory information
abstraction. This allows us to check very large filesystems without
needing as much physical memory.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
irinfo.c
34b9f7963933daeb1c3fb3f21a70a1673d098154 07-Apr-2007 Theodore Ts'o <tytso@mit.edu> Enable e2fsck to use the tdb library for the inode count abstraction

If e2fsck.conf configures a scratch_files directory which is available,
and the number of directories exceeds scratch_files.numdirs_threshold,
then try to use the tdb library to store the inode count abstraction.
This allows us to check very large filesystems without needing as much
physical memory.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
2fsck.h
ass1.c
ass2.c
28db82a84a33fab19f22da12bb2a8a3c558ae97b 05-Apr-2007 Theodore Ts'o <tytso@mit.edu> Rework e2fsck's dirinfo abstraction to be more friendly for databases

Change the iterator abstraction and replace e2fsck_get_dir_info() with
e2fsck_dir_info_{set,get}_{parent,dotdot} so that we can support an
on-disk dirinfo implementation. This allows e2fsck to check very large
filesystems on systems with smaller amounts of memory and/or address
space.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
irinfo.c
2fsck.h
ass2.c
ass3.c
ehash.c
86bc90f4f11df090f86dc764a4ea2d6dd5c13ffe 05-Apr-2007 Theodore Ts'o <tytso@mit.edu> Fix potential reference (and free) to an uninitialized pointer in e2fsck

This was introduced recently when fixing a problem noted by Coverty.
Oops!

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass1.c
fbc3f90194ca557e377c25f71db242c38c78f836 02-Apr-2007 Theodore Ts'o <tytso@mit.edu> e2fsck: Recover a special file which looks an awful lot like a directory

This is probably only useful in artificial test cases, but it will be
useful if we ever do the "inodes in directory" idea for ext4.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass1.c
roblem.c
roblem.h
ccfbb266d6ca61c3c94ef6f391bb6384b8c58841 01-Apr-2007 Theodore Ts'o <tytso@mit.edu> e2fsck: Add support for %It in problem description messages

Add support for the %It expansion, which will print the type of the inode
in the problem context.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
essage.c
56c8c592ac48c0fc9772153bb7bdf621b1de0ab9 01-Apr-2007 Theodore Ts'o <tytso@mit.edu> Fix e2fsck to set the filetype of '..' when connecting a dir, to lost+found

If there is an orphaned inode whose '..' entry is pointing at a special
file, the filetype of the '..' entry will set to the type of the special
file. When the orphaned directory is reconnected to /lost+found, the
filetype of the '..' field is not reset to EXT2_FT_DIR, so a second
e2fsck is required to repair the filesystem.

We address this situation by setting the filetype of '..' when we
reconnect the inode to /lost+found.

Addresses Lustre Bug: #11645

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass3.c
441ab1e02096e3c968cae6ddfde73140fcad8199 01-Apr-2007 Theodore Ts'o <tytso@mit.edu> Fix edge case when i_size doesn't get fixed until second e2fsck run

Don't assume that a special device is bogus just because i_blocks is
non-zero. The i_blocks field could get adjusted later, and if this
happens it will confuse the e2fsck_process_bad_inode() in pass 2. In
practice true garbage inodes will have random non-zero in
i_blocks[4..15], so there's no point doing the check for an illegal
i_blocks value.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass1.c
2bfe0bdba37bfd0e4378e855377ebaa823846ea3 29-Mar-2007 Brian Behlendorf <behlendorf1@llnl.gov> [COVERITY] Fix (error case only) memory leak in e2fsck_get_journal

Coverity ID: 43: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
hangeLog
ournal.c
06c9c6ffc16cbf4c9513ddea3c73328f2a937eb7 28-Mar-2007 Brian Behlendorf <behlendorf1@llnl.gov> [COVERITY] Fix (error case only) memory leak in e2fsck pass #4

Coverity ID: 42: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
hangeLog
ass4.c
1db4c4397df4918514c750a70e543fb0f865bc54 28-Mar-2007 Brian Behlendorf <behlendorf1@llnl.gov> [COVERITY] Fix (error case only) memory leak in e2fsck -S

Coverity ID: 41: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
wapfs.c
49e2df2954a5c94e53b871fc46aec086c63f45fd 28-Mar-2007 Brian Behlendorf <behlendorf1@llnl.gov> [COVERITY] Fix (error case only) memory leak in e2fsck pass #5

Coverity ID: 39: Resource Leak
Coverity ID: 40: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
hangeLog
ass5.c
9d45b6ef7e6b87323309670165b90a0f1ac2f3a3 28-Mar-2007 Brian Behlendorf <behlendorf1@llnl.gov> [COVERITY] Fix (error case only) memory leak in e2fsck pass #1

Coverity ID: 37: Resource Leak
Coverity ID: 38: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
hangeLog
ass1.c
5469d76759a8a2c14f5b05177dc156af981a213a 28-Mar-2007 Brian Behlendorf <behlendorf1@llnl.gov> [COVERITY] Fix memory leak when parsing extended options in e2fsck

Coverity ID: 36: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
hangeLog
ass1.c
cae542ce8e79403d9b3c0df4e4b7b75d03f996b6 28-Mar-2007 Brian Behlendorf <behlendorf1@llnl.gov> [COVERITY] Fix memory leak when parsing extended options in e2fsck

Coverity ID: 35: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
hangeLog
nix.c
93503267c9765f80f8bbbdbb132d495a859361e1 21-Mar-2007 Brian Behlendorf <behlendorf1@llnl.gov> [COVERITY] Fix memory leak in profile library

The profile must be freed early if the subsequent memory allocation
fails for 'expanded_filename'.

Coverity ID: 14: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
rofile.c
a4b66fb1339c1f60c2d280dd949754d4206aca0a 19-Mar-2007 Brian Behlendorf <behlendorf1@llnl.gov> [COVERITY] Add missing NULL check to e2fsck_get_dir_info()

It is possible that e2fsck_get_dir_info() returns a NULL pointer.
We do not want to blow up when dereferencing p. It seems to be
more sane/safe to call fix_problem(ctx, PR_3_NO_DIRINFO, pctx)
if p is NULL at this point since we do not have any DIRINFO
for pctx->ino.

Also fix another (already existing) error check for
e2fsck_get_dir_info() later in the function so that it reports the
correct inode number if the dirinfo information is not found for
p->parent.

(Both of these are "should-never-happen" internal e2fsck errors that
would indicate a programming bug of some kind.)

Coverity ID: 10: Null Returns

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass3.c
538e654c25b7bc48d4dd86ebcc926585e530f0ef 19-Mar-2007 Brian Behlendorf <behlendorf1@llnl.gov> [COVERITY] Check for NULL return from dict_lookup() in e2fsck

The dict_lookup() function can potentially return a NULL dnode_t. It is
not checked in two places in the clone_file() function. Looks to be
safe to continue if n is NULL, so just print a warning message and
continue.

Coverity ID: 9: Null Returns

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass1b.c
12f91959993f0d2882592427c94f35f32436e03a 19-Mar-2007 Brian Behlendorf <behlendorf1@llnl.gov> [COVERITY] Fix segfault bug if the profile directory is empty

Coverity ID: 5: Forward NULL

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
rofile.c
d2b2a488f996871e6e40789a7890afc2f59730db 18-Mar-2007 Brian Behlendorf <behlendorf1@llnl.gov> [COVERITY] Fix missing return code check for ext2fs_write_inode

Found 2 of the three places where a return code for ext2fs_write_inode() was
not being checked.

The second fix in e2fsck/emptydir.c is basically just to shut coverity up even
though it really is unnecessary.

Coverity ID: 1: Checked Return

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
mptydir.c
a6d8302b4873527798a77c1ba3106a04b71dfeac 26-Dec-2006 Theodore Ts'o <tytso@mit.edu> Use the newer add/remove_error_table com_err interfaces

Change all of the e2fsprogs programs to use the newer add_error_table()
and remove_error_table() interfaces instead of the much older
initialize_*_error_table() function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
nix.c
642935c082ca22e1186fc9926fe06e4207d5ab56 15-Nov-2006 Theodore Ts'o <tytso@mit.edu> Fix misc. gcc -Wall complaints in the misc and e2fsck directories

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ournal.c
essage.c
ass1.c
ass2.c
rofile.c
uper.c
nix.c
f77704e416fca7dbe4cc91abba674d2ae3c14f6f 12-Nov-2006 Theodore Ts'o <tytso@mit.edu> Add directory hashed signed/unsigned hint to superblock

The e2fsprogs and kernel implementation of directory hash tree has a
bug which causes the implementation to be dependent on whether
characters are signed or unsigned. Platforms such as the PowerPC,
Arm, and S/390 have signed characters by default, which means that
hash directories on those systems are incompatible with hash
directories on other systems, such as the x86.

To fix this we add a new flags field to the superblock, and define two
new bits in that field to indicate whether or not the directory should
be signed or unsigned. If the bits are not set, e2fsck and fixed
kernels will set them to the signed/unsigned value of the currently
running platform, and then respect those bits when calculating the
directory hash. This allows compatibility with current filesystems,
as well as allowing cross-architectural compatibility.

Addresses Debian Bug: #389772

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass2.c
roblem.c
roblem.h
ehash.c
uper.c
5d17119d14fe1276936c85d7986695a4543b1aa1 11-Nov-2006 Theodore Ts'o <tytso@mit.edu> On-disk format definition for huge files

- EXT4_FEATURE_RO_COMPAT_HUGE_FILE (0x0008) - change i_blocks to be
in units of s_blocksize units instead of 512-byte sectors, use
l_i_frag and l_i_fsize as i_blocks_hi (could also be part of 64BIT).

E2fsck and debugfs changed to support i_blocks_hi instead of l_i_frag and
l_i_fsize.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass1.c
ass2.c
roblem.c
roblem.h
8ade4792307303e27386420f60bacf032ad73d5d 08-Nov-2006 Theodore Ts'o <tytso@mit.edu> Fix e2fsck and mke2fs -c to be pass the last _block change to badblocks

Badblocks now interprets last_block argument as the last block to check,
instead of the number of blocks to check, to be consistent with the
badblocks man page.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
adblocks.c
977ac8731bf3bd934421dd8107e77325ec7e6de7 22-Oct-2006 Theodore Ts'o <tytso@mit.edu> Fix potential e2fsck -n crash

Don't core dump if there is a corrupt htree interior node. If the block
number is larger than the number of blocks in the directory, don't write
past the end of malloc'ed memory.

Addresses SourceForge Bug: #1512778

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass2.c
2d1fa59d9038112c21325199fe7f6d7bc22f7fa1 02-Oct-2006 Theodore Ts'o <tytso@mit.edu> Minor correction to e2fsck.conf man page

Addresses Debian Bug: #369761

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
2fsck.conf.5.in
cce2f497e07e426887a693744eaad8394d1b993a 02-Oct-2006 Theodore Ts'o <tytso@mit.edu> Fix Debian FTBFS problem caused by devmapper library using pthreads

Addresses Debian bug: #388718

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
akefile.in
d1b4b85c3a201705c5d3d2916c7a9ca00a04e44c 12-Sep-2006 Eric Sandeen <esandeen@redhat.com> Fix more rounding overflows for filesystems that have 2**32-1 blocks

Signed-off-by: Eric Sandeen <esandeen@redhat.com>
hangeLog
ass1.c
f335864338a6fbce8134a445ffdd0cdeb3f3f1bc 12-Sep-2006 Eric Sandeen <esandeen@redhat.com> Add checks to make sure inode counts don't overflow a 32-bit value

Signed-off-by: Eric Sandeen <esandeen@redhat.com>
hangeLog
nix.c
abf23439d51a3ddbca475b931abebd381ff7ceea 12-Sep-2006 Eric Sandeen <esandeen@redhat.com> Create new ext2fs library inlines: ext2fs_group_{first,last}_block()

Create new ext2fs library inline functions in order to calculate
the starting and ending blocks in a block group.

Signed-off-by: Eric Sandeen <esandeen@redhat.com>
hangeLog
ass1.c
uper.c
d0ff90d5202428583c78a60c3042e7b60d88bc45 12-Sep-2006 Eric Sandeen <esandeen@redhat.com> Fix signed vs unsigned printf format strings for block and inode numbers

There were still some %d's lurking when we print blocks & inodes; also
many of the counters in the e2fsck_struct were signed, and probably
need to be unsigned to avoid overflows.

Signed-off-by: Eric Sandeen <esandeen@redhat.com>
hangeLog
2fsck.h
mptydir.c
scan.c
nix.c
62c6d1403ea00dd72890862c761a41baa10a7ad4 12-Sep-2006 Eric Sandeen <esandeen@redhat.com> Remove unused variables

Signed-off-by: Eric Sandeen <esandeen@redhat.com>
hangeLog
ass1.c
bb1a46a430a99f73ddaf7cf74e380dd5cf36382f 12-Sep-2006 Eric Sandeen <esandeen@redhat.com> Fix loops over group descriptors to prevent 2**32-1 block number overflows

For loops iterating over all group descriptors, consistently define
first_block and last_block in a way that they are inclusive of the
range, and do not overflow.

Previously on the last block group we did a test of <= first +
dec_blocks; this would actually wrap back to 0 for a total block count
of 2^32-1

Also add handling of last block group which may be smaller.

Signed-off-by: Eric Sandeen <esandeen@redhat.com>
hangeLog
ass1b.c
uper.c
5830d6be9c33e23bb20c339036083e6e4fa6795e 30-Aug-2006 Eric Sandeen <esandeen@redhat.com> Detect overflows in loop counters

For loops such as:

for (i=1; i <= fs->super->s_blocks_count; i++) {
<do_stuff>
}

if i is an int and s_blocks_count is (2^32-1), the condition is never false.
Change these loops to:

for (i=1; i <= fs->super->s_blocks_count && i > 0; i++) {
<do_stuff>
}

to stop the loop when we overflow i

Signed-off-by: Eric Sandeen <esandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass4.c
ass5.c
a3e025c7493b58ec88b775f26a41e4205a6a2c9f 29-Aug-2006 Theodore Ts'o <tytso@mit.edu> Fix silly spelling error in e2fsck

Addresses SourceForge bug: #1531372

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
uper.c
5656612910a9662a9d39054fd91b7482e865cb9a 28-Jun-2006 Andreas Dilger <adilger@clusterfs.com> Minor fix to prevent e2fsck.h being included twice:

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2fsck.h
abcfdfda7a5932cbb27ff243ed962119db2599a4 10-Jun-2006 Matthias Andree <matthias.andree@gmx.de> Read mke2fs.conf and e2fsck.conf from root_sysconfdir rather than harcoded /etc.
nix.c
9e0cbba89b3a7ba9d91d00c163de78a318517504 30-May-2006 Matthias Andree <matthias.andree@gmx.de> Add prototype for e2fsck_write_inode_full.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2fsck.h
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>
ecovery.c
9c07dc00b8ea175aa1446868b5cca5a21b41aecf 29-May-2006 Theodore Ts'o <tytso@mit.edu> Add missing backwards compatibility for ancient Linux systems

This fixes some (but not all) of the compatibility bugs which prevented
e2fsprogs from being compiled on a Linux 2.0.35 system. There are still
some unprotected use of long long's, and apparently some type problems
with the uuid library, but these can be fixed up later.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass1b.c
9447f38a174a5bd5e77e45358ddbddfd5660bdfe 22-May-2006 Theodore Ts'o <tytso@mit.edu> Fix spelling mistakes in e2fsck, mke2fs.conf, and resize2fs man pages

Addresses Debian Bugs: #368392, #368393, #368394

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
2fsck.8.in
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>
hangeLog
ournal.c
ecovery.c
f63978aff759325b542de7134ab659c79dc47496 13-May-2006 Theodore Ts'o <tytso@mit.edu> Fix read/write badblocks testing in mke2fs and e2fsck

The exlcusive device safety check that was added inadvertently broke
e2fsck -cc and mke2fs -cc since e2fsck and mke2fs hold the device
in exclusive access when badblocks is run. So we add a private option
to badblocks, -X, which is passed by e2fsck and mke2fs to badblocks
to indicate that it is OK to skip the EXT2_MF_BUSY checks.

Addresses Debian Bug: #366017

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
adblocks.c
f5fa20078bfc05b554294fe9c5505375d7913e8c 09-May-2006 Theodore Ts'o <tytso@mit.edu> Add support for EXT2_FEATURE_COMPAT_LAZY_BG

This feature is initially intended for testing purposes; it allows an
ext2/ext3 developer to create very large filesystems using sparse files
where most of the block groups are not initialized and so do not require
much disk space. Eventually it could be used as a way of speeding up
mke2fs and e2fsck for large filesystem, but that would be best done by
adding an RO_COMPAT extension to the filesystem to allow the inode table
to be lazily initialized on a per-block basis, instead of being entirely initialized
or entirely unused on a per-blockgroup basis.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass5.c
cd84823aed4c0275741b07aa9f1c72f5e4c6fb1d 27-Mar-2006 Theodore Ts'o <tytso@mit.edu> Add badblocks(8) to SEE ALSO section of e2fsck's man page.

Addresses Debian Bug: #347295

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
2fsck.8.in
1abdba4b64d91b039bda20d76566bba6cd75f3e5 27-Mar-2006 Theodore Ts'o <tytso@mit.edu> Add man page documenting the /etc/e2fsck.conf configuration file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
akefile.in
2fsck.conf.5.in
204ae371ad2e038b41c03aba13d3a57e4e6921ec 22-Mar-2006 Theodore Ts'o <tytso@mit.edu> Tighten up profile parsing code by combining functions

Integrate profile_std_line() into parse_line(), and profile_parse_file()
into profile_update_file() to make the code use less memory.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
rofile.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>
hangeLog
mptydir.c
essage.c
ass1b.c
ass2.c
ecovery.c
nix.c
2e14e0c8cc5bc61ffacd380a981808194e9c7f84 19-Mar-2006 Theodore Ts'o <tytso@mit.edu> Change e2fsck to open non-mounted filesystems in exclusive mode

Thanks to Andreas Dilger for this idea. If the filesystem is not mounted,
e2fsck will open it in exclusive mode to prevent the a confused/careless
system administrator from mounting the filesystem while the filesystem
check is taking place, which could cause all sorts of problems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
nix.c
b1c52b26a44efeb366402985763c242a4b21aeb1 10-Mar-2006 Theodore Ts'o <tytso@mit.edu> Enhance e2fsck so it can fix external journal hint in the superblock

Check to see if the superblock hint for the external journal needs to
be updated, and if so, offer to update it. (Addresses Debian Bug:
#355644)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
2fsck.h
ournal.c
roblem.c
roblem.h
uper.c
26efcacd04766106ad695953694c3d134447144b 09-Mar-2006 Theodore Ts'o <tytso@mit.edu> Remove e2fsck/malloc.h

(This was an artifact of the migration of the sources from BitKeeper
to Mercurial; mea culpa, mea maximum culpa --- Ted)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
alloc.h
a5f37a9b25191421e08bfd909e14b533333cf367 29-Jan-2006 Theodore Ts'o <tytso@mit.edu> Add a config option which controls whether fs checks are skipped when on battery

Whether fs checks are skipped when the system is running on battery can be
controlled by the new e2fsck.conf option defer_check_on_battery (this option
defaults to TRUE).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
nix.c
bc3392c389849f86e1c9abcef4055ad58bf96547 29-Jan-2006 Theodore Ts'o <tytso@mit.edu> Print an explanation when skipping a check due being on battery

On Sat, Jan 28, 2006 at 12:53:33PM -0600, Fredrick Knieper wrote:
> Package: e2fsprogs
> Version: 1.38+1.39-WIP-2005.12.31-1
>
> When running fsck at boot or when running e2fsck manually on a device,
> fsck will not check a filesystem based on the maximum mount count,
> unless a flag such as -f or -c is used to force the filesystem check.

What's happening is that when you run on battery, e2fsck will delay
running the filesystem check, on the assumption that it is better to
defer the check until some time in the future when your laptop is
running on AC mains again. This deferral is not infinite, however; if
the number of mounts exceeds twice the max mount counts, or if the
interval between checks exceeds twice the check interval, e2fsck will
force the check even though you are on battery.

I've changed the sources to print a message to make this more clear.

Addresses Debian Bug: #350306

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
nix.c
22fe674da4bdec2ff1c1abb7ad074df3a641377b 06-Jan-2006 Theodore Ts'o <tytso@mit.edu> Add support for quoted strings in tag and section names

Also changed top-level section name parsing to ignore leading and
trailing whitespace.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
rofile.c
7d922f8bcba93f7d830825cb2e07b3eaee99b994 05-Jan-2006 Theodore Ts'o <tytso@mit.edu> Add support to the profile library for /etc/foo/conf.d style directories

If a directory is passed to profile_init, then read all files which
match [0-9a-zA-Z]* in sort order.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
rofile.c
d673582241d9970e96b56caa0fd79ff95871c39b 05-Jan-2006 Theodore Ts'o <tytso@mit.edu> Fix gcc -Wall warning in profile_helper.c

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
rofile_helpers.c
d45544ca5419e218537f8b9689bbb028abbf8f28 05-Jan-2006 Theodore Ts'o <tytso@mit.edu> More profile cleanups: remove prf_data_t data structure

Eliminate the prf_data_t data structure and fold it back into
prof_file_t. Eschew needless complexity!

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
rofile.c
95a8d1de512f7ae55b78d99db21bb0d5973d115e 05-Jan-2006 Theodore Ts'o <tytso@mit.edu> Enhance profile library's parser to accept comments

This also changes syntax accepted by the profile parser. The value of
profile relations must not contain spaces unless it is quoted;
otherwise the parser will throw an error. Previously something like
this was allowed:

[liboptions]
test = foo bar

Now, the relation must be in double quotes in order to be valid, i.e.,
"foo bar".

Comments are allowed anywhere and can be started with either a ';' or
a '#' character. The only place where comments will not be intepreted
as beginning a comment is in a quoted string.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
rofile.c
f5f14fcfe9eba0282a3dfe5600364bbf797dcfc3 04-Jan-2006 Theodore Ts'o <tytso@mit.edu> Add syntax error reporting to the profile library

E2fsck will now report syntax errors in /etc/e2fsck.conf intead of simply
ignoring the config file when there are errors.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
rofile.c
rofile.h
nix.c
9a4c209cd26a7eae3d1de427d9b028f69e1c2554 03-Jan-2006 Theodore Ts'o <tytso@mit.edu> Simplify profile core functionality

Boil down and simplify profile.c, and move extra functionality that's
not needed into profile_helpers.c

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
akefile.in
rofile.c
rofile.h
rofile_helpers.c
rofile_helpers.h
44dc5f8804b2480764f792315d84977ec9569163 02-Jan-2006 Theodore Ts'o <tytso@mit.edu> Clean up test driver program for profile.c and #ifdef unused static functions

Unified batchmode and command-line handling.

profile_is_node_final() and profile_find_node_relation() are static,
unused functions.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
rofile.c
cec7103d922f89156acf25055a249fad82ed0e7a 02-Jan-2006 Theodore Ts'o <tytso@mit.edu> Fix profile.c so that com_err.h doesn't have to be installed

Fix #include of com_err.h so that it isn't required that the com_err
development environment be installed. (Addresses Debian Bug: #345519)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
rofile.c
8fd98bba213bbcc93e43993aaf41e7dec19a1b61 31-Dec-2005 Theodore Ts'o <tytso@mit.edu> Add e2fsck problem handling to be configurable

Add the ability for the e2fsck configuration file to override the
behaviour of e2fsck when a particular filesystem problem is
encountered. This allows reconnecting an inode to lost+found to not
stop the boot sequence, if a system administrator really badly wants
this behaviour for some specialized reason, for example.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
roblem.c
roblemP.h
5582275fe06d6f4d0679d0a1a28d069769da8b41 31-Dec-2005 Theodore Ts'o <tytso@mit.edu> Slim down profile.c

#ifdef out functions not needed by e2fsck.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
rofile.c
5dd2a6e08d0e65cde6444744a93ed4eb90b400c4 31-Dec-2005 Theodore Ts'o <tytso@mit.edu> Add E2FSCK_CONFIG environment variable

Also, use this environtment variable to make sure that a local
/etc/e2fsck.conf file will not interfere with the regression test
suite.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
nix.c
fd7ac1fc9889075885cd698ddd3287af6457c7be 31-Dec-2005 Theodore Ts'o <tytso@mit.edu> Fix incorrect location of prof_err.h in profile.c.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
akefile.in
rofile.c
eb065ccf181d49cd1a3709bf607c25d07a6322f1 31-Dec-2005 Theodore Ts'o <tytso@mit.edu> Add allow_cancellation config option

If the e2fsck configuration file sets the allow_cancellation option to be
true, then if the filesystem does not have any known problems, and was
known to be cleanly unmounted, then let e2fsck exit with a status code of 0
instead of 32 (FSCK_CANCELED) so that the bootup scripts will continue
without stopping the boot. (Addresses Debian Bug: #150295)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
nix.c
1017f65179f4aa313f699109b471b79f99f38d3d 31-Dec-2005 Theodore Ts'o <tytso@mit.edu> Read in /etc/e2fsck.conf configuration file at startup

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
2fsck.c
2fsck.h
nix.c
2fa9ba98337b07d6acfac52b5ee5dc8116dda866 31-Dec-2005 Theodore Ts'o <tytso@mit.edu> Add the profile library code to e2fsck

The profile library was originally written by Theodore Ts'o in 1995
for use in the MIT Kerberos v5 library. It has been
modified/enhanced/bug-fixed over time by other members of the MIT
Kerberos team. This version was originally taken from the Kerberos
v5 distribution, version 1.4.2, and radically simplified for use in
e2fsprogs. (Support for locking for multi-threaded operations,
being able to modify and update the configuration file
programmatically, and Mac/Windows portability have been removed.
It has been folded into a single C source file to make it easier to
fold into an application program.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
akefile.in
rgv_parse.c
rgv_parse.h
rof_err.et
rofile.c
rofile.h
311df05c5e89b0ea447fdbb08a4302f05e2fe664 19-Dec-2005 Theodore Ts'o <tytso@mit.edu> Automatically fix superblock times in the future

If the superblock last mount time or last write time is in the future, fix
this automatically if e2fsck is in preeen mode, since Debian's boot sequence
bogusly doesn't set the time correctly until potentially very late in the bootup
process, and this can cause false positives that will cause users' systems
to fail to booting. (Addresses Debian Bugs #343662 and #343645)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
roblem.c
bba44f956e4ddb81dbc444d1f973603a69d2d3fa 10-Dec-2005 Theodore Ts'o <tytso@mit.edu> Clarify the e2fsck man page regarding the -c option

A user was confused about whether or not e2fsck -c performed a destructive
test on the filesystem, since it stated that -cc resulted in a non-destructive
read/write test. Clarify that -c does a read/only test.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
2fsck.8.in
ae1182cb8442c73e561290fbf79fd52346703987 10-Dec-2005 Theodore Ts'o <tytso@mit.edu> Make e2fsck -cc warn on a read-only root filesystem

Don't let the user run e2fsck -ccn on the root partition, without warning
that he or she might be doing something Really Stupid.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
nix.c
f4b6d2a039fd443f1f2373f071ca281eb3029018 09-Dec-2005 Theodore Ts'o <tytso@mit.edu> Fix typo in e2fsck error message.

Thanks to Solar Designer for pointing out the missing preposition.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
nix.c
84d3518bb9e5e601aeda19c79c02b669615a886b 09-Dec-2005 Theodore Ts'o <tytso@mit.edu> Clarify description of the -p, -n, and -y options in the e2fsck man page.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
2fsck.8.in
8dceb92407f751d1a8aecd4bfb36d1fe2dc3cf9a 25-Sep-2005 Theodore Ts'o <tytso@mit.edu> E2fsck: fix future times in the superblock's last mount or last write fields

Detect if the superblock's last mount field or last write field is in
the future, and offer to fix if so. (Addresses Debian Bug #327580)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ournal.c
roblem.c
roblem.h
uper.c
nix.c
b28a6e96af53338c303e0f25e28ea02705a1d680 25-Jul-2005 Theodore Ts'o <tytso@mit.edu> Fix use-after-free bug of e2fsck context structure.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
nix.c
274315957221e81be28fd0c2265dc553207f9a3b 25-Jul-2005 Theodore Ts'o <tytso@mit.edu> Fix false positives from valgrind: memcpy via no-op structure copy

Don't do a structure copy via an assignment in e2fsck's pass #1 when
it is a no-op in order to avoid false positives from valgrind.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
hangeLog
ass1.c
49809dd86379d0c68ee33de0a74dd76e6e6ec133 04-Jul-2005 Theodore Ts'o <tytso@mit.edu> Make e2fsck Pass 1C header consistent with the other headers

Removed the period from the Pass 1C header to make it consistent with
the other e2fsck pass headers.
hangeLog
roblem.c
f76344fb6f9439ecd5060943930e73cd3b3dd9fe 04-Jul-2005 Theodore Ts'o <tytso@mit.edu> [BUGFIX]: E2fsck will segfault on disconnected inode with extended attribute(s)

This was actually caused by two bugs. The first bug is that if the
inode has been fully fixed up, the code will attempt to remove the
inode from the inode_bad_map without checking to see if this bitmap is
present. Since it is cleared at the end of pass 2, if
e2fsck_process_bad_inode is called in pass 4 (as it is for
disconnected inodes), this would result in a core dump.

The first bug was mostly hidden by a second bug, which caused
e2fsck_process_bad_inode() to consider all inodes without an extended
attribute to be not fixed.

Note: This bug was introduced in e2fsprogs 1.36.

(Addresses Debian Bug: #316736)
hangeLog
ass2.c
1f965c8d961ec88a8917b2e99cfb43c4ccdfb19b 01-Jul-2005 Theodore Ts'o <tytso@mit.edu> Update for e2fsprogs 1.38 release.
hangeLog
5327bb499ad3f92a388f7f1281d511c94890c4fb 27-Jun-2005 Theodore Ts'o <tytso@mit.edu> Update typos in changelog
hangeLog
bb145b01cf5fd27d9afe03c3262d0e1a326e7ec1 20-Jun-2005 Theodore Ts'o <tytso@mit.edu> Fix e2fsprogs messages for grammar and consistency, based on suggestions
from Benno Schulenberg.

Add missing _() so all strings can be internationalized.
hangeLog
nix.c
5fb86b425efb686fc13c557ed7c7cc4a333a1ffb 20-Jun-2005 Theodore Ts'o <tytso@mit.edu> Fix minor typo introduced in e2fsck man page.
2fsck.8.in
73d1d49ac192214cc07356a28d13c84356eaebd1 20-Jun-2005 Theodore Ts'o <tytso@mit.edu> Make the e2fsck man page clear that the -c, -l, and -L options are
never safe to use on a mounted filesystem, and in general, running
e2fsck on mounted filesystems is a bad idea.
hangeLog
2fsck.8.in
7ae1983a2393efb92d1f6e523266aa61cfbef40f 19-Jun-2005 Theodore Ts'o <tytso@mit.edu> Clean up e2fsck problem description messages for typo's and to make them
easier to understand (sorry, translators).

Add new @m (multiply-claimed) and @n (invalid) expansions for e2fsck
problem descriptions.

Add Dutch translation, and update French translation.

Add an explanation of how the @-expansion and %-exapansion works in
e2fsck/problem.c to make life easier for the translators.

Synchronize and update po files.
hangeLog
essage.c
roblem.c
15f5051e390bfb5a9e64d01b26a52fad43514652 05-Jun-2005 Theodore Ts'o <tytso@mit.edu> Fix a minor spelling typo in blkid's man page, and update e2fsck's REPORTING
BUGS section to request that e2fsck's messages printed in English, and to
send a raw e2image filesystem dump if possible.
hangeLog
2fsck.8.in
75e93ab0975f042edc25dde6f5d9496360207a94 06-May-2005 Theodore Ts'o <tytso@mit.edu> Update "make depend" information. Fixes SMP parallel build problem.
(Addresses Sourceforge Bug: #1157933)
akefile.in
f37ab68a26bacf4f5cc7643b8373e40292b7682a 06-May-2005 Theodore Ts'o <tytso@mit.edu> Corrects a few mistakes in the fsck man page, wraps two overlong lines,
and changes "bad" to "invalid" in some messages to avoid confusion with
"bad blocks" in the e2fsck, mke2fs, and badblocks programs. Thanks to
Benno Schulenberg. (Addresses Sourceforge Bug: #1189803)
hangeLog
adblocks.c
8139367bbde5f56a3febbdaa9205796a88310847 16-Apr-2005 Theodore Ts'o <tytso@mit.edu> Fix spelling mistakes in man pages. (Addresses Debian Bugs: #304591,
#304592, #304594, #304597, #304593)
hangeLog
2fsck.8.in
5e91614349797fc51c8fbd3b8abbf22c5360baec 14-Apr-2005 Theodore Ts'o <tytso@mit.edu> Don't offer to update or clone the resize inode when e2fsck deals with
multiply claimed blocks.
hangeLog
ass1b.c
1f3ad14a5ad5df3ac4012d41ef5d76411cd8fff3 14-Apr-2005 Theodore Ts'o <tytso@mit.edu> Use a centrally stored current time for "now" which
can be overridden using the E2FSCK_TIME environment
variable, for better reproducibility for regression tests.
hangeLog
2fsck.c
2fsck.h
ournal.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
uper.c
nix.c
4147d9f02959a1358080762679420344c7574fde 06-Apr-2005 Theodore Ts'o <tytso@mit.edu> pass1.c (e2fsck_pass1): If the superblock last mount time (not
just the last write time) looks insane, then assume that
we can't do the LOW_DTIME checks.
hangeLog
ass1.c
fd4b28efd311e58811fcb652af003197d019ae29 22-Mar-2005 Theodore Ts'o <tytso@mit.edu> Update for the e2fsprogs 1.37 release.
hangeLog
cebe48a1ece8b9f61271c73ead83b59c8b36233e 21-Mar-2005 Theodore Ts'o <tytso@mit.edu> Integrate code from Alex Thomas at Clusterfs to check extended attributes
stored in inodes into e2fsck.

There are a number of bug fixes and enhancements over the original lustre fsck
BK repository. The biggest one is that this extended attribute values must
be aligned on 4-byte boundaries.
hangeLog
essage.c
ass1.c
roblem.c
roblem.h
til.c
89db86d33c634374a3f6e15f943ab83cdc5bd93a 21-Mar-2005 Theodore Ts'o <tytso@mit.edu> Make e2fsck check the superblock's inode_size to make sure it is
sane before we start depending on it!
hangeLog
uper.c
030970ed750b6a169c32ffb8b19bce3150198629 21-Mar-2005 Theodore Ts'o <tytso@mit.edu> Fix e2fsck, debugfs, and the ext2fs_mkdir function so that when we create
a new inode we make sure that the extra information in the inode (any extra
fields in a large inode and any ea-in-inode information) is cleared. This
can happen when e2fsck creates a new root inode or a new lost+found directory,
or when the user uses the debugfs write, mknod, or mkdir commands. Otherwise,
the newly create inode could inherit garbage (or old EA information) from
a previously deleted inode.
hangeLog
ass3.c
dc71f23e634724f6571a556e6c6ec26d0e882211 20-Mar-2005 Theodore Ts'o <tytso@mit.edu> Fix bug in e2fsck where we don't notice if a file with an extended
attribute block is so big that i_blocks wraps to zero.
hangeLog
ass1.c
3eee5e9eed61ab6f635f4e0c236e999564a73b77 06-Feb-2005 Theodore Ts'o <tytso@mit.edu> Update for release of e2fsprogs 1.36.
hangeLog
33db8f80f2b5c5c5d8cd5068205c79f0ea11905b 05-Feb-2005 Theodore Ts'o <tytso@mit.edu> Remove support for --enable-clear-htree; this was
only needed during the early development of the htree patch.
hangeLog
ass2.c
roblem.c
roblem.h
a894eb47952040cd48da125f3cfd1aa8e3f925a1 28-Jan-2005 Theodore Ts'o <tytso@mit.edu> pass2.c (e2fsck_process_bad_inode): Fix a corner case involving
big-endian systems, long symlinks and i_file_acl set when
it shouldn't be. Without this bugfix, f_clear_xattr will
fail on big-endian machines.
hangeLog
ass2.c
ea774315631accb05e2407765c6b448d648d14d6 28-Jan-2005 Theodore Ts'o <tytso@mit.edu> Fix two bugs found by the regression test suites. The bug was created when
we changed ext2fs_create_resize_inode to always create the resize inode,
even when s_reserved_gdt_blocks is zero. Mke2fs and e2fsck was calling
ext2fs_create_resize_inode() unconditionally, and depending on
s_reserved_gdt_blocks to be zero, instead of explicitly checking the
resize_inode feature.
hangeLog
uper.c
7e0282c5f21add344b306876ca999aecd4d5fd0c 28-Jan-2005 Theodore Ts'o <tytso@mit.edu> Fixed missing not_fixed branch in e2fsck so that if the frag size field in
the inode is not fixed, the inode_bad_map bitmap won't be cleared. Thanks to
Stephen Tweedie for pointing this out.
ass2.c
d4dc0a9e29f9e50a46840bc130c6a816c4c7faa5 28-Jan-2005 Theodore Ts'o <tytso@mit.edu> Create the resize inode is created even if the s_reserved_gdt_blocks is
zero; e2fsck will now complain and recreate the resize inode if i_links_count
is zero or if it is not a regular file.
hangeLog
uper.c
5780ead245fec02b83a18e0e12835732acdb64b1 28-Jan-2005 Theodore Ts'o <tytso@mit.edu> Cset exclude: tytso@think.thunk.org|ChangeSet|20050123214956|52665
hangeLog
uper.c
6c313fd4732adbb83d6f9c402300487b6a7e84bb 27-Jan-2005 Theodore Ts'o <tytso@mit.edu> Fix e2fsck to not delete symlinks that contain an extended attribute after
the ext_attr feature flag has been cleared. (Addresses Red Hat Bugzilla
#146284)
hangeLog
ass2.c
550a4afa24be35976edffe578555de30e06c456a 25-Jan-2005 Theodore Ts'o <tytso@mit.edu> E2fsck will now check the individual block group inode and block free counts,
as well as the filesystem-wide inode and block free counts. If any of the
free counts is too large, force a full filesystem check. (Addresses
Debian Bug #291571)
hangeLog
uper.c
nix.c
2d096010069cc7caae16ce21357668c53fe8e1c5 23-Jan-2005 Theodore Ts'o <tytso@mit.edu> Fix e2fsck so that it does not complain if the resize_inode feature is
enabled, but s_reserved_gdt_blocks is zero and there is no double indirect
block in the resize inode. If there are no blocks reserved for on-line
expansion, there is no need for the DIND block to be allocated in the resize
inode.
hangeLog
uper.c
9214dccbfb39a72bd406f8476e5c7e87ea1a815e 19-Jan-2005 Theodore Ts'o <tytso@mit.edu> Miscellaneous gcc -Wall cleanups. Use fixed rather than floating point
math to avoid rounding issues.
hangeLog
nix.c
ecd0d8fe2a5948d9676e3c4e3a7bd0569322b056 17-Jan-2005 Theodore Ts'o <tytso@mit.edu> Clean up Matthais's "fix crash when /proc/acpi/ac_acapter is not present"
patch.
nix.c
4b13704cbec7249ba223608143026142b8729318 13-Jan-2005 Matthias Andree <matthias.andree@gmx.de> Fix crash when /proc/acpi/ac_adapter/ is not present, for instance,
on pre-ACPI and non-Linux systems.
hangeLog
nix.c
d2ee56d86eec86acec055f235dab8f1b6569a360 09-Jan-2005 Theodore Ts'o <tytso@mit.edu> Fix configure.in to use AC_CHECK_TYPES instead of the "broken by design"
autoconf 2.13 version of AC_CHECK_TYPE. Otherwise, on some platforms
intptr_t might get erroneously #define'd to be long. (Addresses
Debian Bug #289133)
hangeLog
ass1b.c
22ba4c1dedd61cef3f4e821a0bcfbceccc571a0f 06-Jan-2005 Theodore Ts'o <tytso@mit.edu> Make tune2fs and e2fsck consistent about allowing at most 50% of the blocks
in a filesystem to be reserved for allocation by the root user.
hangeLog
uper.c
dc8ce3463791366ac844d3f0436709511fa09c49 06-Jan-2005 Theodore Ts'o <tytso@mit.edu> Fix resize inode handling on big endian systems, by adding new routines
that read/write indirect blocks, byte swapping them if necessary.
hangeLog
uper.c
c3ffaf833b7ddb3c1d422c71f59e1623029ede0c 24-Dec-2004 Theodore Ts'o <tytso@mit.edu> Add support to detect corrupted resize_inode's to e2fsck.
hangeLog
2fsck.h
ass1.c
roblem.c
roblem.h
uper.c
71669d0541f0d3db64792c60a28abddba78382e2 24-Dec-2004 Theodore Ts'o <tytso@mit.edu> Avoid some potential inode cache coherency problem caused by using the
byte-swapping options to e2fsck. This was the cause of some hard to
reproduce problems that had been reported in the past, and which the
resize_inode changes tickled in a much more repeatable fashion.
hangeLog
wapfs.c
e75cfc5da83c749be43f87c0ccf5ec1f1dd26e2c 17-Dec-2004 Theodore Ts'o <tytso@mit.edu> Fix e2fsck so that it will clean up filesystesm that have the
resize_inode capability disabled, but which still have the
s_reserved_gdt_blocks field set in the superblock, or which
still have blocks in the inode #7 (the resize inode).
hangeLog
roblem.c
roblem.h
uper.c
22c6821a2495b0bf340dd3c277713bb1bee01144 15-Dec-2004 Theodore Ts'o <tytso@mit.edu> Supplied changelog for resize inode patch.
hangeLog
d323f8fb369089b97d6f3bf0f8d64ceeab0b10f5 15-Dec-2004 Theodore Ts'o <tytso@mit.edu> Add support for on-line resizing ala the resize inode. This patch
is taken from Fedora Core 3's e2fsprogs 1.35-11.2.src.rpm's
e2fsprogs-resize.patch.
ass1.c
acb79d9d19737cdd3c64bfd83c101fdeed47766e 15-Dec-2004 Theodore Ts'o <tytso@mit.edu> Fix stupid core dumping bug if the TZ environment variable isn't set.
essage.c
522798d3428807800d8471f5ac3050b82aa9de97 15-Dec-2004 Theodore Ts'o <tytso@mit.edu> Add install-strip and install-shlibs-strip targets

Use Linux-kernel-style makefile output for "make install"

Update intl/Makefile.in to version from gettext 0.14.1
hangeLog
akefile.in
6d4022786dc43e66f0699a72925b946b9d2e4439 15-Dec-2004 Theodore Ts'o <tytso@mit.edu> Use MKINSTALLDIRS macro so that the Makefiles can find the script
correctly.

Update Makefile dependencies.

Update "make depend" production so that it filters out comments
inserted by newer gcc compilers.

Remove sync from e2fsck's "make all" target.
hangeLog
akefile.in
8ff1a86005121edcbf04cfaf8f0812591cb916c6 01-Dec-2004 Theodore Ts'o <tytso@mit.edu> If the TZ environment variable is set to GMT, use gmtime()
instead of localtime() or ctime() to force the use of GMT.
This is because the dietlibc doesn't honor the TZ environment
variable.
hangeLog
essage.c
2e8ca9a26b0bd7dae546a3f9a98df67b043fe3be 30-Nov-2004 Theodore Ts'o <tytso@mit.edu> Add support for passing options to the io layer using the URL syntax. For
example, /tmp/test.img?offset=1024. Multiple options can separated using
the & character, although at the moment the only option implemented is
the offset option in the unix_io layer.
hangeLog
2fsck.h
nix.c
47204ff9830b17fc6317f48e88d2039f57a5d10a 30-Nov-2004 Theodore Ts'o <tytso@mit.edu> Use Linux-kernel-style makefile output to make it easier to
see errors/warnings.
hangeLog
akefile.in
6e4fbbeb500d6aa7aaa193f689356c487d461ede 04-Oct-2004 Richard Mortimer <richm@oldelvet.org.uk> Attempt recovery if the journal contains illegal blocks
hangeLog
ournal.c
8421fb67f26ce99e5a13735067ea2745b1695df7 27-Jul-2004 Theodore Ts'o <tytso@mit.edu> pass1.c (process_block): Change the limit of directory size from
32 MB to 2GB.
hangeLog
ass1.c
93effaa456e490c6dfff08287c8f5c652cac8469 27-May-2004 Theodore Ts'o <tytso@mit.edu> Fixed potential ordering constraint problem in e2fsck's journal
recovery code by implementing the sync_blockdev function. Thanks to
Junfeng Yang from the Stanford Metacompilation group for pointing this
out.
hangeLog
fs_user.h
ournal.c
aa5c0a4562fd9f991557311e400cc93972bbea3e 05-May-2004 Theodore Ts'o <tytso@mit.edu> Remove .cvsignore files; they were out of date, and causes lintian
to flame about their presence in the source tarball.
cvsignore
66fbee8cbbe88e5e14ea98a67c220e6f8ff5deba 05-May-2004 Theodore Ts'o <tytso@mit.edu> unix.c (check_if_skip): If the checkinterval is zero, then
disregard it when calculating when the next check will
take place by e2fsck.
hangeLog
nix.c
c07f9f26392ac006a986d4c7488719000614ca64 12-Apr-2004 Theodore Ts'o <tytso@mit.edu> In e2fsck, when trying to determine if the system is running on
battery, be more flexible about the name of the ACPI device that
corresponds to the AC adapter. (Addresses Debian bug #242136)
hangeLog
nix.c
dd60705665b916c9f67c3bbf86aa6bb620a14ecd 03-Apr-2004 Theodore Ts'o <tytso@mit.edu> Refine the build process to avoid re-running subst all the time on
some generated files, by having subst update the modtime on these
files even when the generated file hasn't changed. We do this with
generated files that do not have any downstream dependencies.
hangeLog
akefile.in
83e692e88bf2d01edb089010bdfc07b7dcc78642 30-Mar-2004 Matthias Andree <matthias.andree@gmx.de> unix_io.c, pass1.c:
int -> unsigned for 1 bit wide bitfields - we cannot have a value and a sign in 1 bit.
Fixes some of the Intel C++ 8.0 warnings (-w1 level).
ass1.c
b70b1167fec6d90771344d8560a1fc1b8731b9a9 28-Feb-2004 Theodore Ts'o <tytso@mit.edu> Update version number for e2fsprogs 1.35 release.
hangeLog
bc69f82db85cd99d4f34fb9c8b75174b304973f8 27-Feb-2004 Theodore Ts'o <tytso@mit.edu> Add missing break statement so e2fsck -k actually works.
(Addresses Debian Bug #234993)
nix.c
4fb9d52ba616619be3d03847f8ccc33e954aa055 24-Feb-2004 Theodore Ts'o <tytso@mit.edu> unix.c (main, PRS), e2fsck.8.in: Add a new -k option which keeps
the existing badblocks list when using the -c option.
(Addresses Debian bug #229103)
hangeLog
2fsck.8.in
nix.c
ed52f62bbdb013800e3951bff37631af6f51b3aa 24-Feb-2004 Theodore Ts'o <tytso@mit.edu> Makefile.in (PROFILED_LIBS, PROFILED_DEPLIBS): Fix reference to
libblkid so that the build will work with --enable-profile
(Addresses Sourceforge bug #811408)
hangeLog
akefile.in
151786fc556930246a9d3b3db73c956c786891a1 22-Feb-2004 Theodore Ts'o <tytso@mit.edu> Fix up preen mode messages during pass 1B/C/D.
ass1b.c
roblem.c
bbbc92f2eda2d2bcdb71f55eb4a36bb86bcffb7b 22-Feb-2004 Theodore Ts'o <tytso@mit.edu> e2fsck.c (e2fsck_run): Clear the SETJMP_OK flag when returning
so we don't double longjump into an invalid stack frame.
(Thanks to Matthias Andree for providing this fix.)
hangeLog
2fsck.c
489f00248f19fdb61d5c71ca57c4c26b1e451597 01-Feb-2004 Theodore Ts'o <tytso@mit.edu> problem.c (fix_problem): Don't call print_e2fsck_message if the
message is empty; otherwise, the NLS substitution will
print the .po header, which is Just Wrong.
hangeLog
roblem.c
1ba7a2f2b6a9b152828a06443955a7fb1d139930 30-Jan-2004 Theodore Ts'o <tytso@mit.edu> Fix a byte swap bugs, including one which caused e2fsck to
incorrectly treat as valid symlinks created with SE Linux
(Debian bug #228723) as well as failing the f_journal test case on
big endian systems due to the backup journal blocks not being swapped.
hangeLog
ass2.c
b34cbddbd66baedc163d36dd281b63ef478f547a 28-Dec-2003 Matthias Andree <matthias.andree@gmx.de> Re-add FreeBSD support.
Tested on FreeBSD 5.2-CURRENT as of 2003-12-28.
Tested on FreeBSD 4.9-STABLE as of 2003-12-27.
ournal.c
b969b1b8a5c13992cadb026114731958644540d8 28-Dec-2003 Matthias Andree <matthias.andree@gmx.de> Fix more compiler warnings.
ournal.c
ass1.c
ass2.c
2e5fcce05ea583c480b28bf3b1f2aa427a3dcc07 12-Dec-2003 Theodore Ts'o <tytso@mit.edu> Fix bug in e2fsck: When reconnecting a directory, we may
need to create a lost+found directory. This may
invalidate our pointer to the directory information, so we
must look it up again after calling
e2fsck_reconnect_file(). (Addresses Debian bug #219640).
hangeLog
ass3.c
6c7d61da00f10aa228d1da5bcc10ce1d4c044014 11-Dec-2003 Theodore Ts'o <tytso@mit.edu> e2fsck.h (E2F_FLAG_RESTARTED): Assign a unique flag bitfield to
E2F_FLAG_RESTARTED. This fixes a bug where if the user
specifies an alternate superblock, and the journal needs
to be replayed, e2fsck would erroneously assume that
journal had been run already without clearing the
NEEDS_RECOVERY flag, and bomb out with an error.
hangeLog
2fsck.h
544349270e4c74a6feb971123884a8cf5052a7ee 07-Dec-2003 Theodore Ts'o <tytso@mit.edu> Fix gcc -Wall nitpicks
hangeLog
adblocks.c
ict.c
a_refcount.c
handler.c
ournal.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass5.c
roblem.c
ehash.c
uper.c
wapfs.c
nix.c
til.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.
hangeLog
fs_user.h
ecovery.c
3ddf2f662eaccf2376dd99c65a2fe93fcf75c3e7 02-Dec-2003 Theodore Ts'o <tytso@mit.edu> When testing a disk using e2fsck -c, use the list
of new bad blocks to replace the current list of bad
blocks. This way "e2fsck -c" can be used to recover from
a corrupted bad block inode.
hangeLog
adblocks.c
2fsck.h
nix.c
015b03df7d2bae2c8dc1db31b8159ea896ccfc37 21-Nov-2003 Theodore Ts'o <tytso@mit.edu> In e2fsck, given an extra grace period before actually forcing
a filesystem check if a laptop system reports it is running on
battery. This way the laptop will be biased to waiting until
it is on AC power before doing a filesystem check. (Addresses
Debian bug #205177)
hangeLog
nix.c
6de289cb103b1fff1a5f1f253da73612aa8429c9 21-Nov-2003 Theodore Ts'o <tytso@mit.edu> In e2fsck, if the number of mounts until the next forced filesystem
check is 5 or less, mention this to the user. (Addresses
Debian bug #157194)
hangeLog
nix.c
000ba4046fbcc11ff70ef840988854d82235e5b5 21-Nov-2003 Theodore Ts'o <tytso@mit.edu> pass1.c (e2fsck_pass1), problem.h (PR_1_BB_FS_BLOCK),
problem.c (PR_1_BB_FS_BLOCK, PR_1_BBINODE_BAD_METABLOCK_PROMPT):
Fix up the handling of corrupted indirect blocks in the
bad block. We now correctly handle the case where there
is an overlap between a block group descriptor or
a superblock and a bad block indirect block. In the case
where the indirect block is corrupted, we now suggest
"e2fsck -c".
hangeLog
ass1.c
roblem.c
roblem.h
817e49e3ce0a70252113438440fc12607140d032 21-Nov-2003 Theodore Ts'o <tytso@mit.edu> Check the returned name from blkid_get_devname in tune2fs and
e2fsck, and print an error if the requested LABEL/UUID does
not exist (previously, we core dumped!)
hangeLog
nix.c
ef344e13d2125e9dae3764b98f9fe3a170cd79e2 21-Nov-2003 Theodore Ts'o <tytso@mit.edu> Centeralize calculation of which blocks are reserved/used for
the superblock and block group descriptors into two functions:
ext2fs_reserve_super_and_bgd, found in lib/ext2fs/alloc_sb.c, and
ext2fs_super_and_bgd_lock, found in lib/ext2fs/close.c.

Change e2fsck/pass1.c (mark_table_blocks), lib/ext2fs/closefs.c
(ext2fs_flush), lib/ext2fs/initialize.c (ext2fs_initialize),
and misc/dumpe2fs.c (list_desc) to use these functions.

e2fsck/ChangeLog
pass1.c (mark_table_blocks): Use the new function
ext2fs_reserve_super_and_bgd to calculate the blocks to be
reserved.

lib/ext2fs/ChangeLog
closefs.c (ext2fs_super_and_bgd_loc): New function which
centralizes the calculation of the superblock and block
group descriptors.
(ext2fs_flush): Use ext2fs_super_and_bgd_lock to figure
out where to write the superblock and block group
descriptors.

alloc_sb.c (ext2fs_reserve_super_and_bgd): New function which
reserves space in the block bitmap using
ext2fs_super_and_bgd_loc.

initialize.c (ext2fs_initialize): Use
ext2fs_reserve_super_and_bgd to initialize the block bitmap.

misc/ChangeLog
dumpe2fs.c (list_desc): Use ext2fs_super_and_bgd_loc to
determine the locations of the superblock and block group
descriptors.
hangeLog
ass1.c
557ddb2fdf46c055d80c66267c8c83299527c8d1 25-Aug-2003 Theodore Ts'o <tytso@mit.edu> util.c (get_backup_sb): Check to make sure the context is passed
in non-NULL before trying to dereference it. Otherwise we
might core dump when called to expand %S in a problem
description.
hangeLog
til.c
a7ac1df34fbed4c852d3227344e3dd0a69583013 24-Aug-2003 Theodore Ts'o <tytso@mit.edu> Adjust description line so that apropos "ext2" or "ext3" will
find all of the e2fsprogs man pages. (Addresses Debian Bug #206845)
hangeLog
2fsck.8.in
27479eb2270c344a0042b4c492337b67a547c393 21-Aug-2003 Theodore Ts'o <tytso@mit.edu> journal.c (e2fsck_move_ext3_journal): When moving the journal or
backing up the journal inode, make sure it gets written to
all the superblocks.
hangeLog
ournal.c
a435ec3449694a8fa299337197cc09624960a3a6 21-Aug-2003 Theodore Ts'o <tytso@mit.edu> Add support for backing up the journal inode location in the
superblock. E2fsck will automatically save the journal information
in the superblock if it is not there already, and will use it if the
journal inode appears to be corrupted. ext2fs_add_journal_inode()
will also save the backup information, so that new filesystems
created by mke2fs and filesystems that have journals added via
tune2fs will also have journal location written to the superblock as
well. Debugfs's logdump command has been enhanced so that it can
use the journal information in the superblock.

The debugfs man page has been improved to more fully describe the
logdump command.

Added two new functions, ext2fs_file_open2() and
ext2fs_inode_io_intern2() which take a pointer to an inode structure;
this is needed so that e2fsck and debugfs can synthesize a
fake journal inode and use it to access the journal.
hangeLog
ournal.c
roblem.c
roblem.h
54a31a3b2e432c124aa03442f2983c4f4d4a974c 19-Aug-2003 Theodore Ts'o <tytso@mit.edu> e2fsck.h, unix.c (PRS, e2fsck_clear_progbar,
e2fsck_simple_progress): Don't print the ^A and ^B
characters which bracket the progress bar when the e2fsck
program is talking directly to a tty, but only when it is
being piped to another program. (Addresses Debian bug
#204137)
unix.c: Move some initialized variables to the BSS segment to
shrink the size of the e2fsck executable.
hangeLog
2fsck.h
nix.c
0c193f82040f86b829143f4b24eaedaab72a0e10 01-Aug-2003 Theodore Ts'o <tytso@mit.edu> Include inttypes.h if present. New macros INT_TO_VOIDPTR and
VOIDPTR_TO_INT. Use them throughout for int<->void *
casts to fix 64-bit warnings.
hangeLog
ass1b.c
c4e3d3f374b409500e3dd05c0b0eca6ac98a6b4e 01-Aug-2003 Theodore Ts'o <tytso@mit.edu> ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem()
all now take a 'void *' instead of a 'void **' in order to
avoid pointer aliasing problems with GCC 3.x.
hangeLog
irinfo.c
x_dirinfo.c
2fsck.c
a_refcount.c
ournal.c
essage.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
uper.c
wapfs.c
9c7ec178092d6d5be005406c2912ea6e59a996b5 26-Jul-2003 Theodore Ts'o <tytso@mit.edu> Update for 1.34 release.
hangeLog
48e6e81362f264aee4f3945c14928efaf71a06c9 06-Jul-2003 Theodore Ts'o <tytso@mit.edu> Fixx gcc -Wall nitpicks.
hangeLog
ict.c
ict.h
ass2.c
d3128ccb06b4fa75e642376f381ff822237b46dc 25-Jun-2003 Theodore Ts'o <tytso@mit.edu> Fix spelling error in e2fsck problem reporting.
hangeLog
roblem.c
113e405bb668efaaea523c9c4b5247c3df98e3be 18-May-2003 Theodore Ts'o <tytso@mit.edu> unix.c (show_stats), e2fsck.h: Use ngettext (abbreivated with
the macro P_(str1, str2, n)) to simplify the statistics
reporting.
hangeLog
2fsck.h
nix.c
2a29f1354f793557fa1829c9e85e74586e2907db 05-May-2003 Theodore Ts'o <tytso@mit.edu> Add --enable-test-io-debug configure option which causes e2fsck and
tune2fs to use the test I/O manager.

The test I/O manager has been changed to not do anything extra by
default, unless the TEST_IO_FLAGS and/or TEST_IO_BLOCK environment
variables are set, which controls what I/O operations are logged and
a block number to watch, respectively. The log messages are sent to
stderr by default, unless a filename is specified via the
TEST_IO_LOGFILE environment variable.
hangeLog
nix.c
ddc32a045bd3bd35968ace2dbe22179470baec0b 04-May-2003 Theodore Ts'o <tytso@mit.edu> Add Czech translation.

Remove "NYC" translation. Add Czech translation from Miloslav
Trmac <mitr@volny.cz>

Random NLS and other display fixes from Miloslav.
hangeLog
roblem.c
nix.c
a04eba3f8868af1d9b7b504d3d430c55ed3dc777 03-May-2003 Theodore Ts'o <tytso@mit.edu> Update to gettext 0.11.5. We now enable NLS support by default.

Fixed up support for using the internal intl library.
hangeLog
akefile.in
2fsck.h
6177c41f99a34b5e4f84a17ca742724d211a0ca8 27-Apr-2003 Theodore Ts'o <tytso@mit.edu> Fixed NLS support for message abbreviations in e2fsck.
hangeLog
essage.c
71df0dc393f959277ed985f9d1e6313df9ff9c0a 21-Apr-2003 Theodore Ts'o <tytso@mit.edu> Update for 1.33 release.

Fix typo's in README.subset

Change debian control file so it doesn't bomb out if the EVMS FSIM
is not there, since it is not built on the Hurd. Resolves Debian
bug #189687.
hangeLog
520ead378ec5ddef828a8d206434cc3a444b2e9e 19-Apr-2003 Theodore Ts'o <tytso@mit.edu> Fix gcc -Wall warnings.
hangeLog
2fsck.h
ass2.c
ehash.c
nix.c
12dd69f5ff95517037736f39104262d720d1edee 18-Apr-2003 Theodore Ts'o <tytso@mit.edu> e2fsck/rehash.c (name_cmp): Sort the deleted inodes to the end
of the list, for portability to systems that whose qsort
does not perform a stable sort.
hangeLog
ehash.c
908b785c3f8e1f9dcfcb7b39e5e879d98e36a2ad 16-Apr-2003 Theodore Ts'o <tytso@mit.edu> Use setvbuf instead of setbuf to force stdout and
stderr to be non-buffered when the stdout/stderr are a pipe.
This fixes a cosmetic problem when using e2fsck under logsave.
hangeLog
nix.c
bc34d6be65cb93a65451ad209cfea2f98b03fd22 16-Apr-2003 Theodore Ts'o <tytso@mit.edu> * Add support for the -a and -s options to logsave.
* Change e2fsck to bracket its progress bar output with ctrl-A and ctrl-B
characters, so that logsave -s can omit writing the progress bar output
to the log file.
hangeLog
nix.c
16fa86b9c5618d72ab88918ac3a3e2af95290628 15-Apr-2003 Theodore Ts'o <tytso@mit.edu> Remove the debian-special legal permission notes.
lushb.c
fff45483ede7fe38a31b3364a9c07e2418776dee 13-Apr-2003 Theodore Ts'o <tytso@mit.edu> Add portability enhancements for Cygwin32 environment.
hangeLog
nix.c
2a77a784a327835dbf0c8aa92978f201e44fbc26 06-Apr-2003 Theodore Ts'o <tytso@mit.edu> E2fsck now updates the global free block and
inode counters from the block group specific counters
quietly. This is needed for an experimental patch which
eliminates locking the entire filesystem when allocating
blocks or inodes; if the filesystem is not unmounted
cleanly, the global counts may not be accurate.
hangeLog
uper.c
aa75ecccab67ea7428fc19c66e80a28fb1ca941f 17-Mar-2003 Theodore Ts'o <tytso@mit.edu> Fix the Apple Darwin port.
hangeLog
til.c
6cca7ba96d5433c25f11c9ce06f3cc5449c8f61c 17-Mar-2003 Theodore Ts'o <tytso@mit.edu> Update dependency information in Makefiles
akefile.in
1d2eef4227f165789a8a39d904542a1865a88283 15-Mar-2003 Theodore Ts'o <tytso@mit.edu> rehash.c (e2fsck_rehash_dir): If user specified the -n option,
skip trying to write out directory.
(e2fsck_rehash_directories): Fix the percentage
calculation in the progress bar.
hangeLog
ehash.c
52734dc532c970b07de7a33d761a44f322bc51f3 15-Mar-2003 Theodore Ts'o <tytso@mit.edu> Don't display progress bar when rebuilding directories unless
explicitly requested by the user.
ehash.c
0926668d3af802b4d385d0fc3525a5a4e679574a 15-Mar-2003 Theodore Ts'o <tytso@mit.edu> e2fsck/pass2.c (check_dir_block): Check for duplicate filenames within
a single directory block (because this is the easy case;
we don't currently check for duplicates that span
directory blocks, for now. Eventually for htree
directories we can do this by searching for all directory
blocks that have a hash overflow, and then searching the
adjacent blocks to find all other potential duplicates.)
hangeLog
ass2.c
roblem.c
roblem.h
e71d87317ac095fa08079f0cc9040da16952eb93 14-Mar-2003 Theodore Ts'o <tytso@mit.edu> Add Apple/Darwin patches.
hangeLog
scan.c
cantest.c
nix.c
b0700a1b6083f2f0c19c349f07ca80e70ec456be 14-Mar-2003 Theodore Ts'o <tytso@mit.edu> Change e2fsck to detect and offer to delete or rename duplicate
filenames in directories when rebuilding directories using
"e2fsck -fD /dev/XXX"
hangeLog
2fsck.h
ass3.c
roblem.c
roblem.h
ehash.c
nix.c
77be4d2df1a868ea7d5af2e469c1eb440fc21002 06-Mar-2003 Theodore Ts'o <tytso@mit.edu> Minor man page fixes (Addresses Debian bugs #173612, #175233,
#175113, and #170497)
hangeLog
2fsck.8.in
f364093b1956def0b0f1d037852cbb645284d5f2 02-Mar-2003 Theodore Ts'o <tytso@mit.edu> Update debugfs and e2fsck to use the blkid library.
hangeLog
akefile.in
2fsck.c
2fsck.h
ournal.c
ass1.c
ass2.c
nix.c
til.c
19445ef9702720ad6e4d6dc1ec876212c8a88a49 30-Jan-2003 Theodore Ts'o <tytso@mit.edu> Fixed up minor documentation issues (man page for badblocks and usage
message for e2fsck).
hangeLog
nix.c
4f489285b63a9146b0408d0672d53d4871735f96 23-Jan-2003 Theodore Ts'o <tytso@mit.edu> pass1.c (check_blocks): Use the EXT2_I_SIZE macro.
hangeLog
ass1.c
e34bf43aff93b6e8a90b8e93d52f0e2376baf213 19-Dec-2002 Theodore Ts'o <tytso@mit.edu> pass2.c (strnlen): Provide strnlen if libc doesn't.
hangeLog
ass2.c
b92ae1535c7bba947100819d8efbad05b41c17f0 02-Jan-2003 Theodore Ts'o <tytso@mit.edu> Detect if there is an attempt to run the journal twice, and
abort the e2fsck run with an error if this is the case.
(Address IBM Bugzilla bug #1226)
hangeLog
2fsck.h
nix.c
8161a7484f47f12e562080a1312a4db9d2f71b40 02-Jan-2003 Theodore Ts'o <tytso@mit.edu> Print an error if more than one of the -p/-a, -n or -y options
are passed to e2fsck.
hangeLog
nix.c
68ef5e1f4c9a185f21be685b4cffe93bfce743a8 11-Dec-2002 Theodore Ts'o <tytso@mit.edu> Fix typo (errant extra character).
roblem.c
54779c66e0720896573142debfd89cffaac57e3e 13-Nov-2002 Theodore Ts'o <tytso@mit.edu> Update to deal with the fact that the INDEX_FL code in the ext2 2.4
code accidentally had the INDEX_FL backwards compatibility code
removed. E2fsck will now fix HTREE corruptions in preen mode, and
mke2fs will not create filesystems with the dir_index flag set
by default. (The user has to specifically request it.)
hangeLog
roblem.c
38513011b951e60abe25d85f10eec53f1fa73b7b 09-Nov-2002 Theodore Ts'o <tytso@mit.edu> Update files for 1.32 release.
hangeLog
0c897a9012efb7d65244e25245c4b7318201d961 09-Nov-2002 Theodore Ts'o <tytso@mit.edu> Add german translation to the language catalog

Fix internationalization of "pass 2" in e2fsck.

Update po files.
ass2.c
ae65b29f112542327d05bedded745705fdabe012 09-Nov-2002 Theodore Ts'o <tytso@mit.edu> Update files for 1.31 release.
hangeLog
c1637bd371bc4eb387443752a74e68142d609690 08-Nov-2002 Theodore Ts'o <tytso@mit.edu> unix.c (main): Fix a bug where e2fsck could erroneously mark a
filesystem as being valid if it was being checked and it
is interrupted with a ^C. (Bug introduced in e2fsprogs
1.28.)
hangeLog
nix.c
5e72cdbeb9cfe32ddff1293cc672dcf66f4f2d5b 08-Nov-2002 Theodore Ts'o <tytso@mit.edu> unix.c (PRS), journal.c: Set the default level of journal
debugging to be 0, and allow the user to set the level of
journal debugging by using the E2FSCK_JBD_DEBUG
environment variable.
hangeLog
ournal.c
nix.c
299d742427776629ef07b4563f41a4e00fc23aa0 08-Nov-2002 Theodore Ts'o <tytso@mit.edu> Change e2fsck to force out changes to the backup copies of the
superblock and block group descriptors when important changes
are made to those data structures.
hangeLog
ass1.c
uper.c
wapfs.c
ee895139d79c364aa43e6c0113c3f060081cb9fe 07-Nov-2002 Theodore Ts'o <tytso@mit.edu> e2fsck.h, unix.c (main, check_mount): Fix e2fsck so that it
returns the appropriate exit code, so that the boot
scripts will be told that they need to automatically
reboot.
hangeLog
2fsck.h
nix.c
5d823a478f806fddd76391f3f63e61f948c9d849 01-Nov-2002 Theodore Ts'o <tytso@mit.edu> Update files for 1.30 release.
hangeLog
4fd6834c685246770c044f979626618d02cb337d 01-Nov-2002 Theodore Ts'o <tytso@mit.edu> unix.c (usage), e2fsck.8.in: Add the -D option to the usage and
command synopsis. (Addresses Debian bug #167108)
(missed this file in the previous checkin)
nix.c
b40ffd792e64cfcb62d2b183363ff5e1890fd863 01-Nov-2002 Theodore Ts'o <tytso@mit.edu> unix.c (usage), e2fsck.8.in: Add the -D option to the usage and
command synopsis. (Addresses Debian bug #167108)
hangeLog
2fsck.8.in
be93ef0c14c11f9891094d66563d2998b917eb6c 01-Nov-2002 Theodore Ts'o <tytso@mit.edu> pass1.c (e2fsck_pass1): Check the superblock write time to see
whether or not we can safely do the LOW_DTIME checks.
(Addresses Sourceforge bug #620980)
hangeLog
ass1.c
482afc442d98b5f8d8571cfa2c7047907066c07d 31-Oct-2002 Theodore Ts'o <tytso@mit.edu> Makefile.in (install): Search all compression extensions when
deleting old man pages.
hangeLog
akefile.in
76dd5e5c2842fb1a7b858aad3e68b5e9c16890c9 31-Oct-2002 Theodore Ts'o <tytso@mit.edu> Add support for the meta_bg feature flag to the resize2fs program.

Fix bug in meta_bg support in mke2fs, e2fsck, and dumpe2fs; we were
incorrectly reserving the legacy block groups desriptor blocks.
hangeLog
ass1.c
a49929b6568082926ea61c3a6f60fc2aeab8eb68 20-Oct-2002 Theodore Ts'o <tytso@mit.edu> Add support for the meta_blockgroup filesystem format. (Missing changelog)
hangeLog
c046ac7f2e4c53e20cf1e909bbe511f91074b396 20-Oct-2002 Theodore Ts'o <tytso@mit.edu> Add support for the meta_blockgroup filesystem format.
ass1.c
3e69906495d5898849a6154b0311b5d4a84a27ae 14-Oct-2002 Theodore Ts'o <tytso@mit.edu> Fix gcc -Wall nits.

Fix format bug if NLS is in use.

Add extra so that the info directory looks OK on OpenWall.
hangeLog
ournal.c
ass1.c
evoke.c
nix.c
til.c
64aecc4dd35b48f66f452f06c49587c838990d39 11-Oct-2002 Theodore Ts'o <tytso@mit.edu> Fix bug in e2fsck and mklost+found; the lost+found directory should
created with mode 0700.
hangeLog
ass3.c
d237a78e4eb9f4d72b40270c10c641159bf7bb46 03-Oct-2002 Theodore Ts'o <tytso@mit.edu> Handle BAD_BLOCK_IN_INODE_TABLE even at the beginning of the
inode table, and shrink code by reorganizing the while loop so
to eliminate duplicate calls to ext2fs_get_next_inode().
ass1.c
ass1b.c
8132d840c8f6b0d90ab5048d6f8529f74e1aa0b3 03-Oct-2002 Theodore Ts'o <tytso@mit.edu> Fix endian problems in the htree code for e2fsck and debugfs.

When byte-swapping a filesystem on a PPC architecture, byte-swap
the bitmaps since the historical big-endian ext2 variant had
byte-swapped bitmaps, and the ext2fs library assumes this. Otherwise
the regression test suite will fail...
hangeLog
ass2.c
wapfs.c
ad4fa4660404ed88a3231fee338397af11e041b4 30-Sep-2002 Theodore Ts'o <tytso@mit.edu> Avoid counting directory entries during a directory salvage.

Add additional checks to HTREE directories. We now check the count
and limit fields in the htree header, as well as assuring that the
hash table in each interior node is in ascending order. We also
check to make sure all leaf nodes are have the expected depth in
the tree.

Updated test cases to deal with all of the above.
hangeLog
2fsck.h
ass2.c
roblem.c
roblem.h
e8254bfd3b49cb325a1ff6b21ca86570a1008744 30-Sep-2002 Theodore Ts'o <tytso@mit.edu> pass2.c (check_dir_block): Do a more paranoid check when trying
to determine whether or not a directory entry is a
completely empty leaf block or leaf node. Otherwise
e2fsck might get confused into thinking that a valid dxdir
was corrupted.
hangeLog
ass2.c
fe5b72d15e2805812e0f262d9eeb5428a603bf15 30-Sep-2002 Theodore Ts'o <tytso@mit.edu> rehash.c (e2fsck_rehash_dir): Apply patch from Christopher Li
which avoids creating an empty directory entry at the end
of the directory block. This screws up earlier versions
of the indexed directory patch.
hangeLog
ehash.c
e70ae99e077f5085c15a4526028e2aac0e91d7c1 28-Sep-2002 Theodore Ts'o <tytso@mit.edu> Add a more sophisticated algorithm to e2fsck to salvage corrupted
directories.

Speed up e2fsck slightly by only updating the master superblock;
there is no point to update the backup superblocks.

Fix a small bug in the rehashing code which could leave the indexed
flag set even after the directory was compressed instead of indexed.
(Not fatal, since the kernel will deal with this, but technically
it filesystem isn't consistent, and the filesystem will be marked
as being in error when the kernel comes across the directory. It
should also never happen in real life, since directories that small
will never be indexed, but better safe than sorry.)

Also change the threshold of when directories are indexed, so that
directories of size 2 blocks will be indexed. Otherwise they will
never be indexed by the kernel when they grow.
hangeLog
ass2.c
ehash.c
nix.c
c6633059470c28757062daa811ef50265f5f582a 24-Sep-2002 Theodore Ts'o <tytso@mit.edu> Update for 1.29 release.
hangeLog
cf3909edfe0cd9680da51a4a547f6e7318cb944c 06-Sep-2002 Theodore Ts'o <tytso@mit.edu> rehash.c (copy_dir_entries): Fix bug which caused corrupted
directories if there are 4 or 8 bytes left over in a
directory page when optimizing/reindexing a directory.
hangeLog
ehash.c
87ee8dcad3b9e42dc0576b9788b9d321076dee5e 31-Aug-2002 Theodore Ts'o <tytso@mit.edu> Update changelogs for 1.28 release
hangeLog
b7bad61521ef8dc7ab9345f97ef080f855e8317e 31-Aug-2002 Theodore Ts'o <tytso@mit.edu> Update for 1.28 release.
akefile.in
ceecbc75c3bf90abf288338bde3037015681f8b8 31-Aug-2002 Theodore Ts'o <tytso@mit.edu> ehandler.c (e2fsck_handle_read_error): If the user asks to
ignore the error, offer to try forcing a write of the
block to the disk; sometimes this will cause the drive to
remap the bad block.
hangeLog
handler.c
ea1959f01523ffc105747d660ccc5b7f02805928 31-Aug-2002 Theodore Ts'o <tytso@mit.edu> Fix a bug which caused e2fsck to fail to correctly check filesystems
using a non-zero hash version (i.e., half MD4 or TEA hash).

The hash version wasn't getting copied into dx_dir->hashversion and
this caused the kernel to treat all directories if they were using the
legacy hash, which was Bad.
hangeLog
ass2.c
roblem.c
roblem.h
a3da9d1df7494cd60d9e91643ec2a243855b3bbb 21-Aug-2002 Theodore Ts'o <tytso@mit.edu> problem.c: Fix PR_1_RELOC_BLOCK_ALLOCATE message to explain that
it is necessary to find contiguous blocks in a particular
block group.
hangeLog
roblem.c
f044b4d8a02ef9f95e27b8bdf6adc6548e5dc4a9 17-Aug-2002 Theodore Ts'o <tytso@mit.edu> Update and clarify man pages (addresses Debian Bug #145044).

Let e2fsck allow use of the TEA hash.

Mke2fs will no longer abort if it can't zero blocks at the end of the
filesystem. (Addresses Debian Bug #155007)
hangeLog
2fsck.8.in
ass1.c
0684a4f33b5c268fe12f57fcbc77a880c79ab282 17-Aug-2002 Theodore Ts'o <tytso@mit.edu> Overhaul extended attribute handling. Should now be correct with
respect to the latest V2 bestbits ACL code.
hangeLog
2fsck.8.in
2fsck.c
2fsck.h
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
roblem.c
roblem.h
uper.c
nix.c
eb16f861e908101a7f395971ca832a98f4935406 14-Aug-2002 Stephen Tweedie <sct@redhat.com> Clear dtime field on truncated orphan inodes.
uper.c
838e773e7a6899cec10884ad6c3fdcdaef72b82b 01-Aug-2002 Theodore Ts'o <tytso@mit.edu> Change e2fsck to use a red/black tree in pass1b, to remove O(n**2)
algorithms. Makes e2fsck much, much faster in certain rare cases
where the filesystem is severely corrupted.
hangeLog
akefile.in
ict.c
ict.h
ass1b.c
850d05e9aa405497e57c72090b9561af98b1b661 25-Jul-2002 Theodore Ts'o <tytso@mit.edu> Add e2fsck -D option which optimizes/compresses directories.

General cleanup of rehash code. (Fixed a few bugs, reformatted
code to make it more maintainable, etc.)
hangeLog
2fsck.8.in
2fsck.c
2fsck.h
ass3.c
roblem.c
roblem.h
ehash.c
nix.c
542867fb705f0c5705365e470f3e3dd097b5bded 24-Jul-2002 Theodore Ts'o <tytso@mit.edu> util.c (ask_yn, read_a_char): Note when the user has typed ^C,
and abort processing by longjmp'ing to ctx->abort_loc.
hangeLog
til.c
3214a453db281839f217fa753c7309d965958acc 23-Jul-2002 Theodore Ts'o <tytso@mit.edu> pass1.c (e2fsck_pass1): If e2fsck is run with -n, don't create
the dirs_to_hash list, since we don't want to reindex
directories if the filesystem is opened read-only.
hangeLog
ass1.c
4cae04529eda0e482ceaa86b48e532f9c8d35f24 21-Jul-2002 Theodore Ts'o <tytso@mit.edu> Add SIGINT and SIGTERM handling to fsck and e2fsck. For e2fsck,
make sure we gracefully clean up and only exit at safe points.
For fsck, we pass the SIGINT/SIGTERM signal to the child processes,
so they can do their own cleanup.
hangeLog
2fsck.8.in
2fsck.h
ass2.c
ass3.c
ass4.c
nix.c
b7a00563b22b0ea47ddc7117508c0b8e0d65df43 20-Jul-2002 Theodore Ts'o <tytso@mit.edu> Add support to e2fsck to reindex directories to use hash trees.
hangeLog
akefile.in
2fsck.c
2fsck.h
ass1.c
ass2.c
ass3.c
roblem.c
roblem.h
roblemP.h
ehash.c
62acaa1de132a808949d71264731bba7fe095705 15-Jul-2002 Theodore Ts'o <tytso@mit.edu> pass2.c (e2fsck_pass2): Use dx_dir->numblocks instead of
dx_dir->ino to indicate that a bad inode was cleared.
hangeLog
ass2.c
503f9e7f6eb331c5b75d7f1ad126f71bcdcfb4e3 26-Jun-2002 Theodore Ts'o <tytso@mit.edu> Add support for the half-MD4 HTREE hash.

Add HTREE root node tests.
hangeLog
ass1.c
ass2.c
roblem.c
roblem.h
8fdc9985c1e2a4467630b33719b7feb281b7b33b 26-Jun-2002 Theodore Ts'o <tytso@mit.edu> Add initial support for htree directories.
hangeLog
akefile.in
x_dirinfo.c
2fsck.c
2fsck.h
essage.c
ass1.c
ass2.c
roblem.c
roblem.h
nix.c
b21bf267783274683a432eea6e5c589eab94123e 10-Jun-2002 Andreas Dilger <adilger@clusterfs.com> Do sanity checking of the number of blocks and inodes in a group for
8192-byte and 16384-byte blocksize filesystems.

Change the default bytes-per-inode ratio of a new filesystem to be at most
one inode per block for large blocksizes.
hangeLog
uper.c
0d63467ddb76ef0c08481b74dae1fc7d6f364d1d 22-May-2002 Theodore Ts'o <tytso@mit.edu> Update to support the V2 Bestbits EA format.
hangeLog
ass1.c
da307041e75bdf3b24c1eb43132a4f9d8a1b3844 22-May-2002 Theodore Ts'o <tytso@mit.edu> Check for inodes which are too big (either too many blocks, or
would cause i_size to be too big), and offer to truncate the inode.
Remove old bogus i_size checks.

Add test case which tests e2fsck's handling of large sparse files.
Older e2fsck with the old(er) bogus i_size checks didn't handle
this correctly.
hangeLog
ass1.c
roblem.c
roblem.h
bcf9c5d4016975c3c2afdb4a4b358569bd3c8681 21-May-2002 Theodore Ts'o <tytso@mit.edu> Fix up Andreas' changeset. Avoid use of dynamic automatic arrays,
and check for EXT2_INDEX_FL for special devices, and consider them to
be invalid if they are set.
hangeLog
2fsck.h
ass1.c
ass2.c
ass4.c
roblem.c
roblem.h
b94a052a25d0c524209782e408c31d8ff25a6fe1 18-May-2002 Andreas Dilger <adilger@clusterfs.com> Add more complete tests for symlinks: nul termination of long links and length
Improve the f_badsymlinks test case for these new tests.
ass1.c
ass2.c
roblem.c
roblem.h
7823dd65722c50eeca98b2dde1c9a629e72fffe7 18-May-2002 Theodore Ts'o <tytso@mit.edu> Fix fencepost error in allocating space for array.
ass1.c
31e29a12d1e22745c74afe47bf172a3c73280dd9 17-May-2002 Theodore Ts'o <tytso@mit.edu> Fix up Andreas's 8k blocksize changes to fix a number of bugs,
and to make the page size determined at run-time instead of
compile time.
hangeLog
ass1.c
uper.c
932a489cdf6bc83d69e59d3f8e0a57b733799ce1 16-May-2002 Andreas Dilger <adilger@clusterfs.com> Add support for creating and checking 8192-byte blocksize filesystems.
We complain if you try to create such a filesystem on a system with 4096
byte PAGE_SIZE.

Add checks for valid inode size for undocumented -I option.
ass1.c
uper.c
nix.c
til.c
a8e772498cea7d6d2d84d94c7985c79afb96a4fa 08-Mar-2002 Theodore Ts'o <tytso@mit.edu> Update for 1.27 release.
hangeLog
546a1ff18cc912003883ff67ba3e87c69f700fc4 08-Mar-2002 Theodore Ts'o <tytso@mit.edu> Fix various gcc -Wall complaints.
hangeLog
ournal.c
ass5.c
evoke.c
f2d5c937034e6c07391549ef6d46b2c8db086c85 07-Mar-2002 Theodore Ts'o <tytso@mit.edu> Fixed the journal handling so that an offer is made to clear the
journal filesystem in all cases.

Fixed a bug in e2fsck which caused it to give spurious I/O manager
bad messages right before crashes.
hangeLog
ournal.c
nix.c
f122632e6bb8a51126da2c71bdb95fbcb52f51bc 07-Mar-2002 Theodore Ts'o <tytso@mit.edu> E2fsck now prints ranges in pass 5 when printing deltas in
the block and inode bitmaps.
hangeLog
ass5.c
roblem.c
roblem.h
14308a5398984842e808faa3ff2dd6a1c52d90bd 05-Mar-2002 Theodore Ts'o <tytso@mit.edu> Newer libintl needs LC_CTYPE to be set in addition to LC_MESSAGES.
hangeLog
nix.c
57173d0febd3d6ea911981420945d12ec205ec2c 26-Feb-2002 Theodore Ts'o <tytso@mit.edu> Update Changelog messages to use tytso@mit.edu for all addresses
after September 7, 2001. (Forgot to update my emacs file to get
rid of the tytso@valinux.com address. Oops.)
hangeLog
25813b1313a520d118dd16cf5b98545d1f13f53f 24-Feb-2002 Theodore Ts'o <tytso@mit.edu> Fix typo in previous changeset; the man pages for fsck.ext2 and
fsck.ext3 should be linked to the one for e2fsck, not fsck.
akefile.in
b9f409255eec6ccaa7d297bcbf5e2a6478a02735 24-Feb-2002 Theodore Ts'o <tytso@mit.edu> Update makefiles to install mkfs.ext3, and to install man pages for
mkfs.ext2/3 and fsck.ext2/3. Also remove any compressed man pages
before installing the man pages.
hangeLog
akefile.in
d1a2182a1878b1dc6c0996ed1a6c5b108f6626f9 22-Feb-2002 Theodore Ts'o <tytso@mit.edu> Cleaned up journal handling code in e2fsck.

Fixed up two minor memory leaks.
hangeLog
ournal.c
uper.c
a5f3f5c19191c0eabd345f9cad2d9159e9bc0084 03-Feb-2002 Theodore Ts'o <tytso@mit.edu> Update files for 1.26 release.
hangeLog
96b5cacc0487de54263812034ae00c7c8634c8b3 24-Dec-2001 Theodore Ts'o <tytso@mit.edu> Miscellaneous cleanup before 1.26-WIP release. Removed unused
.cvsignore in include/asm directory so it can disappear. Updated
makefile dependencies, and stop including <topsrc>/include in the
-I search path, since it's no longer needed.
akefile.in
3ed57c27df0ba0942a19c71bc065c8eec3036567 24-Dec-2001 Theodore Ts'o <tytso@mit.edu> In mke2fs and e2fsck, specifying the -c option twice will now do
a read/write test on the disk. Update the man pages to encourage
using the -c option, and to discouraging running badblocks separately,
since users tend to forget to set the blocksize when running
badblocks.
hangeLog
adblocks.c
2fsck.8.in
2fsck.h
nix.c
fae9bfaa5c1dc8b1bd6190d1a51024031e5ac9cf 24-Dec-2001 Theodore Ts'o <tytso@mit.edu> Initialize buf to NULL to avoid crashing when called by fix_problem()
til.c
f1a1761d678a5ac539419f62676ce4c1bbd0767e 24-Dec-2001 Theodore Ts'o <tytso@mit.edu> Enhnaced the get backup superblock function so that it does
the right thing if the filesystem superblock is unavailable;
it will search for the superblock by iterating over possible
blocksizes.
hangeLog
2fsck.h
essage.c
nix.c
til.c
19007e51a548d1e0eff01025dde9f147a0beb26d 24-Dec-2001 Theodore Ts'o <tytso@mit.edu> Move linux/jbd.h to ext2fs/kernel-jbd.h, to avoid using the
system header file version of hbd.h when using diet glibc
(since it forcibly adds /usr/include to the beginning of include
search path.)
hangeLog
akefile.in
fs_user.h
6a50c5ed579d95279ffb2fca83b2ae8b15123859 22-Dec-2001 Theodore Ts'o <tytso@mit.edu> Use ctx->filesystem_name if the ctx->device_name is NULL in e2fsck.
hangeLog
roblem.c
d37066a9fa14ff3c0e7f4ea95e07204fce95f41a 22-Dec-2001 Theodore Ts'o <tytso@mit.edu> Give the opportunity for e2fsck to run the journal even if
recovery flag is cleared. If we're using a backup
superblock, run the journal by default.
hangeLog
2fsck.h
ournal.c
roblem.c
roblem.h
nix.c
4ea7bd04390935e1f8b473c8b857e518df2e226b 17-Dec-2001 Theodore Ts'o <tytso@mit.edu> Fix various gcc -Wall nits. Fixed a bug in mke2fs where a bogus
error message could be printed on an malloc() failure, and e2image
was optimized to avoid needless system calls by using the stashed
inode functions.
hangeLog
2fsck.h
a_refcount.c
ass1.c
nix.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.
hangeLog
akefile.in
fs_compat.h
fs_user.h
ournal.c
ecovery.c
evoke.c
571fc5a89c17985626df29823617b63094d10b31 02-Dec-2001 Theodore Ts'o <tytso@mit.edu> Fixes necessary for e2fsprogs to work using the diet libc.

- Renamed linux/list.h to be linux/linked_list.h to work around a
problem caused by diet libc insistence to search the kernel
header files ahead of all other files in the include path,
including the user specified include files.

- Worked around a bug in diet libc which core dumps when using
putc with stderr by using fputs instead. As a bonus, this
also shaved a few bytes off of com_err.o.

- Fixed a real bug in debugfs which was detected because diet libc
was more sensitive than glibc when incorrectly using fclose()
where pclose() is required.
akefile.in
b3b3d465b1e833af355a41c1c470d8fa3592bc26 30-Nov-2001 Gabriel Paubert <paubert@iram.es> journal.c: fix an endianness bug.
f_badorphan: revert previous, erroneous change.
hangeLog
ournal.c
24bfb443fccf2060c55d0f919ef650409f96674a 26-Nov-2001 Theodore Ts'o <tytso@mit.edu> super.c (check_super_block): Make sure that if the inode table
or allocation bitmap is zero, that it is marked as
invalid, so that in pass #1, a new bitmap/inode table gets
properly allocated. (Addresses Debian Bug #116975)
hangeLog
uper.c
1e9a7e0278ae24b2bed77ef0722c34623db695a2 24-Nov-2001 Theodore Ts'o <tytso@mit.edu> 2fsck.8.in: Fix minor typo in man page and clarify device
specification.
hangeLog
2fsck.8.in
6a138ed42a394e29ace844213db2c4f893fe84d0 09-Nov-2001 Andreas Dilger <adilger@clusterfs.com> Allow a single user for internal journals (the current filesystem)
since this is how the filesystem is created.
ournal.c
62e3e7fe4f32c2186e848f37b7f977835975413e 07-Oct-2001 Theodore Ts'o <tytso@mit.edu> journal.c (clear_v2_journal_fields, e2fsck_journal_load): If the
V2 fields are set on a V1 journal superblock, or an
internal V2 journal has s_nr_users is non-zero, clear the
entire journal superblock beyond the V1 superblock. This
fixes botched V1->V2 updates.

problem.c, problem.h (PR_0_CLEAR_V2_JOURNAL): Add new problem code.

f_bad_local_jnl: New test which tests for a V2 journal with bad
fields caused by a botched V1->V2 upgrade.
hangeLog
ournal.c
roblem.c
roblem.h
773fd8a1d4202af708a37bdc7754134e6fdcfe22 07-Oct-2001 Theodore Ts'o <tytso@mit.edu> e2fsck.h, journal.c (e2fsck_move_ext3_journal): Add new function
which will automatically relocate the ext3 journal from a
visible file to an invisible journal file if the
filesystem has been opened read/write.

super.c (check_super_block): Add call to e2fsck_move_ext3_journal

problem.c, problem.h (PR_0_MOVE_JOURNAL, PR_0_ERR_MOVE_JOURNAL):
Add new problem codes.
hangeLog
2fsck.h
ournal.c
roblem.c
roblem.h
uper.c
fbf91112163add26bd9d44e992afa31a47790588 20-Sep-2001 Theodore Ts'o <tytso@mit.edu> Update changelogs for 1.25 release.
hangeLog
ae6cdcf74a4c665b7404374bf52e0c91c31422a9 19-Sep-2001 Theodore Ts'o <tytso@mit.edu> e2fsck: If a superblock is specified explicitly by the
user, don't try to automatically fall back to an
alternate superblock.
hangeLog
2fsck.h
nix.c
fb70775b0f5cb54730a294e88c7c80f0810a871b 04-Sep-2001 Theodore Ts'o <tytso@mit.edu> Update for 1.24a release
hangeLog
109624a133f147b13903f59d585b20446a3c538f 31-Aug-2001 Theodore Ts'o <tytso@mit.edu> Update for 1.24 release.
hangeLog
59f27247f81fb662ef3b2589b3cceb198ff4dbca 30-Aug-2001 Andreas Dilger <adilger@clusterfs.com> mke2fs.c (main): Zap the second sector of the disk, along with
any sectors in the same filesystem block after the superblock.
The latter will remove (for example) swapspace signatures
on 4kB+ blocksize filesystems. Also when zeroing the "end"
of the filesystem don't actually zero the start of a very
small device (less than 128kB).
ass1.c
b1f204f7f9f5d318c27c7719491933a0e49140ac 30-Aug-2001 Theodore Ts'o <tytso@mit.edu> pass1.c (e2fsck_pass1): For EXT2_RESIZE_INO, allow its i_mode to
either be zero or a regular file (for compatibility with
Andreas's on-line resizing programs).
hangeLog
ass1.c
0f8973fb092a40fd0a11b7ec95c09128c9fb8f0c 27-Aug-2001 Theodore Ts'o <tytso@mit.edu> Remove EXT2FS_VERSION from the version display, since it
only confuses people.

Make fsck's version display be consistent with the other e2fsprogs
programs.
hangeLog
nix.c
943ed874fc76bebf38288ebf0069718375f7f377 27-Aug-2001 Theodore Ts'o <tytso@mit.edu> Add missing log entry showing when we released e2fsprogs 1.23
hangeLog
53abed0afafec661fd923cb9cd9f0eee891ccbde 27-Aug-2001 Theodore Ts'o <tytso@mit.edu> Deal with libc5's lack of strnlen.

Stop checking for strdup in the configure script since we don't
care about that symbol.
hangeLog
ass1.c
eb4ab51044706e52fc78907130f2cb9458a7023b 13-Aug-2001 Theodore Ts'o <tytso@mit.edu> super.c (release_orphan_inodes): If the filesystem contains
errors, don't run the orphan * list, since the orphan list
can't be trusted.
hangeLog
uper.c
a40ecbb1fc4811201c6ab40292ac3aef1bca54af 13-Aug-2001 Theodore Ts'o <tytso@mit.edu> e2fsck/pass1.c (e2fsck_pass1_check_device_inode): If i_blocks is
non-zero, then assume that the device/socket/fifo inode
is bogus.
hangeLog
ass1.c
85645a6ff34c4c6c4daa92839a93499cb9f4a778 13-Aug-2001 Theodore Ts'o <tytso@mit.edu> pass1.c (check_size): Fix logic in check_size; the previous code
only offered to clear the inode size fields if both size
and i_size_high were zero.
hangeLog
ass1.c
a47426914745b7d50bb58a3d44b3509c647c637e 09-Aug-2001 Theodore Ts'o <tytso@mit.edu> pass1.c, pass2.c, problem.c, problem.h: Fix bug introduced by
Andreas's symlink code; check_blocks() was unconditionally testing
inode_bad_map without checking to see if it existed first. Fixed
problem a different way; we now no longer check inode_bad_map at all,
since the file might not get deleted in pass 2 anyway. We move the
large file feature reconciliation code to to e2fsck_pass2(), and in
deallocate_inode() in pass2.c, we decrement the large files counter if
we're about to delete a large file.
hangeLog
ass1.c
ass2.c
roblem.c
roblem.h
2b94c658c7270d99343d2f4aa3561c09e819b280 09-Aug-2001 Theodore Ts'o <tytso@mit.edu> unix.c (show_stats): Print the number of large files in verbose mode.
hangeLog
nix.c
e3bda7830290c7cc6579f3be980518d9a33d6a0e 09-Aug-2001 Theodore Ts'o <tytso@mit.edu> Add dependencies to iscan.
akefile.in
d4cac023c2540aea6a2791bcd10da95ea8ee3d28 08-Aug-2001 Theodore Ts'o <tytso@mit.edu> Add missing errcode_t variable so that iscan compiles.
scan.c
c0a083fac3b8f03ae15f5bf30c230c015538051e 07-Aug-2001 Theodore Ts'o <tytso@mit.edu> * journal.c (recover_ext3_journal): If s_errno is set in the
journal superblock, set the EXT2_ERROR_FS flag in the
filesystem superblock after the journal is run.
hangeLog
ournal.c
bd512b6868fd6f381c4377bab0f2aeebbe41c54b 05-Aug-2001 Theodore Ts'o <tytso@mit.edu> Add ChangeLog entry for changes made by Andreas
hangeLog
fcdebce7dff25a18f821c4deeb14e4a66db790df 04-Aug-2001 Andreas Dilger <adilger@clusterfs.com> Change comments for %D and %d expansion in e2fsck problem codes. It
was not consistent which was for dirent expansion, and which was for
directory number expansion.
essage.c
roblem.c
d007cb4cbb4b8b190ffd9a597f0e88ea365926c5 05-Aug-2001 Theodore Ts'o <tytso@mit.edu> Cleanup changes to Andreas' symlink patch. Remove use of EXT2_LINK_DIR

Also cleaned up the symlink handling code to make it a bit more
compact and to test for a bad symlink block earlier.
hangeLog
ass1.c
ass2.c
roblem.c
67052a8aeeca8cd80d1dd33c2792f917573accc8 04-Aug-2001 Andreas Dilger <adilger@clusterfs.com> Add extra checks for bad symlinks, including zero length symlinks,
too long i_size for slow and fast symlinks, i_size_high set, multiple
blocks for slow symlinks.
2fsck.h
ass1.c
ass2.c
roblem.c
83e6ac84c7784ba66eaf5d4998bad2f26d1519ed 30-Jul-2001 Theodore Ts'o <tytso@mit.edu> unix.c (check_mount): Remove the code in e2fsck which tested for the
root filesystem being mounted read-only, and depend on the
results flags from ext2fs_check_if_mounted.
hangeLog
nix.c
0628ae3948d5a7d0945411add9091d07ff2b3f41 29-Jul-2001 Theodore Ts'o <tytso@mit.edu> unix.c (main): Move the final print_resource_track call after
the filesystem and context handle are closed
hangeLog
nix.c
6d222f3217b11c9b27f92b4aafe47bfeb59b81fa 29-Jul-2001 Theodore Ts'o <tytso@mit.edu> Fix memory leaks in e2fsck's journal.c, and remove some cases
which look like memory leaks in unix.c so we can more easily find
the true memory leaks.
hangeLog
ournal.c
nix.c
1e16526bd9d7d14daf4bac46e1c6a3139182ba94 29-Jul-2001 Theodore Ts'o <tytso@mit.edu> e2fsck.c (e2fsck_reset_context): Fix bug; only close the io channel if
it is *different* from the filesystem io channel
hangeLog
2fsck.c
a092c563f736963223029e03be28b2b83b54caf6 28-Jul-2001 Theodore Ts'o <tytso@mit.edu> Update problem message printed when special files have the immutable
flag set. Update the f_filetype test case.
hangeLog
roblem.c
fd77b2c78a28a6c706a38c43c0b558ac9e8486ce 28-Jul-2001 Theodore Ts'o <tytso@mit.edu> pass1.c (e2fsck_pass1): Check for symlinks that have the
immutable flag set (and offer to clear them).
hangeLog
ass1.c
24ceb248abfb0ee0cd0e7861e2bc83e6c8c61ad7 26-Jul-2001 Theodore Ts'o <tytso@mit.edu> pass1.c (e2fsck_pass1): Free ctx->block_ea_map at the end of pass 1.
This avoids increasing the memory footprint of e2fsck by 10%!
hangeLog
ass1.c
14fe1c33145fc6af4f4338792bccf240088d43a0 26-Jul-2001 Theodore Ts'o <tytso@mit.edu> Apply fixes reported by Andreas Gruenbacher:

pass1.c (check_ext_attr): Skip zero-length EA entries.

problem.c: PR_1_EA_ALLOC_COLLISION shouldn't abort, but should prompt
to clear the EA block.
hangeLog
ass1.c
roblem.c
adee8d75db09dc8ecb2a32f59a8c64d3f4c64b0e 23-Jul-2001 Theodore Ts'o <tytso@mit.edu> Add support for use of an external journal (so long as the external
journal only has one filesystem).
hangeLog
2fsck.8.in
2fsck.c
2fsck.h
ournal.c
roblem.c
roblem.h
nix.c
d312401961666db8a5cb4b3fc71d85d73ac6bf67 20-Jul-2001 Theodore Ts'o <tytso@mit.edu> unix.c (main): Add an explicit warning when the filesystem is left not
completely fixed when e2fsck exits. (Addresses Debian bug #104502.)
hangeLog
nix.c
55fd07ed0a5f4ed3dcc770526ee1ad3be967ac98 19-Jul-2001 Theodore Ts'o <tytso@mit.edu> This patch completes the initial extended attribute/ACL support for
e2fsck. We now check the entire EA block to make sure that the all
of the EA entries look sane.
hangeLog
akefile.in
2fsck.h
ass1.c
roblem.c
roblem.h
egion.c
0f2cfe25796bd53b920b1607410bf94251f17fbc 10-Jul-2001 Theodore Ts'o <tytso@mit.edu> Fix really stupid typo.
ournal.c
3c6b8977d44c66f0a50dd77c18a78b57b1022f8c 10-Jul-2001 Theodore Ts'o <tytso@mit.edu> Speed up journal recovery in userspace by avoiding a pointless
unconditional ext2_flush() call. Also made ext2_flush() more
efficient when the superblock is modified after the filesystem has
been flushed, and make it clear the superblock dirty flag
after doing the superblock/block group descriptor flush.
hangeLog
ournal.c
7b63fff9b6c4a0ca3b80740f01f5bf0583b42aa9 08-Jul-2001 Theodore Ts'o <tytso@mit.edu> pass1b.c (pass1b, process_pass1b_block): Change the num_bad
field calculation so that it only counts EA block entries
as a single multiply claimed block (since once we clone
the EA blocks for one inode, we fix the problem for all of
the other inodes). Also, I moved the num_bad calculation
from process_pass1b_block to the end of pass1b. This
fixes a *significant* performance bug in pass1b which hit
people who had to had a lot of multiply claimed blocks.
(Can you say O(n**3) boys and girls? I knew you could...
Fortunately, this case didn't happen that much in actual practice.)
hangeLog
ass1b.c
b5acdb6ae2a05212b1014a3dee7cbcf385446b3b 08-Jul-2001 Theodore Ts'o <tytso@mit.edu> pass1.c (e2fsck_pass1): Defer inodes which have an extended attribute
block for later processing to avoid extra seeks across the disk.
(process_inode_cmp): If there is no indirect block, sort by the
extended attribute (i_file_acl) block.
ass1.c
7abb2bdcd6c3787eafdff77bf53050f995f35054 07-Jul-2001 Theodore Ts'o <tytso@mit.edu> pass1b.c (clone_file_block): Fix bugs when cloning extended attribute
blocks. Moved free of block_buf to after the code which clones the
extattr block, and fixed logic for changing pointers to the extended
attribute field in the inodes which were affected.

(decrement_badcount): New function which is used whenever we need to
decrement the number of files which claim a particular bad block.
Fixed bug where delete_file wasn't checking check_if_fs_block() before
clearing the entry in block_dup_map. This could cause a block which
was claimed by multiple files as well as the filesystem metadata to
not be completely fixed.
hangeLog
ass1b.c
e8a3ee628ad693cbae231089b18886e6ba0e59d3 07-Jul-2001 Theodore Ts'o <tytso@mit.edu> Add code to check and fix incorrect reference counts in the extended
attribute blocks.
hangeLog
ass1.c
roblem.c
roblem.h
342d847db355d81299218e07a1e58ece82080a04 02-Jul-2001 Theodore Ts'o <tytso@mit.edu> Add initial support for extended attribute blocks
hangeLog
akefile.in
2fsck.c
2fsck.h
a_refcount.c
essage.c
ass1.c
ass1b.c
ass2.c
roblem.c
roblem.h
636a954a308aec91cf644f566d3e8a794a5dd8cb 29-Jun-2001 Theodore Ts'o <tytso@mit.edu> Use long long to calculate the percentage
of the number of blocks in use in the filesystem.
hangeLog
nix.c
67960139d73fb99f579e8447b9f1c743581b6610 23-Jun-2001 Theodore Ts'o <tytso@mit.edu> Update changelogs for 1.22.
hangeLog
d90f3494b219f9fe327eaa561faf75582f65ad9e 23-Jun-2001 Theodore Ts'o <tytso@mit.edu> e2fsck/flushb.c and lib/ext2fs/flushb.c: Use platform independent
method of defining the BLKFLSBUF and FDFLUSH ioctl's.
Also include sys/mount.h since on newer glibc's BLKFLSBUF
is defined there.
hangeLog
lushb.c
42475e281d22dbefd7f0b399f6056f642fa0ab92 23-Jun-2001 Theodore Ts'o <tytso@mit.edu> super.c (release_inode_blocks): Don't try to release the blocks if the
orphaned inode is a device file, symlink, or some other kind of
special file that doesn't have a block list.
hangeLog
uper.c
f4f75bae8520ae44e9c593c4d90c7bfdb6b5139a 16-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog:
Update for 1.21 release.
hangeLog
e333845b2afe89dc9c1764d596a41682d0e7a137 14-Jun-2001 Theodore Ts'o <tytso@mit.edu> RELEASE-NOTES, ChangeLog:
Add Debian bug number which got resolved.
hangeLog
f76ad46200dff21ed6b22b9352f814b35ca5d6ca 14-Jun-2001 Theodore Ts'o <tytso@mit.edu> problem.c:
Fix tabbing/indenting from Andreas.
roblem.c
b6a0807b088e12777609728bb3f80490db58f8aa 14-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
unix.c (check_if_skip): Adapted patch from Andreas Dilger which prints
the number of mounts or days elapsed since the last check when e2fsck
is forced to check an otherwise clean filesystem.
hangeLog
nix.c
16f095ee6e0f82490fedca01e1be729bd22a7efb 13-Jun-2001 Theodore Ts'o <tytso@mit.edu> Makefile.in:
Insert missing dependencies.
akefile.in
cbbf031b6edf9bdf5511af2193e44cff7fdaa66a 13-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, dumpe2fs.c, mke2fs.c:
dumpe2fs.c: Use WORDS_BIGENDIAN to determine whether or not we're
(not) using i386 byte order.
dumpe2fs.c, mke2fs.c: Stop using the compatibility badblocks function,
and use the ext2fs_badblocks_* functions instead.
ChangeLog, inode.c, tst_iscan.c:
inode.c, tst_iscan.c: Stop using the compatibility badblocks function,
and use the ext2fs_badblocks_* functions instead.
ChangeLog, badblocks.c:
badblocks.c: Stop using the compatibility badblocks function, and use
the ext2fs_badblocks_* functions instead.
hangeLog
adblocks.c
3034f62a0f9c31e6dce8bd1237cffd3851847250 11-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, Makefile.in, bitops.h, gen_bitmap.c:
Makefile.in, gen_bitmap.c, bitops.h: Move inline functions
ext2fs_mark_generic_bitmap and ext2fs_unmark_generic_bitmap to
gen_bitmap.c as normal functions. (This saves space and doesn't
significantly change the speed of e2fsck on a P-III.)
ChangeLog:
Add missing log entry for unix.c.
hangeLog
5df55d7f847e29d23227592a0bb23daad1a61500 11-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, Makefile.in, swapfs.c, unix.c:
Makefile.in: Add message.c and swapfs.c to the list of source files to
build the make depend.
swapfs.c, unix.c: Only support the -s and -S options to e2fsck if
ENABLE_SWAPFS is defined.
Many files:
ext2fs.h, bitops.h, block.c, bmap.c, closefs.c, dirblock.c, inode.c,
native.c, openfs.c, rw_bitmaps.c, swapfs.c: Only include the
byte-swapping logic if ENABLE_SWAPFS is turned on or if we're on a
big-endian machine.
initialize.c (ext2fs_initialize):Use WORDS_BIGENDIAN directly to set
EXT2_FLAG_SWAP_BYTES, instead of using ext2fs_native_flag.
native.c (ext2fs_native_flag): Use WORDS_BIGENDIAN provided by
autoconf to determine whether or not return EXT2_FLAG_SWAP_BYTES.
hangeLog
akefile.in
wapfs.c
nix.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
hangeLog
ecovery.c
evoke.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.
hangeLog
ecovery.c
62b6d4798712ab1f54670f365812ef476fa52799 02-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog:
Add other change to pass1.c
hangeLog
fdbdea09b87dbd8e39c23286f22653e7641599ae 02-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c, pass2.c, problem.c, problem.h:
pass1.c (mark_inode_bad): Replace alloc_bad_map with a function which
sets the bit in the bad inode bitmap.
(e2fsck_pass1): Check for fast symlinks with an invalid size, and set
the bad inode map in that case.
pass2.c (e2fsck_process_bad_inode): Check for fast symlinks with an
invalid size and prompt the user if the inode should be cleared.
problem.h, problem.c (PR_2_SYMLINK_SIZE): Added new problem code.
hangeLog
ass1.c
ass2.c
roblem.c
roblem.h
36a23e1806067074f0278de31dc94fe50d840cb0 02-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog:
Fix typo in ChangeLog.
hangeLog
2f686ace1c8e2f680ffd450d143cdd01a649687a 02-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, journal.c, problem.c, problem.h:
problem.c, problem.h: Change PR_0_JOURNAL_UNSUPP_INCOMPAT and
PR_0_JOURNAL_UNSUPP_ROCOMPAT so they aren't fatal errors, but prompt
to see if the user should abort. Removed the
PR_0_JOURNAL_RESET_COMPAT problem code.
journal.c (e2fsck_journal_load): If there are incompatible journal
flags, just return an error code.
(e2fsck_check_ext3_journal): If e2fsck_journal_load returns an error
code indicating that there are incompatible journal flag, check to see
if we should abort, and then offer to clear the journal.
hangeLog
ournal.c
roblem.c
roblem.h
797f5ef14e92294b329e52971d467d7af5b2993e 02-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, wordwrap.pl:
Makefile.in: Move include/asm/types.h.in to lib/ext2fs/ext2_fs.h.in.
wordwrap.pl: Add some rules which help fix up the dependencies.
Many files:
Move include/asm/types.h.in to lib/ext2fs/ext2_fs.h.in.
hangeLog
akefile.in
71d521c6097f1c2588fb0b13f43968371d4bfabb 01-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c, pass1b.c:
pass1.c (pass1_get_blocks, pass1_read_inode, pass1_write_inode,
pass1_check_directory): Add a safety check to make sure
ctx->stashed_inode is non-zero.
pass1b.c (pass1b): Use e2fsck_use_inode_shortcuts() to disable the
inode shortcut processing, instead of manually clearing only half of
the function pointers that needed to be NULL'ed out. This caused
nasty bugs if the last inode in the filesystem needed dup block
processing.
pass1b.c (clone_file_block): When cloning a directory's metadata
block, don't try to update the directory block list database, since
indirect blocks aren't stored in the database and the resulting error
will abort the file clone operation.
hangeLog
ass1.c
ass1b.c
bb185861d10f84b452260c6d8b89abaa23c67408 25-May-2001 Theodore Ts'o <tytso@mit.edu> e2fsprogs.lsm, version.h:
Update version string for 1.20 release
ChangeLog:
Update Changelogs for 1.20 release.
hangeLog
561cd4dd605fd8cfe593bd67db3d77c9ddbf79af 25-May-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, journal.c:
journal.c (e2fsck_journal_reset_super): Remove extraneous line
hangeLog
ournal.c
c7f23364fd6d8d25d74e51ba5f342fc2230048d8 24-May-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, journal.c, problem.c, problem.h:
journal.c (e2fsck_journal_reset_super): Fix bug; the reset journal
wasn't getting written out to disk since the dirty bit wasn't being
set on the buffer.
(e2fsck_journal_load): Don't print an error message if the journal
version number is wrong; just return a error code reflecting this
fact. If the block type in the journal superblcok is obviously not a
version number, report the journal is corrupted.
(e2fsck_check_ext3_journal): On an unsupported journal version, prompt
to abort by default, but then offer a chance to clear the journal as
corrupt.
problem.c, problem.h (PR_0_JOURNAL_UNSUPP_VERSION): Added new problem code.
hangeLog
ournal.c
roblem.c
roblem.h
21afac096df642708ebf63dc4354575883f11174 14-May-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c, problem.c, problem.h, problemP.h:
pass1.c: Treat inodes with a low dtime (that were from a corrupted
orphan list) specially.
problem.c, problem.h: Add new problem codes PR_1_LOW_DTIME and
PR_1_ORPHAN_LIST_REFUGEES, and a new latch group, PR_LATCH_LOW_DTIME.
problemP.h: Expand the size of the problem flag to be an int instead
of a short. Expand space in the flag word which is reserved for
problem latch flags from 3 bits to 8 bits.
ChangeLog, expect.1, expect.2, image.gz, name:
f_badorphan: New test which verifies corrupted orphan list handling.
hangeLog
ass1.c
roblem.c
roblem.h
roblemP.h
54c637d4d29af3e6365779f8b12976abe95a4753 14-May-2001 Theodore Ts'o <tytso@mit.edu> Many files:
badblocks.c, chattr.c, dumpe2fs.c, e2image.c, findsuper.c, lsattr.c,
mke2fs.c, mklost+found.c, tune2fs.c, util.c: Change location of
ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, resize2fs.h:
resize2fs.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, debugfs.h:
debugfs.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, e2fsck.h, scantest.c:
e2fsck.h, scantest.c: Change location of ext2_fs.h to be
ext2fs/ext2_fs.h
ChangeLog, Makefile.in, tst_uuid.c, uuid_time.c:
tst_uuid.c, uuid_time.c: Remove unneeded #include of ext2_fs.h
ChangeLog, Makefile.in, e2p.h:
e2p.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, test_icount.c, test_rel.c:
test_icount.c, test_rel.c: Change location of ext2_fs.h to be
ext2fs/ext2_fs.h
hangeLog
akefile.in
2fsck.h
cantest.c
424cd2beb7c40a3e4cf96b5bf28b24e48554a754 14-May-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.h, journal.c, problem.c, problem.h, super.c:
super.c (check_super_block): Be more strict on checking
s_r_blocks_count superblock field.
problem.c, problem.h (PR_0_JOURNAL_UNSUPP_ROCOMPAT,
PR_0_JOURNAL_UNSUPP_INCOMPAT, PR_0_JOURNAL_RESET_COMPAT): New problem
codes.
journal.c (e2fsck_journal_load): Use a problem code to report
unsupported feature flags. There is code to clear unsupported flags,
but since this is dangerous, it's not allowed in the problem code
table.
journal.c (e2fsck_journal_reset_super): initialize the journal
sequence number to a random value to avoid recovering bad transactions
from a corrupt journal.
hangeLog
2fsck.h
ournal.c
roblem.c
roblem.h
uper.c
328a5ce4ae7bd30a3a57094531bcb6688207415e 13-May-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, journal.c:
journal.c: Code cleanup; initialize journal_enable_debug using an
initializer.
hangeLog
ournal.c
fc9a69ca37cb5b4f77a9cfcd0f4458a981208c5d 12-May-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
unix.c (PRS): Skip validation of -C's file descriptor if it is zero,
since that is special case.
hangeLog
nix.c
f0b8c87d2a196ecc9a19998d512f3d9a46b758ea 09-May-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, super.c:
super.c (release_orphan_inodes): Add gettext quoting around
"Truncating" and "Clearing" for i18n.
hangeLog
uper.c
e39ac92269d645bd279c2660d127b47159b8b1f9 05-May-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, util.c:
util.c (fatal_error): Use the correct magic number when checking the
magic number for the io_channel data structure. Also remove
extraneous call to io_channel_flush() that was left over from an
editing session.
hangeLog
til.c
b9852cd87b42f79d569db68c3fdefe4a8f48ede1 05-May-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass2.c:
pass2.c (check_dir_block): Ignore EXT2_ET_DIR_CORRUPTED errors from
ext2fs_read_dir_block().
hangeLog
ass2.c
ae8160e6921437b3a88adca505f0b56008c519b1 01-May-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
unix.c (PRS): Validate the completion information file descriptor so
that the completion bar won't get accidentally written onto the disk.
hangeLog
nix.c
5f629b7491a3476b61752ce3da326f1a6cad2a8c 01-May-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.8.in:
e2fsck.8.in: Add explanation that you can use mke2fs -n -b blocksize
to printout alternate superblock locations.
hangeLog
2fsck.8.in
bc57f15390184c78524a46b19c69612ed61aa97b 26-Apr-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
unix.c (check_if_skip): If the max_mount_count is zero, treat it as
having no count set.
hangeLog
nix.c
ef059870afc5b3ace4dfbf65d6f1ffe6b610484d 17-Apr-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, super.c:
super.c (check_super_block): Fix bad calculation of inodes_per_block,
and tighten min/max checks to be a bit more paranoid. Thanks to
Andreas Dilger for pointing out this bug.
hangeLog
uper.c
15986f7931e1fe65621b4defb5522c9bf8da76ef 29-Mar-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, jfs_user.h, journal.c:
journal.c (mark_buffer_uptodate): Add emulation of kernel function
mark_buffer_uptodate.
hangeLog
fs_user.h
ournal.c
78eccb85b8889362f5f64fe1d1bf91f4d6ee3fc1 29-Mar-2001 Theodore Ts'o <tytso@mit.edu> revoke.c:
Make insert_revoke_hash static (since it's not used outside this function).
evoke.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.
hangeLog
ecovery.c
evoke.c
1833186cbbc01c543df7b177d37655f5361b375d 29-Mar-2001 Theodore Ts'o <tytso@mit.edu> .del-jfs_e2fsck.h~c0cc80d6:
Remove obsolete header file.
fs_e2fsck.h
e9e2a20a11226f50a179f4686826de26cb9bdfaa 20-Feb-2001 Theodore Ts'o <tytso@mit.edu> journal.c:
Fix stupid typo.
ournal.c
d051521278790e5fc7d97d59bb3be6b662a76365 13-Feb-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, journal.c:
journal.c (e2fsck_run_ext3_journal): Force a flush of the filesystem
and io_channel before replaying the journal.
hangeLog
ournal.c
67a473ecb902aef06f56811f0fe1658453168f8b 08-Feb-2001 Theodore Ts'o <tytso@mit.edu> problem.c:
Add quick compression of journal -> @j
jfs.h:
Eliminate force of JFS_DEBUG for userspace
roblem.c
4e009f6a2e86fa4936a14330f379a8cfcbf0ce86 08-Feb-2001 Theodore Ts'o <tytso@mit.edu> journal.c:
Fix minor typo in C comment
ournal.c
a05c589a5ef9959ac91f9b56bba9e61aeacb9d9c 18-Jan-2001 Theodore Ts'o <tytso@mit.edu> Makefile.in:
Update makefile dependencies
akefile.in
a5c33f26db87fd8af41e7f49d46ffba7e7f03f54 18-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c:
pass1.c (check_blocks): Fix large file checking code so that files >
2GB are considered large files, and restrict directories from being >
2GB.
version.h:
Update for WIP release.
hangeLog
ass1.c
a9ca2016e14b5b56e5f0b61a73d52c4caee718bc 12-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c, problem.c, problem.h:
pass1.c (e2fsck_pass1): Cap the maximum legal size of a file by the
limit caused by the fact that i_blocks is in 512 byte units, and that
the Linux buffer cache also fundamentally assumes 512 byte sectors.
Make sure that the journal inode is a regular file, and when clearing
an unused journal inode, make sure the icount db is updated.
problem.c, problem.h (PR_1_JOURNAL_BAD_MODE): Add new problem code.
ChangeLog, journal.c:
journal.c (e2fsck_journal_fix_unsupported_super): Remove unused
function. Add FIXME notes to e2fsck_get_journal(), from Andreas
Dilger.
hangeLog
ournal.c
ass1.c
roblem.c
roblem.h
37b6b2975f5f2422c26f1598a23253df76f02814 12-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, problem.c:
problem.c: For PR_1_RESERVED_BAD_MODE, print a description of the
reserved inode. In PR_0_JOURNAL_HAS_JOURNAL, prompt to clear the
journal, rather than deleting it (which is more accurate). (From
Andreas Dilger.)
hangeLog
roblem.c
6a6d3d44d6e90539007b8d32e6cb76f62a4af163 12-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, journal.c:
journal.c: Make sure all functions which return an error code use the
errcode_t return type, and not "int"
(e2fsck_journal_release): Add new parameter, "drop", which is used
when we just want to deallocate the journal without trying to write
out any changes.
(mark_buffer_clean): New function e2fsck_check_ext3_journal): If we
fail loading the journal, make sure we free all memory associated with
it.
(recover_ext3_journal): If we fail to load the journal or initialize
the revoke data structures, make sure we free all memory associated
with the journal.
hangeLog
ournal.c
721edd0eddcfb4ebdd4fba22338a674477795acd 12-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, super.c:
super.c: Minor whitespace cleanups, from Andreas Dilger.
mtrace.h:
mtrace.h: Minor whitespace cleanups, from Andreas Dilger.
ChangeLog, message.c:
message.c (special_inode_name): Add more special inode names (From
Andreas Dilger)
hangeLog
essage.c
trace.h
uper.c
58a75177cabbea82361d037978485b2d656c8c89 12-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, util.c:
util.c (fatal_error): Check to make sure the io_manager data structure
is sane before trying to flush the io_channel. (From Andreas Dilger)
hangeLog
til.c
4035f40bc4550ce7520724cc837992a700794e00 12-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass2.c:
pass2.c: Minor whitespace cleanups, from Andreas Dilger.
hangeLog
ass2.c
7e92dfae9e60947a20a2078b7871b073441dac44 12-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, journal.c, problem.c:
journal.c (e2fsck_journal_fix_bad_inode): Set pctx->ino to the bad
journal number.
problem.c (PR_0_JOURNAL_BAD_INODE): Use pctx->ino instead of pctx->num
when printing the bad journal inode number.
hangeLog
ournal.c
roblem.c
5ba23cb149f2ff629446fb8cb5f1012c05f7a4f4 11-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.h, flushb.c, iscan.c, unix.c:
iscan.c, unix.c, e2fsck.h: Don't use NOARGS, and use
ext2fs_sync_device() instead of using BLKFLSBUF.
flushb.c: Don't use NOARGS anymore; everything is STDC these days.
ChangeLog, pass1.c:
pass1.c (process_block): Remove dead code which was never getting
executed.
hangeLog
2fsck.h
lushb.c
scan.c
ass1.c
nix.c
86c627ec1136446409a0170d439e60c148e6eb48 11-Jan-2001 Theodore Ts'o <tytso@mit.edu> Many files:
dirinfo.c, e2fsck.h, emptydir.c, iscan.c, jfs_user.h, journal.c,
message.c, pass1.c, pass1b.c, pass2.c, pass3.c, pass4.c, pass5.c,
problem.h, scantest.c, super.c, swapfs.c: Change ino_t to ext2_ino_t.
hangeLog
irinfo.c
2fsck.h
mptydir.c
scan.c
fs_user.h
ournal.c
essage.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
roblem.h
cantest.c
uper.c
wapfs.c
95a5bc918f1a4dd06dd701a169a991f87e3a733e 11-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, problem.c:
problem.c: Fix another broken @F vs @f problem.
hangeLog
roblem.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
hangeLog
fs_user.h
ournal.c
ass1.c
ass1b.c
ass3.c
ecovery.c
evoke.c
uper.c
nix.c
til.c
d74edf4e86ab339908a0c8167bd795f0d3b14fd0 03-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, message.c, problem.c:
Whoops, @d was already taken by "directory". Use @v for device, and
re-order the listing of at-expansions to avoid this problem in the
future.
hangeLog
essage.c
roblem.c
f18996c8eb7f530a7a408b8ede4a99fd52c02533 03-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c, problem.c, problem.h:
pass1.c (e2fsck_pass1): Moved journal inode handling out to its own
block; if the journal inode is not in use, and it contains data, offer
to clear it.
problem.h, problem.c (PR1_JOURNAL_INODE_NOT_CLEAR): Add new problem
code.
problem.c: Modified problem table to use a new abbreviations.
hangeLog
ass1.c
roblem.c
roblem.h
e904406eb55dd5116b9a95690714b4c9abf786af 03-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, message.c:
Add @d abbreviation for device.
hangeLog
essage.c
1ce6453931d74a05d96c009983d342e524ab2912 03-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, message.c:
message.c: Add @j abbreviation for journal.
hangeLog
essage.c
cc7067b40bbd3e585da3031c1e06794107ff0d0b 03-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, Makefile.in, jfs_user.h:
jfs_user.h: Moved contents of jfs_e2fsck.h into jfs_user.h.
hangeLog
akefile.in
fs_user.h
8c2dc52180373f4e7b12e92669db59b1a52e2153 03-Jan-2001 Theodore Ts'o <tytso@mit.edu> journal.c:
Fix typo in comment.
ournal.c
d3f35b645154ea65ff7c955c862a796e2f281927 03-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, journal.c:
journal.c (e2fsck_check_ext3_journal): Force a fsck if we remove the
journal stored on a reserved inode. Also force a fsck if the journal
appears to exist while !NEEDS_RECOVERY, and we forcibly reset the
journal.
hangeLog
ournal.c
5dd8f963d04fa4099a003cb3b13ffae05ab29210 01-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, journal.c, pass1.c, super.c, unix.c:
journal.c, pass1.c, super.c, unix.c: Replace use of struct ext2fs_sb
with struct ext2_super_block.
ChangeLog, debugfs.c:
debugfs.c Replace use of struct ext2fs_sb with struct ext2_super_block.
hangeLog
ournal.c
ass1.c
uper.c
nix.c
f5ae75e5f0e1b509311fac5944167bc0d8674c38 01-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c:
pass1.c (check_blocks): Remove use of EXT2_HAS_*_FEATURE macros.
hangeLog
ass1.c
2fe1efe2e56dc9f8223992301aec3844dd9563e6 31-Dec-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, ext2fs.h:
ext2fs.h: Cleaned up header file by removing definitions of feature
flags that might not have been defined in older ext2 header files.
Now that we're using our own include/linux/ext2fs.h header file, this
can never happen.
jfs_dat.h: Removed old header file which is no longer needed.
ChangeLog:
jfs_compat.h: Remove uneeded header file.
hangeLog
c59a704b79cbb9e35050d4555b149b780149069d 31-Dec-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, mtrace.c, mtrace.h:
malloc.h, mtrace.c: Renamed malloc.h to mtrace.h to avoid conflicts
with the system header file.
hangeLog
trace.c
trace.h
b2f93192a1701855d4f5f05f0087c45e92a35681 30-Dec-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, journal.c, problem.h:
problem.h: Fixed numbering of pass1 error messages; an extra 0 had
slipped into some of the numbers. (Pointed out by Andreas Dilger)
journal.c (e2fsck_journal_fix_corrupt_super): Clean up unnecessary
automatic variable. Add explanatory comment about the kernel
emulation routines. (Suggested by Andreas Dilger)
hangeLog
ournal.c
roblem.h
c500767e1b60241bae4e1ee7bd2b7839287fd5c2 18-Dec-2000 Theodore Ts'o <tytso@mit.edu> .del-jfs.h~fa6593e8:
Remove unneeded file.
fs.h
9b5657591b1db9b82fe433f3f90e496f3df6a851 13-Dec-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, super.c:
super.c (release_orphan_inodes): Fix spelling typo in error message.
ChangeLog, unix.c:
unix.c (main): Clarify coments (no code changes)
ChangeLog, journal.c:
journal.c (e2fsck_check_ext3_journal): Check to make sure the journal
fields are consistent if any of the superblock fields are set. (Backs
out erroneous change made by sct, pointed out by Andreas.)
hangeLog
ournal.c
uper.c
nix.c
8188c9e6b3dc73c528ebaa6c65e7a96ccef807d1 13-Dec-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c:
pass1.c (e2fsck_pass1): Offer to update the filesystem revision level
if we need to set large files flag. Patch from Andreas Dilger.
hangeLog
ass1.c
a917d1ccf49605b3009f4e7225f00b81fc16100b 13-Dec-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, closefs.c, ext2fs.h, jump.funcs, super.c:
Rename _ext2fs_update_fs_dynamic_rev to _ext2fs_update_dynamic_rev
uper.c
7b59f1efb1c4ac53c64a2cc412acf5b056cc628b 13-Dec-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, super.c:
super.c (check_super_block): If we have any of the compatibility flags
set, we need to have a revision 1 filesystem. Most kernels will not
check the flags on a rev 0 filesystem and we may have corruption
issues because of the incompatible changes to the filesystem. Patch
from Andreas Dilger.
hangeLog
uper.c
060b5fbf807dca3ce5f977a693ac68e84c03d13e 13-Dec-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, problem.c, problem.h:
problem.c, problem.h (PR_0_FS_REV_LEVEL, PR_1_FS_REV_LEVEL): Add new
problem codes.
hangeLog
roblem.c
roblem.h
26900ae444e3585a52f6d37e231373a63404dac2 09-Dec-2000 Theodore Ts'o <tytso@mit.edu> flushb.c, findsuper.c:
Adjust legal language.
lushb.c
bf2d4999040f1165734777c10b17cc12b905e38a 09-Dec-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, flushb.c:
flushb.c: Fix flushb so that it does something other than waste disk
space when built on systems with modern header files and add a
non-subtle Copyright Licensing restriction so Yann will remove it from
the Debian Distribution. (Now violates the Debian Free Software
Guidelines, on purpose.)
hangeLog
lushb.c
f43650c30821900a6a7c9bdba72bb5f6cee6c484 09-Dec-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, journal.c:
journal.c (e2fsck_check_ext3_journal): If JFS_DEBUG is defined at the
top level, set the JFS debuging level to 2.
hangeLog
ournal.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.
hangeLog
akefile.in
fs_e2fsck.h
fs_user.h
ournal.c
ecovery.c
evoke.c
133a56dc9da52054bc27b4c1a23f03e3405003db 17-Nov-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, message.c, pass1b.c, pass2.c, pass3.c, problem.c, problem.h:
pass1b.c: Change routines to use PR_1B_BLOCK_ITERATE when reporting
problems rather than using com_err directly.
problem.c, problem.h (PR_1B_BLOCK_ITERATE): Add new problem code.
message.c (expand_percent_expression): Add safety check. If ctx->str
is NULL, print "NULL" instead of dereferencing the null pointer.
pass1b.c, pass2.c, pass3.c: Change calls to ext2fs_block_iterate to
ext2fs_block_iterate2, to support 64-bit filesizes and to speed things
up slightly by avoiding the use of the ext2fs_block_iterate's
compatibility shim layer.
version.h:
Update for WIP release.
hangeLog
essage.c
ass1b.c
ass2.c
ass3.c
roblem.c
roblem.h
3f65f1acaa1f32740fdbc03affe3dc95f9668bad 30-Oct-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, util.c:
util.c (get_backup_sb): Calculate backup superblock correctly when the
blocksize is > 1k.
hangeLog
til.c
241f224fb249243af20037d2145a1a0fe0f81581 26-Oct-2000 Theodore Ts'o <tytso@mit.edu> .del-jfs.h~fa6593e8, ChangeLog, jfs_compat.h, journal.c:
jfs.h, jfs_compat.h, journal.c: Updated to include the definition of
the new journal superblock format; still only supports V1 superblocks
for now. (From sct)
hangeLog
fs.h
fs_compat.h
ournal.c
8394902e04e64ed10ca81e869892c00143ee4931 25-Oct-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, journal.c, problem.c, problem.h, super.c:
super.c (release_inode_block, release_inode_blocks,
release_orphan_inodes): Add code to deal with truncating inodes which
are still in use (but which are on the orphan list because they need
truncation).
problem.c, problem.h: Rename PR_0_CLEAR_ORPHAN_INODE to
PR_0_ORPHAN_CLEAR_INODE, and remove PR_0_ORPHAN_INODE_INUSE.
journal.c (e2fsck_run_ext3_journal): Add i18n support, and print a
message when the journal is being recovered.
hangeLog
ournal.c
roblem.c
roblem.h
uper.c
b09a4b0c906db2e520296b31855b7947e889f514 24-Oct-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c:
pass1.c (e2fsck_pass1): Don't check the i_mode field for the journal
inode, if it is in use.
hangeLog
ass1.c
adfca56f9f7fb175b829a9f678c83ac7f7c87d1e 12-Sep-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, extend.c, flushb.c:
extend.c:
flushb.c: Add include of nls-enable.h which is necessary so that they
can compile correctly.
hangeLog
xtend.c
lushb.c
2575fb04439938a9ca3e34d06409cca378d84357 22-Aug-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
unix.c (main): If we're doing a read-only check, skip the journal
playback, but don't abort the e2fsck run.
hangeLog
nix.c
99a2cc969fb47e8c87965aa9fb93cabf6fe4ac1e 22-Aug-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, jfs_compat.h, journal.c, pass3.c:
jfs_compat.h (J_ASSERT):
journal.c (e2fsck_run_ext3_journal):
pass3.c (adjust_inode_count): Use fatal_error() instead of exit().
ChangeLog, super.c:
super.c (release_orphan_inodes): Fix typo; should do bounds checking
on next_ino instead of ino.
hangeLog
fs_compat.h
ournal.c
ass3.c
uper.c
243dc31f486f97e90845f389693b46b19d087f50 22-Aug-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
unix.c: Use fatal_error() instead of exit() whenever possible. Also
fix the fsck exit codes so that we use FSCK_USAGE when it is
appropriate. Rename global_signal_ctx to e2fsck_global_ctx and let it
be exported globally.
hangeLog
nix.c
cc96b2b0fe3ab012f716e1fc6955b8530480fec8 22-Aug-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, util.c:
util.c (fatal_error): Try to flush the I/O manager before forcing an
exit.
hangeLog
til.c
ecf1b7767e1772f4c6dba8f02026057ed05397bd 21-Aug-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, journal.c, message.c, problem.c, problem.h, super.c:
journal.c (e2fsck_journal_load): Fix **nasty** bug which caused
e2fsck_check_ext3_journal to smash the journal because
journal->j_transaction_sequence wasn't getting initialized.
journal.c: (recover_ext3_journal, e2fsck_run_ext3_journal): Move call
to e2fsck_clear_recover from recover_ext3_journal to after the
filesystem has been closed and reopened. Otherwise, the superblock in
the filesystem handle will probably be stale, and will overwrite the
newer version of the superblock written by the log recovery.
message.c (expand_inode_expression): Add support for %Iu and %Ig
problem.h (PR_0_CLEAR_ORPHAN_INODE): Add new problem code.
super.c (release_orphan_inodes, release_inode_block,
release_inode_blocks): Update the block group descriptor counts when
freeing the orphan inode. Use PR_0_CLEAR_ORPHAN_INODE to report when
we clear an orphan.
journal.c (e2fsck_run_ext3_journal): Fix a bug where we attempted to
reopen the filesystem using the device name instead of the filesystem
name.
hangeLog
ournal.c
essage.c
roblem.c
roblem.h
uper.c
25c63ba09fbdb5ab0f7385af156bd18165b3e76d 18-Aug-2000 Theodore Ts'o <tytso@mit.edu> super.c:
Remember to clear the orphaned inode list before starting to process it.
uper.c
80bfaa3e40ae6ab00cc3d4d1f4c0eeefce0b1a96 18-Aug-2000 Theodore Ts'o <tytso@mit.edu> Many files:
Makefile.in: Update the make dependencies
problem.c, problem.h: Add the problem codes:
PR_0_ORPHAN_ILLEGAL_BLOCK_NUM, PR_0_ORPHAN_ALREADY_CLEARED_BLOCK,
PR_0_ORPHAN_ILLEGAL_HEAD_INODE, PR_0_ORPHAN_ILLEGAL_INODE,
PR_0_ORPHAN_INODE_INUSE
super.c (release_inode_blocks, release_orphan_inodes,
check_super_block): Add support for clearing orphaned inodes from the
unmounted filesystem.
journal.c (e2fsck_recover_ext3_journal): Remove the last orphan check;
this is now handled in check_super_block --- non-journaled filesystems
can use the orphan list in the future. Also, move the the re-opening
of the filesystem to e2fsck_run_ext3_journal().
debugfs.c:
debugfs.c (finish_range): Make sure the pager FILE pointer to use.
configure, configure.in, ChangeLog:
configure.in (JFS_DEBUG): Add support for --enable-jfs-debug
hangeLog
akefile.in
ournal.c
essage.c
roblem.c
roblem.h
uper.c
nix.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.
hangeLog
akefile.in
2fsck.8.in
2fsck.h
fs.h
fs_compat.h
ournal.c
essage.c
roblem.c
roblem.h
ecovery.c
nix.c
b8d164cd2412edc65ba47c573f2abcc254dbbbc9 08-Aug-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
unix.c (calc_percent): Make sure that we don't take a floating
exception if the max value is zero. (should normally never happen,
but...)
hangeLog
nix.c
f9e67064ce720e9a8563038d07fe452ffed661bc 14-Jul-2000 Theodore Ts'o <tytso@mit.edu> configure.in:
Commit this file for future use; contains a configure.in script for when
libuuid gets separtead out into its own package.
libext2fs.texinfo:
Update version numbers for 1.19 release.
TODO:
Commit TODO list for 1.19 release.
README:
Update file for 1.19 release.
ChangeLog, e2fsprogs.spec:
e2fsprogs.spec: Merge in a few changes from the Red Hat 6.2 spec file,
now that we're using a modern rpm to build e2fsprogs. Also updated
version number to 1.19.
version.h:
Update version number for 1.19 release.
ChangeLog:
Check in changes for 1.19 release.
hangeLog
17390c047f5470eec005c5461a7926d03d6bbbe7 07-Jul-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, Makefile.in, e2fsck.h, journal.c, unix.c:
unix.c (check_if_skip): Modify algorithm for checking s_max_mnt_count
to match with the kernel. (If s_max_mnt_count is negative, ignore the
mnt_count check.)
unix.c (e2fsck_update_progress): Adjust the width of the progress bar
dynamically, based on the filesystem name that we need to display.
unix.c (main): If the ext3 needs_recovery flag is set, call
e2fsck_run_ext3_journal() and then restart the e2fsck run.
journal.c (e2fsck_run_ext3_journal): New file which contains logic to
recover the ext3 journal. This version relies on the kernel being
able to mount the filesystem in order to run the journal.
hangeLog
akefile.in
2fsck.h
ournal.c
nix.c
e4c8e885d20cd36ddbc563aed9edaa9fb96e2332 06-Jul-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, Makefile.in:
Makefile.in (install): Install resize2fs in /sbin, not /usr/sbin.
ChangeLog, unix.c:
unix.c: Also, re-arrange the logic so that we do the time check only
after doing the percentage check, and we only advance the spinner if
we're about to display it.
ChangeLog:
Fix minor wording error in Chagelog.
hangeLog
nix.c
9226904bfb091de44ef7758936c61148c5ccf997 05-Jul-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
unix.c (e2fsck_update_progress): Only save and check the last
percentage after multiplying it by 10, nor 1000, since we only need to
save values to a tenth of a percent (and the percentage is already
from 0 .. 100%, not 0 .. 1).
hangeLog
nix.c
9cbfb8d0d97f6c5400f94d86bcbedb094f970072 04-Jul-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c:
pass1.c (e2fsck_pass1): Check to see if the ext3 s_last_orphan field
is set; if so, clear it, so that ext3 mounting code won't get confused
by the fact that we've cleared out the orphaned inodes.
hangeLog
ass1.c
bbd47d76b7c12e98f9bf79b7c2582173252b4db6 10-Jun-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass5.c, problem.c, problem.h:
pass5.c (check_block_bitmaps, check_inode_bitmaps): Add error checking
for a "should never happen case".
problem.c, problem.h (PR_5_COPY_IBITMAP_ERROR,
PR_5_COPY_BBITMAP_ERROR): Add new error codes.
hangeLog
ass5.c
roblem.c
roblem.h
d647a1ea4db5fa4e4ed48573c63a1bde56e071db 27-May-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c, problem.c, problem.h:
pass1.c (pass1, check_size): Apply patch from Chris Wedgewood
(cw@foof.org) which checks to see if special devices have a non-zero
size, and deals with it.
problem.c, problem.h (PR1_SET_NONZSIZE): Add new problem code.
hangeLog
ass1.c
roblem.c
roblem.h
415ed79ebcb9a48172764c7e9339001f24ef5fa2 26-May-2000 Theodore Ts'o <tytso@mit.edu> Many files:
Remove generated file.
depend
7fd86d396745cf38ed5a3b91d1570440a8e770a1 26-May-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, getsize.c:
getsize.c: Under linux, manually define the ioctl for BLKGETSIZE if it
isn't already defined and it's safe to do so.
.cvsignore:
Ignore build files when builddir==srcdir
cvsignore
1d2792181f5d178769d6d53d86443601537b041f 19-May-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, Makefile.in:
Makefile.in (install): Create a symbolic link for fsck.ext3 as well.
ChangeLog, e2fsprogs.spec:
e2fsprogs.spec (fsck.ext3): Add /sbin/fsck.ext3 to the spec file.
hangeLog
akefile.in
4ea0a1109d761e9caaa53f6fa9e036321826c5fa 08-May-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, problem.c, problem.h, super.c:
problem.c, problem.h (PR_0_HURD_CLEAR_FILETYPE): Add new problem code.
super.c (check_super_block): If the OS type in the superblock is the
Hurd, check to see if the filetype feature is set, and offer to clear
it if so. This needs to be done since the Hurd doesn't properly
support the filetype feature. (And since the hurd allows the
transmogrification of files to special files and vice versa --- for no
good reason that I can understand --- it can't support the filetype
feature for the forseeable future, either.)
ChangeLog, mke2fs.c:
mke2fs.c (main): We forcibly turn off the filetype feature if the OS
is the hurd, since the hurd doesn't support it. (And since the hurd
allows the transmogrification of files to special files and vice versa
--- for no good reason that I can understand --- it can't support the
filetype feature for the forseeable future, either.)
mke2fs.c (proceed_question): Fix reversed sense of proceed_question
that was busted due to the internationalization patch. Fixed bug
where if proceed_question was called twice, the input buffer wasn't
cleared of the previous question's newline.
ChangeLog, expect.1, expect.2, image.gz, name:
f_hurd: Add test for Hurd-specific features (right now, just checks to
make sure the filetype feature is cleared)
ChangeLog, ls.c:
ls.c (list_super): Change the string displayed for the Hurd to be
GNU/Hurd, instead of just "GNU".
hangeLog
roblem.c
roblem.h
uper.c
373b8337c7b6c6243810be250083fa4773891e92 03-Apr-2000 Theodore Ts'o <tytso@mit.edu> Many files:
badblocks.c, dumpe2fs.c, e2label.c, mke2fs.c, tune2fs.c, uuidgen.c:
For platforms that don't define optarg.h, manually define optarg and
optind.
ChangeLog, main.c:
main.c: For platforms that don't define optarg.h, manually define
optarg and optind.
ChangeLog, unix.c:
unix.c: For platforms that don't define optarg.h, manually define
optarg and optind.
hangeLog
nix.c
01fbc701413a4975e6ed551ae6ccb8bb791ea515 03-Apr-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c, problem.c:
pass1.c (check_immutable, e2fsck_pass1_check_device_inode): Check for
the append-only as well as the immutable flag.
problem.c (PR_1_SET_IMMUTABLE): Adjust message to include append-only
flag. Fix comment for compression flag.
hangeLog
ass1.c
roblem.c
0601232332e080aac1a19748e78c22021c7815c4 12-Feb-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.h, unix.c:
unix.c (e2fsck_update_progress): Limit the number of updates to the
progress bars to 8 times a second. This allows a 9600 baud console
link to keep up.
hangeLog
2fsck.h
nix.c
1917875fcd16428d14eb5a86acf414472bc216f1 11-Feb-2000 Theodore Ts'o <tytso@mit.edu> Many files:
unix.c (main): If compression is enabled on the filesystem, print a
warning message (for now).
message.c: Add new compression shortcut: @c == compress
problem.c, problem.h (PR_1_COMPR_SET): Add new error code.
pass1.c (check_blocks): If the inode has EXT2_COMPRBLK_FL flag set,
check to see if the filesystem supports compression. If it does pass
this information down to process_block() so it can treat the
compressed block flag words correctly. If not, offer to clear the
flag, since it shouldn't be set.
(process_block): If an inode has the compressed inode flag set, allow
EXT2FS_COMPRESSED_BLKADDR.
pass1b.c (process_pass1b_block, delete_file_block, clone_file_block):
pass2.c (deallocate_inode_block): Use HOLE_BLKADDR to check to see if
the block can be skipped.
ChangeLog, Makefile.in:
Makefile.in: Exclude the internationalization files from being
distributed.
ChangeLog, configure, configure.in:
configure.in: Add support for --enable-compression. This is
experimental code only for now, which is why it's under --enable test.
Once it's stable, it will always be compiled in.
TODO:
Commit additional TODO items.
hangeLog
essage.c
ass1.c
ass1b.c
ass2.c
roblem.c
roblem.h
nix.c
4ee4ad37576cb9091c22547fb6916b33761b54f8 09-Feb-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog:
util.c: Make resource tracking message more concise.
hangeLog
80c5d7e45ffa2d2e6d95eef99598c64e9a96d9c0 09-Feb-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.h, pass1.c, pass1b.c:
e2fsck.h:
pass1.c (mark_table_blocks, e2fsck_pass1): Remove
ctx->block_illegal_map, since it's not needed by pass1, and pass1b has
been modified to calculate it manually if needed. This reduces the
memory footprint needed by e2fsck.
pass1b.c (check_if_fs_block): New static function which returns
whether or not a block overlaps with filesystem metadata. This
replaces consulting the block_illegal_map bitmap.
util.c:
Make resource tracking message more concise.
hangeLog
2fsck.h
ass1.c
ass1b.c
til.c
28ffafb09c6fd8a9ebe716c06b02143771a9b17f 08-Feb-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, bitops.h:
bitops.h (ext2fs_mark_generic_bitmap, ext2fs_unmark_generic_bitmap,
ext2fs_mark_block_bitmap, ext2fs_unmark_block_bitmap,
ext2fs_mark_inode_bitmap, ext2fs_unmark_inode_bitmap): Change to
return the previous state of the bit that is being marked or unmarked.
For speed optimization.
ChangeLog, pass3.c:
pass3.c (check_directory): Only do the loop detection algorithm if
we've searched over 2048 parent directories and haven't found the end
yet. This means that in the common case, we don't allocate or clear
the inode_loop_detection bitmap, which for large systems, merely
clearing the bitmap for each directory was turning out to be quite
expensive. Thanks to Jani Jaakkola (jjaakkol@cs.helsinki.fi) for
identifying this problem.
ChangeLog, Makefile.in, e2fsck.h, unix.c:
Makefile.in: Call sync after finishing building all in this directory.
unix.c (PRS): sync the filesystem before trying to use BLKFLSBUF, to
minimize the chance of causing dirty blocks to get dropped.
e2fsck.h: Manually define BLKFLSBUF if not defined, and we're on a
Linux/i386 system.
hangeLog
akefile.in
2fsck.h
ass3.c
nix.c
0c4a07264e55b42c6e30230e66b1dea7d4b94ea9 07-Feb-2000 Theodore Ts'o <tytso@mit.edu> Many files:
badblocks.c, e2fsck.h, ehandler.c, emptydir.c, extend.c, flushb.c,
iscan.c, message.c, pass1.c, pass1b.c, pass3.c pass4.c, pass5.c,
problem.c, scantest.c, swapfs.c, unix.c, util.c: Add
Internationalization support as suggested by Marco d'Itri
<md@linux.it>.
hangeLog
adblocks.c
2fsck.h
handler.c
mptydir.c
xtend.c
lushb.c
scan.c
essage.c
ass1.c
ass1b.c
ass3.c
ass4.c
ass5.c
roblem.c
cantest.c
wapfs.c
nix.c
til.c
80e808fceb61c2061b32593c610893bf07a863ee 02-Feb-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, debugfs.c:
debugfs.c (dump_inode): Remove #ifdef for i_version vs. i_generation
since we know it will always be i_generation now.
ChangeLog, e2fsck.h, flushb.c, scantest.c:
e2fsck.h, flushb.c, scantest.c: Remove uneeded include of linux/fs.h
bmap.c:
Fix silly spelling typo.
ChangeLog, getsize.c, ismounted.c, swapfs.c:
getsize.c, ismounted.c: Remove unneeded include of linux/fs.h
swapfs.c: Remove #ifdef HAVE_EXT2_INODE_VERSION since it's not needed
any more; we know it will always be i_generation. Add support for
swapping the high bits of the uid and gid.
hangeLog
2fsck.h
lushb.c
cantest.c
894edb2eaf913fa2294d26c7bbc2fd0c7306dbc3 18-Jan-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, Makefile.in:
Makefile.in: Since LIBUUID can sometimes include "-lsocket" we need a
separate DEPLIBUUID that can be used in Makefile's dependency rules.
hangeLog
akefile.in
a1ccadb4ad7bcb74e4fb3e70a047b2ed95a2a7f6 23-Nov-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.8.in:
e2fsck.8.in: Update language about where to find a backup superblock.
hangeLog
2fsck.8.in
86a63e92eb4a957d8e24795cefd2f7058e4aec30 23-Nov-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c:
pass1.c (process_inodes): Add shortcut handling; if
process_inodes_count is zero, return right away, to avoid calling
qsort with a non-positive count.
hangeLog
ass1.c
ec8d2c3f6e57a275100a222629a5fe0f70663355 19-Nov-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, message.c:
message.c (safe_print): Fix to properly display ^A, ^B, etc. and to
print Delete as ^?
hangeLog
essage.c
5c36a2f85b4f8648ed7916c7e5d489dea09c1a37 19-Nov-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, Makefile.in:
Makefile.in (distclean): Remove TAGS and Makefile.in.old from the
source directory. Also, when making the .exclude file for the
source_tar_file, exclude those two files as well.
Makefile.in (distclean): Remove TAGS and Makefile.in.old from the
source directory.
hangeLog
akefile.in
cd08636179a07e95e36d307ce2b158e7b276b1e5 10-Nov-1999 Theodore Ts'o <tytso@mit.edu> libext2fs.texinfo, ChangeLog:
Update for 1.18 release.
hangeLog
a846d2f49996c7675cd21da30956272422b67c81 10-Nov-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, problem.c, problemP.h:
problem.c (fix_problem): Support a new flag, PR_PREEN_NO which means
the answer is assumed to be no in preen mode. This is now used in the
PR_1_SET_IMMUTABLE code, so that in preen mode we ignore these inodes
and just print a warning message.
hangeLog
roblem.c
roblemP.h
6fdc7a325c8bff67fc3a0489d0858bc7c48dc1a3 10-Nov-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.h, pass1.c, pass2.c, pass3.c, problem.c, problem.h, util.c:
pass1.c (e2fsck_pass1): If the filesystem does not support imagic
inodes, if an inode has the imagic flag set, offer to clear the imagic
flag. If a valid device/fifo/socket has the immutable flag set, call
the new helper function check_immutable() to offerto clear the
immutable flag.
pass2.c (check_filetype): Use the new ext2_file_type() helper function
instead of calculating the file_type information manually.
pass3.c (e2fsck_reconnect_file): When adding a link to lost+found,
calculate the filetype information so that ext2fs_link() can use the
information if applicable. (get_lost_and_found): Create the
/lost+found directory with the correct filetype information if
applicable.
util.c (ext2_file_type), e2fsck.h: New function which returns the
directory entry file type information given the inode's mode bits.
problem.c, problem.h: Added new problem codes PR_1_SET_IMAGIC and
PR_1_SET_IMMUTABLE.
ChangeLog, mke2fs.8.in:
mke2fs.8.in: Update manual page so that the sparse_option filesystem
option is properly named.
hangeLog
2fsck.h
ass1.c
ass2.c
ass3.c
roblem.c
roblem.h
til.c
7142db08c4e54a863fea2e757c6d3afa42ba2290 08-Nov-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.c, pass4.c, problem.h, unix.c:
pass4.c (e2fsck_pass4): Clear inode_imagic_map after freeing it, to
prevent it from getting freed twice.
unix.c (main): Close the filesystem before freeing the context, so
that in the event of a free()-related segmentation violation, the
filesystem is properly closed and written out.
e2fsck.c (e2fsck_reset_context): When freeing ctx->inode_reg_map, we
weren't zero'ing ctx->inode_reg_map, which could cause a segfault
later on in the e2fsck run.
problem.h (PR_2_SPLIT_DOT): Fix excess zero in problem code (now
matches the standard convention).
hangeLog
2fsck.c
ass4.c
roblem.h
nix.c
28e1194e6537c8448b4ce322dc13a9d781ce22b9 26-Oct-1999 Theodore Ts'o <tytso@mit.edu> Many files:
Update for 1.17 release.
hangeLog
f68aa41476b0d7f43e85413fd08d7cfc8f916ea6 26-Oct-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, debugfs.c, debugfs.h:
debugfs.h: Add declaration for do_features()
debugfs.c: Add #incldue of e2p.h to fix gcc warnings.
ChangeLog, message.c:
message.c (safe_print): Make safe_print take an char instead of an
unsigned char to fix gcc warnings.
hangeLog
essage.c
c81c6ce57efe7324551a96ce55bc877cf215c1ca 26-Oct-1999 Theodore Ts'o <tytso@mit.edu> util.c:
Fix stupid bugs in NT portability patch.
ChangeLog, configure, configure.in:
Add termios.h to the headers which are checked.
til.c
e6597048d9d1637c9f997363a7f45c74b98fd0e2 26-Oct-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, mke2fs.c:
mke2fs.c (PRS): Use __u64 instead of long long for portability
reasons.
Moved #include of sys/stat.h inside #ifdef HAVE_LINUX_MAJOR_H for
portability reasons.
ChangeLog, util.c:
util.c: For NT portability, don't redefine getchar(), since stdio
defines that. Instead we introduce a new abstract macro read_a_char()
which is #defined to the right function as necessary.
hangeLog
til.c
c40db6d5717023bdd6bb4935161e7ce9678d6234 25-Oct-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass2.c, problem.c, problem.h:
problem.c, problem.h (PR_2_NULL_NAME): Add new problem code.
pass2.c (check_dir_block): Require that the length of the directory
entry be at least 12 bytes. Check to see if the filename is
zero-length, and flag that as an error.
hangeLog
ass2.c
roblem.c
roblem.h
614fdfd5d978a9e58c25cb4ff7f5b634063c1e6a 23-Oct-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog:
Update for 1.16 release.
libext2fs.texinfo:
Update version number for 1.16 release.
hangeLog
7847c1d4fff9195c16b6d74194d104200b3f6c67 22-Oct-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass2.c, problem.c, problem.h:
pass2.c (check_filetype): If the filetype filesystem feature is not
set, and a directory entry has a dirent feature, offer to clear it
(since 2.0 kernels will do complain will interpret it as a very large
name length field).
hangeLog
ass2.c
roblem.c
roblem.h
caf8ce4cc497b22cca26e1063183e58391c1b3a0 21-Oct-1999 Theodore Ts'o <tytso@mit.edu> Many files:
badblocks.8.in, chattr.1.in, dumpe2fs.8.in, e2label.8.in,
fsck.8.in, lsattr.1.in, mke2fs.8.in, mklost+found.8.in,
tune2fs.8.in, uuidgen.1.in: Update man page to use a more standard
format (bold option flags and italicized variables), as suggested by
Andreas Dilger (adilger@enel.ucalgary.ca)
ChangeLog, e2fsck.8.in:
e2fsck.8.in: Update man page to use a more standard format (bold
option flags and italicized variables), as suggested by Andreas Dilger
(adilger@enel.ucalgary.ca)
ChangeLog, uuid_generate.3.in:
uuid_generate.8.in: Update man page to use a more standard format
(bold option flags and italicized variables), as suggested by Andreas
Dilger (adilger@enel.ucalgary.ca)
hangeLog
2fsck.8.in
aa4115a47c554a936fdf5e6679e72a9329fecf45 21-Oct-1999 Theodore Ts'o <tytso@mit.edu> Many files:
pass4.c (e2fsck_pass4): If an inode is set in the inode_imagic_map
bitmap, don't check to see if it is disconnected from the inode tree
(because it almost certainly will be). Free inode_imagic_map at the
end of pass 4.
pass2.c (check_dir_block, check_filetype): If the FILETYPE feature is
set, check the directory entry's filetype information field, and
fix/set it if necessary. (e2fsck_pass2): Free the inode_reg_map
bitmap at the end of pass 2.
pass1.c (e2fsck_pass1, alloc_imagic_map): Allocate and fill in
information for inode_reg_map and inode_imagic_map, which indicates
which inodes are regular files and AFS inodes, respectively.
Since only the master superblock is written during a restart, force
that superblock to be used after a restart; otherwise changes to the
block group descriptors end up getting ignored.
problem.c, problemP.h: If e2fsck is run -n, make def_yn variable be 0
for "no". Add support for a new flag, PR_NO_NOMSG, which supresses
the problem message if e2fsck is run with the -n option.
problem.c, problem.h (PR_2_SET_FILETYPE, PR_2_BAD_FILETYPE): Add new
problem codes.
message.c (expand_dirent_expression): Add support for %dt which prints
the dirent type information.
e2fsck.c (e2fsck_reset_context): Free new bitmaps (inode_reg_map and
inode_imagic_map).
e2fsck.h (e2fsck_t): Add new inode_reg_map and inode_magic_map to the
context structure.
ChangeLog, nt_io.c:
nt_io.c: New file which supports I/O under Windows NT.
ChangeLog, gen_uuid_nt.c:
gen_uuid_nt.c: New file which creates a UUID under Windows NT.
Many files:
Add support for non-Unix compiles
hangeLog
2fsck.c
2fsck.h
essage.c
ass1.c
ass2.c
ass4.c
roblem.c
roblem.h
roblemP.h
78cf05478d9b97e458212bffad5c782a7e543326 20-Oct-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, super.c:
super.c (check_super_block): Check to see whether the inodes_per_group
value in the superblock is insanely too high.
hangeLog
uper.c
9ecd8becf46c32ed18e468fe647947b359d25cdb 20-Oct-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c, util.c:
unix.c (PRS), util.c (ask_yn): Add #ifdef's to make e2fsprogs easier
to port to non-Unix platforms.
hangeLog
nix.c
til.c
c1faf9cc3a2418c536eee472f054c9604ad3f213 14-Sep-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1b.c:
pass1b.c (clone_file_block): Don't clear the dup_map flag if the block
also shares data with the fs metadata when the count drops to 1, since
the block should still be cloned, as fs metadata isn't included in the
count.
ChangeLog, pass3.c:
pass3.c (adjust_inode_count): Fix bug where we didn't keep the
internal and external inode counts in sync when we decremented an
inode whose link count was already zero. Now we skip incrementing or
decrementing both link counts if we would cause an overflow condition.
(expand_dir, expand_dir_proc): Change where we update the inode block
count and size files so that the block count field is updated
correctly when we create an indirect block.
hangeLog
ass1b.c
ass3.c
657cb97522332b1adcd871bf8f0949e9c8d8f231 31-Jul-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog:
Add 1.15 release note to the Changelogs.
hangeLog
3ac9f0efa1b5f24b0a04721addb96d1a604b3c83 19-Jul-1999 Theodore Ts'o <tytso@mit.edu> Makefile.in:
Add flushb to list of files which are removed when doing a make clean.
Add a distclean production which removes Makefile
Add the doc substree to the clean and distclean rules.
akefile.in
b55199eaf749c0d843955091ab6a9f4d0aca3213 19-Jul-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
unix.c (usage): Add minimalist emergency help to the usage message.
hangeLog
nix.c
5596defa1e212242c1bf1b028139143fbb7777a0 19-Jul-1999 Theodore Ts'o <tytso@mit.edu> Many files:
unix.c: Add support for calculating a progress bar if the -C0 option
is given. The function e2fsck_clear_progbar() clears the progress bar
and must be called before any message is issued. SIGUSR1 will enable
the progress bar, and SIGUSR2 will disable the progress bar. This is
used by fsck to handle parallel filesystem checks. Also, set the
device_name from the filesystem label if it is available.
e2fsck.h: Add new flags E2F_FLAG_PROG_BAR and E2F_FLAG_PROG_SUPRESS.
Add new field in the e2fsck structure which contains the last tenth of
a percent printed for the user.
message.c (print_e2fsck_message): Add call to e2fsck_clear_progbar().
pass1.c (e2fsck_pass1):
pass2.c (e2fsck_pass2):
pass3.c (e2fsck_pass3):
pass4.c (e2fsck_pass4):
pass5.c (e2fsck_pass5): Add call to e2fsck_clear_progbar when printing
the resource tracking information.
pass5.c (check_block_bitmaps, check_inode_bitmaps): If there is an
error in the bitmaps, suppress printing the progress bar using the
suppression flag for the remainder of the check, in order to clean up
the display.
hangeLog
2fsck.8.in
2fsck.h
essage.c
ass1.c
ass2.c
ass3.c
ass4.c
ass5.c
nix.c
6c133523b23aa6cdae2da2dc35aeaac1904539a4 03-Jul-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, MCONFIG.in, configure.in, configure:
MCONFIG.in (BUILD_CC):
configure.in (BUILD_CC): If cross compiling, find the native C
compiler and set it to BUILD_CC so that we can successfully build
util/subst.
ChangeLog, Makefile.in:
Makefile.in (subst): Build subst using $(BUILD_CC), since it's a
helper program which must be built using the native C compiler during
a cross-compilation.
Makefile.in:
Update dependencies.
akefile.in
c54b3c3c99a5d3011f6f60934e90dae7f60b3b00 03-Jul-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass3.c:
Fix some stupid spelling typo's.
ChangeLog:
Fix e-mail address.
hangeLog
ass3.c
74033350068c1e8be90fdc555cb9afbf12609110 01-Jul-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
unix.c (check_mount): Clean up the abort message displayed when the
filesystem is mounted and either stdout or stdin isn't a tty.
hangeLog
nix.c
e72a9ba39471364ad2f9397f645ca547090e3485 25-Jun-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.h, pass1.c, pass2.c, pass4.c, swapfs.c:
e2fsck.h:
pass1.c (pass1_get_blocks, pass1_read_inode, pass1_write_inode,
pass1_check_directory, e2fsck_use_inode_shortcuts): Make pass1_* be
private static functions, and create new function
e2fsck_use_inode_shortcuts which sets and clears the inode shortcut
functions in the fs structure.
e2fsck.h:
pass2.c (e2fsck_process_bad_inode): Make process_bad_inode() an
exported function.
pass4.c (e2fsck_pass4): Call e2fsck_process_bad_inode to check if a
disconnected inode has any problems before connecting it to
/lost+found. Bug and suggested fix by Pavel Machek <pavel@bug.ucw.cz>
ChangeLog, swapfs.c:
swapfs.c (ext2fs_swap_inode): Add compatibility for Linux 2.3 kernels
that use i_generation instead of i_version. Patch supplied by Jon
Bright <sircus@sircus.demon.co.uk>.
ChangeLog, mke2fs.8.in:
mke2fs.8.in: Fix typo in man page which caused the badblocks command
to not show up in the "SEE ALSO" section.
ChangeLog, expect.1, expect.2, image.gz, name:
f_recnect_bad: New test which checks the case where a disconnect inode
also bad inode fields; we need to make sure e2fsck offers to fix the
inode (or clear the inode, as necessary).
hangeLog
2fsck.h
ass1.c
ass2.c
ass4.c
wapfs.c
813bbb25a24ebba5177da18be413ea742efe5a8a 22-Jun-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, dir_iterate.c:
dir_iterate.c (ext2fs_process_dir_block): Check for corrupted
directory entry before calling the callback function. This should
prevent some core dumps of insufficiently paranoid callback functions.
ChangeLog, unix.c:
unix.c (main): Add missing space in the disk write-protected message.
hangeLog
nix.c
d4b0ce03168d313e89110ab9fbaa6caf616d1786 18-Jun-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, problem.c, problem.h, super.c:
problem.c, problem.h (PR_0_INODE_COUNT_WRONG): Add new problem code.
super.c (check_super_block): Add check to make sure the total number
of inodes is sane, since this can be calculated from the number of
groups times the number of inodes per group. Offer to correct it if
it is incorrect.
hangeLog
roblem.c
roblem.h
uper.c
e79d1b23edd7ce551030128bfe12821f4412cc89 18-Jun-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass5.c:
pass5.c (check_block_end): Fix fencepost condition where when clearing
the block padding we were missing the last position in the bitmap.
hangeLog
ass5.c
75d83bec5ff7c29d68f725b75b72e3465f1378df 18-May-1999 Theodore Ts'o <tytso@mit.edu> unix.c, ChangeLog:
unix.c (reserve_stdio_fds): Add safety check in case reserve_stdio_fds
couldn't open /dev/null.
hangeLog
nix.c
4a9f59366b3c5503bde40e9566dc996a0a40626f 16-Mar-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass3.c, problem.c, problem.h, util.c:
util.c (print_resource_track): Use mallinfo if present to get more
accurate malloc statistics.
pass3.c (get_lost_and_found): Check to see if lost+found is a plain
fail; if so, offer to unlink it.
problem.c, problem.h (PR_3_LPF_NOTDIR): Add new problem code.
problem.c: Fix problem message for PR_1_BAD_GROUP_DESCRIPTORS so that
the block group number is printed. Add new prompt, PROMPT_UNLINK.
hangeLog
ass3.c
roblem.c
roblem.h
til.c
9e51eca782b8e17a1ec87944ccbeac94c7c8e2a1 09-Jan-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, message.c:
message.c (safe_print): New function which prints strings, converting
non-printable characters using the '^' and M-notation. This function
is now used to print directory name entries and pathnames.
ChangeLog:
Update for release of E2fsprogs 1.14.
hangeLog
essage.c
73f17cfc391221a5466e95c9dc1802564ce38973 04-Jan-1999 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
unix.c (main): Reset the context before calling ext2fs_close(), to
avoid referencing already freed memory.
ChangeLog, llseek.c:
llseek.c (ext2fs_llseek): Change ext2fs_llseek() in the non-Linux case
to use EINVAL by default, unless it isn't defined, in which case we
use EXT2_ET_INVALID_ARGUMENT instead.
ChangeLog, mk_cmds.sh.in:
mk_cmds.sh.in: Fixed portability bug in shell script; we were
depending on a bash'ism.
ChangeLog, uuid.c:
uuid.c: Use asm/types.h instead of linux/types.h, to be consistent
with other locations where we've had to do this to work around glibc.
hangeLog
nix.c
556ad1327feb34ea5b711eb9c135f8e11415cf53 19-Dec-1998 Theodore Ts'o <tytso@mit.edu> Many files:
Update version information in ChangeLogs, release notes,
documentation, etc. for release of version 1.13.
hangeLog
5a679c8fb15540f86fc2eae3117412adc6ecbb33 03-Dec-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass3.c, problem.c:
pass3.c (get_lost_and_found): If the filesystem is not opened
read-only, then force /lost+found to be created if it is not present.
problem.c: Allow PR_3_NO_LF_DIR to be handled during a preen operation.
ChangeLog, Makefile.in:
Makefile.in: Updated dependencies.
ChangeLog, fsck.c:
fsck.c (load_fs_info): Parse /etc/fstab ourselves, instead of relying
on getmntent(). This has the advantage of allowing us to properly
handle missing pass numbers correctly.
ChangeLog, configure.in:
configure.in: Add paths.h to header files for which we search.
hangeLog
akefile.in
ass3.c
roblem.c
1dde43f0c1176f61dd0bf91aff265ce8cd1c5fd6 14-Nov-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, mke2fs.c, tune2fs.8.in:
tune2fs.8.in: Fix minor display bug in the nroff.
mke2fs.c (show_stats, write_inode_tables): Use the log10 function to
calculate the display of block numbers so that things look nice on an
80 character display.
mke2fs.c (usage): Add the sparse-super-flag to the usage message.
ChangeLog, e2fsck.c, pass1.c, pass2.c, problem.c, problem.h, unix.c:
unix.c (main): Move ext2fs_close() after e2fsck_free_context() since
e2fsck_free_context may reference data in ctx->fs.
e2fsck.c (e2fsck_reset_context): Make sure ctx->fs is non-NULL before
checking ctx->fs->dblist.
pass1.c (e2fsck_pass1): Use the device check subroutine on FIFO's and
Socket's, so that we catch bogus immutable inodes.
pass2.c (process_bad_inode): Process bad socket and fifo's.
problem.h, problem.c: Define new problem codes PR_2_BAD_FIFO and
PR_2_BAD_SOCKET.
hangeLog
2fsck.c
ass1.c
ass2.c
roblem.c
roblem.h
nix.c
7f813ba33711902f5e557da49f98622532e7556d 03-Sep-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass3.c, pass4.c, problem.c, problem.h, super.c:
problem.c: Add PR_3_NO_DIRINFO error code.
super.c (check_super_value): Rename min and max to min_val and max_val
to avoid possible cpp macro conflicts.
pass4.c (e2fsck_pass4): Rename max to maxgroup, to avoid possible cpp
macro conflicts.
pass3.c (e2fsck_pass3): Rename max to maxdirs, to avoid possible cpp
macro conflicts.
(check_directory): Fix logic to avoid possible core dump in the
case of ext2fs_get_dir_info returning NULL. (By the time we get here,
it should never happen, but...). Also simply/streamline the control
flow of the function.
hangeLog
ass3.c
ass4.c
roblem.c
roblem.h
uper.c
24fc5032b5bcc7c3bc25acdcd0cd822afed3f9c5 26-Aug-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
unix.c (check_if_skip): Move the "not cleanly mounted" check ahead of
the maximal mount and too long since checked tests.
(reserve_stdio_fds): Make sure 0,1,2 file descriptors are open, so
that we don't open the filesystem using the same file
descriptor as stdout or stderr.
hangeLog
nix.c
f75c28de4731c2cd09f6ca1a23e25c968a1edc2f 01-Aug-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.c, pass2.c, pass3.c, unix.c:
pass2.c (e2fsck_pass2): Fix the progress accounting so that we get to
100%.
pass3.c (e2fsck_pass3): Change progress accounting to be consistent
with the other e2fsck passes.
e2fsck.c (e2fsck_run): At the end of each pass, call the progress
function with the pass number set to zero.
unix.c (e2fsck_update_progress): If the pass number is zero, ignore
the call, since that indicates that we just want to deallocate any
progress structures.
emptydir.c:
Commit partially done file.
ChangeLog, badblocks.c:
badblocks.c (ext2fs_badblocks_list_add): Use a bigger increment than
10 blocks when we need to expand the size of the badblocks list.
hangeLog
2fsck.c
mptydir.c
ass2.c
ass3.c
nix.c
4a5fa192122c996e7e42908ef9eb4fc2f1f99277 09-Jul-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, .del-ChangeLog~905e7699, version.h:
Update for 1.12 release.
hangeLog
8144d6799543913fb6b4da29b421d0e3196b1c58 09-Jul-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
unix.c (main): Fix typo in checking the incompat feature set; it
should be checked against EXT2_LIB_FEATURE_INCOMPAT_SUPP.
hangeLog
nix.c
1fad9048b51f66df8813022f33a48fbf7a0a26b7 07-Jul-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, badblocks.c:
badblocks.c (test_disk): Don't clear the existing bad blocks list when
using e2fsck -c, since it may cause blocks with marginal errors to be
dropped from the bad blocks list.
hangeLog
adblocks.c
874b4d262e9664c08622611087c341f6aa242bc8 06-Jul-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c:
pass1.c (e2fsck_pass1): Use ext2fs_sb structure for compatibility with
older kernels.
hangeLog
ass1.c
818180cdfcff84b9048ecdc5dc86323f0fefba24 27-Jun-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, debugfs.8.in, debugfs.c:
Add a -V option which displays the current version.
ChangeLog, unix.c:
unix.c (e2fsck_update_progress): Remove unused variables.
ChangeLog, inode.c:
inode.c (get_next_blockgroup): Fix bug where if get_next_blockgroup()
is called early because of a missing inode table in a block group, the
current_inode counter wasn't incremented correctly.
ChangeLog, tst_uuid.c:
tst_uuid.c (main): Fixed bogus declaration of the main's argv parameter.
ChangeLog, test_icount.c:
test_icount.c (main): Fix main() declaration so that it returns int,
not void.
Many files:
fsck.c (ignore): Remove unused variable cp.
chattr.c (fatal_error):
tune2fs.c (usage):
lsattr.c (usage):
dumpe2fs.c (usage):
badblocks.c (usage): Remove volatile from declaration.
fsck.c: Change use of strdup to be string_copy, since we don't trust
what glibc is doing with strdup. (Whatever it is, it isn't pretty.)
hangeLog
nix.c
9d1bd3de8dd44603a8141dbe4f0b2057dbdc5ea7 10-Jun-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c, problem.h:
pass1.c, problem.h: Change blkcnt_t to be e2_blkcnt_t to avoid
collision with LFS API.
pass1.c (e2fsck_pass1): Fix bug so that ext2_max_sizes is properly
initialized.
(e2fsck_pass1): Don't allow the the boot loader inode to be a
directory (clear the inode mode field if so).
hangeLog
ass1.c
roblem.h
efac9a1b8d87d753b1c7989d9c05979c3c9c1a53 07-May-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.8.in, e2fsck.h, pass5.c, unix.c:
unix.c (PRS): Added new option -C, which causes e2fsck to print
progress updates so that callers can keep track of the completion
progress of e2fsck. Designed for use by progress, except for -C 0,
which prints a spinning report which may be useful for some users.
pass5.c (e2fsck_pass5): Use a finer-grained progress reporting scheme
(useful for larger filesystems).
e2fsck.h: Add progress_fd and progress_pos, for use by the Unix
progress reporting functions.
hangeLog
2fsck.8.in
2fsck.h
ass5.c
nix.c
4c77fe50d97a773e32a4756c79dade3adbb6a601 30-Apr-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.h, pass1.c, super.c:
pass1.c (process_inode_cmp): Use EXT2_QSORT_TYPE to define the
appropriate return type for comparison functions for qsort.
e2fsck.h: Add #ifdef protection for unistd.h
super.c: Remove header files already included by e2fsck.h
ChangeLog, dblist.c, ext2fs.h:
ext2fs.h: Define EXT2_QSORT_TYPE appropriately for the return type for
comparison functions for qsort.
dblist.c (dir_block_cmp): Use EXT2_QSORT_TYPE in function declaration.
ChangeLog, extent.c:
extent.c (ext2fs_create_extent_table): Use ext2fs_free_mem instead of
free().
(extent_cmp): Use EXT2_QSORT_TYPE to define the appropriate return
type for comparison functions for qsort.
hangeLog
2fsck.h
ass1.c
uper.c
76f875daa1c9c2cdc72f0c6f0f7be4bbc7f0fc07 27-Apr-1998 Theodore Ts'o <tytso@mit.edu> Many files:
ext2fs.h, bitops.h: Add support for the Watcom C compiler to do inline
functions.
ext2fs.h, dosio.c: Use asm/types.h instead of linux/types.h to evade a
potential problem with glibc's header files trying to spike out
linux/types.h.
ext2fs.h (ext2fs_resize_mem): Change the function prototype to include
the old size of the memory, which is needed for some braindamaged
memory allocation systems that don't support realloc().
badblocks.c (ext2fs_badblocks_list_add):
bb_inode.c (clear_bad_block_proc):
dblist.c (ext2fs_add_dir_block):
icount.c (insert_icount_el):
irel_ma.c (ima_put):
rs_bitmap.c (ext2fs_resize_generic_bitmap): Update functions to pass
the old size of the memory to be resized to ext2fs_resize_mem().
ChangeLog, dirinfo.c:
dirinfo.c (e2fsck_add_dir_info): Update function to pass the old size
of the memory to be resized to ext2fs_resize_mem().
ChangeLog, extent.c, resize2fs.c:
resize2fs.c (adjust_superblock):
extent.c (ext2fs_add_extent_entry): Update functions to pass the old
size of the memory to be resized to ext2fs_resize_mem().
hangeLog
irinfo.c
7e44f24237285e809a9f6752e5c960a421e4e998 01-Apr-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, Makefile.in:
Change to use new installation directory variables convention. Fix
uninstall rules to take $(DESTDIR) into account. Remove cat8dir and
cat1dir from the installdirs target, since modern man package don't
necessarily put the cat directory in /usr/man/cat?.
Makefile.in: Change to use new installation directory variables
convention. Fix uninstall rules to take $(DESTDIR) into account.
Remove cat8dir from the installdirs target, since modern man package
don't necessarily put the cat directory in /usr/man/cat?.
Change to use new installation directory variables convention. Fix
installdirs and uninstall rules to reflect the fact that debugfs has
been installed in the root filesystem. Fix uninstall rules to take
$(DESTDIR) into account.
hangeLog
akefile.in
17dba281a042d3f8122ef7ce6933035a8eae074a 30-Mar-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.h, pass4.c, super.c:
super.c, e2fsck.h: Always declare e2fsck_get_device_size() as an
extern in e2fsck.h to prevent -Wall warnings.
pass4.c (e2fsck_pass4): Remove unused variable 'j'.
super.c (check_super_block): Fix broken superblock sanity check when
calculating blocks_per_group if s_log_frag_size != s_log_block_size.
Since we don't support fragments, this isn't a bug deal, but it's good
to get it fixed.
ChangeLog, Makefile.elf-lib:
Makefile.elf-lib (installdirs): Change use of DLL_INSTALL_DIR to
ELF_INSTALL_DIR. (Doesn't make a difference currently, but it's
correct this way.)
ChangeLog, fgetversion.c, getversion.c:
getversion.c (getversion): Return 0 if there's no error.
fgetversion.c (fgetversion): Pass the address of the temporary
variable instead of the unitialized variable to the
EXT2_IOC_GETVERSION ioctl.
hangeLog
2fsck.h
ass4.c
uper.c
4c27e6dd1bfa181ff09c9964d3ed323b3f3be26e 28-Mar-1998 Theodore Ts'o <tytso@mit.edu> pass1.c:
Change "long long" to be __s64
ass1.c
246501c612cb8309dc81b354b785405bbeef05ce 24-Mar-1998 Theodore Ts'o <tytso@mit.edu> Many files:
unix.c: Fix bug in check of feature set, to make sure we can really
fix this filesystem.
problem.h: Make blkcount type to be of type blkcnt_t. Make the num
field be a 64 bit type. Add the problem code PR_1_FEATURE_LARGE_FILES
problem.c: Add table entry for the problem code PR_1_FEATURE_LARGE_FILES.
pass1.c (e2fsck_pass1): A non-zero i_dir_acl field is only a problem
for directory inodes. (Since it is also i_size_high now.) If there
are no large_files, then clear the LARGE_FLAG feature flag. If there
are large_files, but the LARGE_FLAG feature flag is not set, complain
and offer to fix it.
(check_blocks): Add support to deal with non-directory inodes that
have i_size_high set (i.e., large_files). Don't give an error if a
directory has preallocated blocks, to support the DIR_PREALLOC
feature.
(process_block, process_bad_block): The blockcnt variable is a type of
blkcnt_t, for conversion to the new block_iterate2.
pass2.c (process_bad_inode): A non-zero i_dir_acl field is only a
problem for directory inodes. (Since it is also i_size_high now.)
message.c (expand_inode_expression): Print a 64-bits of the inode size
for non-directory inodes. (Directory inodes can only use a 32-bit
directory acl size, since i_size_high is shared with i_dir_acl.) Add
sanity check so that trying to print out the directory acl on a
non-directory inode will print zero. (expand_percent_expression): %B
and %N, which print pctx->blkcount and pctx->num, can now be 64 bit
variables. Print them using the "%lld" format if EXT2_NO_64_TYPE is
not defined.
e2fsck.h: Add the large_flagsfield to the e2fsck context.
e2fsck.c (e2fsck_reset_context): Clear the large_flags field.
ChangeLog, expect.1:
f_messy_inode: Modify test to deal with changes to support 64-bit size
files. (/MAKEDEV had i_dir_acl, now i_size_high, set.)
hangeLog
2fsck.c
2fsck.h
essage.c
ass1.c
ass2.c
roblem.c
roblem.h
nix.c
b6f7983197fe217cf20862c93d72620be3b0fcec 09-Mar-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, message.c, pass2.c, pass3.c:
Mask off the high eight bits of the directory entry's name_len field,
so that it can be used for other purposes.
hangeLog
essage.c
ass2.c
ass3.c
2df1f6aa071e09527d1767e0d5178f29b4e9a73c 27-Feb-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.c, e2fsck.h, pass1.c:
e2fsck.c (e2fsck_run): Since E2F_FLAG_SIGNAL_MASK doesn't
include EXT2_FLAG_RESTART anymore, we need to adjust this
routine so that it *does* return in the case of it seeing
EXT2_FLAG_RESTART.
pass1.c (e2fsck_pass1): ext2_get_next_inode() may call the group done
callback function, which may set context abort flags. So we need to
test the context abort flags after we call ext2_get_next_inode().
(process_inodes): If we abort due out of process_inodes, do a clean
exit by breaking out of the for loop instead of just returning.
e2fsck.h (E2F_FLAG_SIGNAL_MASK): EXT2_FLAG_RESTART shouldn't be
considered a SIGNAL mask (i.e., requiring an immediate abort of
processing to restart). FLAG_RESTART just means that we want to
restart once pass 1 is complete.
hangeLog
2fsck.c
2fsck.h
ass1.c
a02ce9df5ff5db2982462aec7162f7142dc18131 24-Feb-1998 Theodore Ts'o <tytso@mit.edu> Many files:
Change the progress function to return an integer; if returns 1, then
the progress function is expected to have set the e2fsck context flag
signalling a user abort, and the caller should also initiate a user
abort.
hangeLog
2fsck.h
ass1.c
ass2.c
ass3.c
ass4.c
ass5.c
wapfs.c
nix.c
63c4969c54cdb91f5644fde33d301b5b417e6995 20-Feb-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass5.c:
pass5.c (check_block_bitmaps, check_inode_bitmaps): Don't call
end_problem_latch() unless there was actually a problem latched.
Simplifies semantics of the latch processing.
hangeLog
ass5.c
4313932cd77c9323fbfe4cacf4d1dc84c95a39de 16-Feb-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.8.in, e2fsck.h, pass3.c, pass4.c, super.c:
e2fsck.h: Add new field, priv_data to the e2fsck context structure.
It should be used by callers of the e2fsck functions only, and not by
anything in e2fsck itself.
super.c: Instead of call ext2fs_get_device_size(), define and call
e2fsck_get_device_size(). (This function may be stubbed out in
special versions of e2fsck.)
pass3.c, pass4.c: Remove extra calls to the progress function that
weren't needed.
mke2fs.8.in: Update man page to note that the format of the bad block
file is the same as the one generated by badblocks.
hangeLog
2fsck.8.in
2fsck.h
ass3.c
ass4.c
uper.c
54be2ccc2251784fd771590a5e72827afd82df40 01-Feb-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, dirinfo.c, e2fsck.c, e2fsck.h, super.c:
dirinfo.c, e2fsck.c: Don't include com_err.h; it isn't needed.
e2fsck.h: Include <time.h> since it is needed
super.c: If EXT2_SKIP_UUID is defined, then skip the UUID processing.
hangeLog
irinfo.c
2fsck.c
2fsck.h
uper.c
24dd4028eb2b0083fe772fb88de2ecd29b43f908 01-Feb-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.8.in, unix.c:
unix.c (main): In the case where the filesystem revision is too high,
print the message about the superblock possibly being corrupt.
e2fsck.8.in: Add expanded comments about how the -b option works.
hangeLog
2fsck.8.in
nix.c
54dc7ca2869897ae8cb81a9ab9880ebff11680bc 19-Jan-1998 Theodore Ts'o <tytso@mit.edu> Many files:
e2fsck.h: If EXT2_FLAT_INCLUDES is defined, then assume all of
the ext2-specific header files are in a flat directory.
dirinfo.c, ehandler.c, pass1.c, pass1b.c, pass2.c, pass5.c,
super.c, swapfs.c, unix.c: Explicitly cast all assignments
from void * to be compatible with C++.
unix.c (sync_disk): Remove sync_disk and calls to that function,
since ext2fs_close() now takes care of this.
pass1.c, pass1b.c, pass2.c, pass3.c, swapfs, badblocks.c,
ehandler.c, unix.c: Change use of private to be priv_data, to
avoid C++ reserved name clash.
hangeLog
adblocks.c
irinfo.c
2fsck.h
handler.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass5.c
uper.c
wapfs.c
nix.c
5be8dc2143c7b3b21a9b8fb56797dd855ee87560 01-Dec-1997 Theodore Ts'o <tytso@mit.edu> Many files:
dblist.c (ext2fs_get_num_dirs): Make ext2fs_get_num_dirs more paranoid
about validating the directory counts from the block group
information.
all files: Don't include stdlib.h anymore; include it in ext2_fs.h,
since that file requires stdlib.h
ChangeLog, Makefile.in, dirinfo.c:
dirinfo.c (e2fsck_add_dir_info): Use ext2fs_get_num_dirs instead of
e2fsck_get_num_dirs, which has been removed.
Makefile.in (PROGS): Remove @EXTRA_PROGS@, since we don't want to
compile and install flushb.
ChangeLog, configure.in:
Remove @EXTRA_PROGS@, since we aren't using it in 2fsck/Makefile.in anymore
ChangeLog, Makefile.in:
Install debugfs in /sbin, instead of /usr/sbin.
libext2fs.texinfo:
Update version string to be 1.12
Makefile.in:
Fix bug in find script which made the exclusion list, where a '-' was
missing from an -name option.
hangeLog
akefile.in
irinfo.c
7fdfabd3217ebe23b36063d561fc79960275db42 24-Nov-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c, util.c:
pass1.c (e2fsck_pass1_check_device_inode): For now, only check to make
sure the extra i_blocks in a device are cleared if the immutable flag
is set.
util.c (print_resource_track): Fix typo which caused the time/resource
tracking to print "Pass 1 :" instead of "Pass 1: ".
version.h:
Change version to 1.12-WIP, in preparation for an e2fsprogs 1.12 release.
hangeLog
ass1.c
til.c
b8647faa3b0a7dfbb2456a7b37321ee4bbda651c 20-Nov-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass3.c:
Fix bug which could cause core dump when expanding the directory, and
the bitmaps hadn't yet been read in. Also, only use
ext2fs_write_dir_block when writing a directory block, not when
writing out a fresh indirect block.
hangeLog
ass3.c
8039c4802ff1ac433026202de19c4d141214de40 19-Nov-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c:
Fix bug where first_block wasn't getting incremented, which caused
user to get a "Programming error?" warning if there was a bad block in
a non-primary superblock/group_descriptor. Also fixed another bug so
that ext2fs_bg_has_super() is consulted, to avoid problems when using
a filesystem with the sparse_groups option set and there are bad
blocks at the beginning of a group which doesn't have a superblock.
hangeLog
ass1.c
f8188fff23dc2d9c9f858fb21264e46b17672825 14-Nov-1997 Theodore Ts'o <tytso@mit.edu> Many files:
pass1.c, pass2.c, pass3.c, pass4.c, pass5.c: Add calls to the progress
indicator function.
pass1.c (scan_callback): Add call to the progress feedback function
(if it exists).
super.c (check_super_block): Skip the device size check if the
get_device_size returns EXT2_EXT_UNIMPLEMENTED.
iscan.c (main): Don't use fatal_error() anymore.
pass1b.c, swapfs.c, badblocks.c: Set E2F_FLAG_ABORT instead of calling
fatal_error(0).
problem.c, pass3.c (PR_3_ROOT_NOT_DIR_ABORT,
PR_3_NO_ROOT_INODE_ABORT): New problem codes.
problem.c, pass2.c (PR_2_SPLIT_DOT): New problem code.
problem.c, pass1.c (PR_1_SUPPRESS_MESSAGES): New problem code.
problemP.h: New file which separates out the private fix_problem data
structures.
util.c, dirinfo.c, pass1.c, pass1b.c, pass2.c, pass5.c, super.c,
swapfs.c util.c: allocate_memory() now takes a e2fsck context as its
first argument, and rename it to be e2fsck_allocate_memory().
problemP.h:
New file which contains the private problem abstraction definitions.
Makefile.pq:
Remove include of MAKEFILE.STD, which doesn't exist at this point.
hangeLog
akefile.pq
adblocks.c
irinfo.c
2fsck.h
scan.c
essage.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
roblem.c
roblem.h
roblemP.h
uper.c
wapfs.c
nix.c
til.c
68227542432de81fc9b8064efa0791819024f1a6 04-Nov-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog, unix.c:
Add a special case check for the error code EROFS and display an
appropriate error message for this case.
hangeLog
nix.c
7aec6e061d5ee60991958b4061b6b8d4422bc32d 04-Nov-1997 Theodore Ts'o <tytso@mit.edu> Makefile.pq:
Add dirinfo.obj to the list of files to compile.
akefile.pq
08b213017f8371ce4b56ad4d368eb0f92211d04e 03-Nov-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Change ext2fs_read_inode, ext2fs_write_inode to take the e2fsck
context as their first argument.
Change dir_info.c routines to take an e2fsck_context, renamed them to
start with e2fsck_ to avoid namespace issues, and changed them to
store the directory information inside the e2fsck context.
Added e2fsck_run() which calls all of the e2fsck passes in the correct
order, and which handles the return of abort codes.
Added abort processing, both via setjmp/longjmp and via flags in the
e2fsck context.
Use a flag in the e2fsck context instead of the restart_e2fsck global
variable.
Change uses of free and malloc to ext2fs_free_mem and ext2fs_get_mem.
hangeLog
akefile.in
akefile.pq
irinfo.c
2fsck.c
2fsck.h
essage.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
uper.c
wapfs.c
nix.c
til.c
291c9049ba70bb6256099a066243cec1359c9c15 31-Oct-1997 Theodore Ts'o <tytso@mit.edu> ext2fs.h, ext2_err.et.in, ChangeLog, pass1.c, pass3.c:
Rename new error codes to _ET_ in them for consistency.
ChangeLog, et_c.awk, et_h.awk:
Remove support for non STDC compilers, since the workarounds caused
problems with the header file.
Makefile.pq:
Checkpoint of powerquest work.
hangeLog
akefile.pq
ass1.c
ass3.c
c555aebde40afdc0d15d674f2c81c0e05cfded3f 25-Oct-1997 Theodore Ts'o <tytso@mit.edu> Many files:
alloc.c (ext2fs_alloc_block): New function which allocates a
block and updates the filesystem accounting records
appropriately.
ext2_err.et.in: Added new error codes: EXT2_NO_MEMORY,
EXT2_INVALID_ARGUMENT, EXT2_BLOCK_ALLOC_FAIL, EXT2_INODE_ALLOC_FAIL,
EXT2_NOT_DIRECTORY
Change various library files to use these functions instead of EINVAL,
ENOENT, etc.
ChangeLog, pass1.c, pass3.c:
pass3.c (get_lost_and_found): Check error return of
EXT2_FILE_NOT_FOUND instead of ENOTDIR
pass1.c (pass1_check_directory): Return EXT2_NO_DIRECTORY instead of
ENOTDIR
expect.icount:
Change expected error string to be "Invalid argument passed to ext2 library"
instead of just "Invalid argument"
hangeLog
ass1.c
ass3.c
519149fb458b0fa69c10fecd83fae42e838cf01d 25-Oct-1997 Theodore Ts'o <tytso@mit.edu> Many files:
fsck.c:
chattr.c: Remove #include of getopt.h, since it's not needed.
tune2fs.c (main):
lsattr.c (main):
badblocks.c (main):
dumpe2fs.c (main):
mke2fs.c (PRS): Make the variable which getopt returns into be
an int, so that it won't lose on platforms where char is
unsigned.
ChangeLog, unix.c:
Make the variable which getopt returns into be an int, so that it
won't lose on platforms where char is unsigned.
hangeLog
nix.c
622f5f272d2a25539f040e04166e1e21eca3adb5 24-Oct-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1b.c:
Fix bug in error reporting in the case where cs.errcode is non-zero.
hangeLog
ass1b.c
8bf191e8660939687ef35c013066d2082cb16722 20-Oct-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Place #ifdef RESOURCE_TRACK around code which uses init_resource_track
and print_resource_track. (Not all systems have timeval)
hangeLog
akefile.in
2fsck.h
ass1.c
ass2.c
ass3.c
ass4.c
ass5.c
wapfs.c
nix.c
til.c
7668d9b590befc2d574cab710c2b83c1226ddd15 20-Oct-1997 Theodore Ts'o <tytso@mit.edu> Makefile.in:
Don't include the Makefile.pq and the powerquest directories in the tar file.
Makefile.pq:
Initial version of powerquest-special makefile
akefile.pq
b2da22d14b6ac5aa5080c39cab46b4aa4178f90f 20-Oct-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.h, super.c:
super.c: Remove excess #includes which are not necessary.
e2fsck.h: Add #ifdef's for HAVE_SYS_TYPES_H and HAVE_SYS_TIME_H
hangeLog
2fsck.h
uper.c
d40259fd552d942903f2fd0b426c75a5c2516017 20-Oct-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Rename io.h to be ext2_io.h (avoid namespace collisions)
ChangeLog, resize2fs.h:
Add #ifdef's for HAVE_SYS_TYPES_H and HAVE_SYS_TIME_H.
akefile.in
44339bdff87584b72a2ade7d3a1426e3335f2167 15-Oct-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Use new substitution technology which doesn't depend on shell scripts.
(Faster, and better for MS-DOS port!)
akefile.in
1b6bf1759af884957234b7dce768b785f792abd0 03-Oct-1997 Theodore Ts'o <tytso@mit.edu> Many files:
pass*.c, super.c: Massive changes to avoid using printf and com_err
routines. All diagnostic messages are now routed through the
fix_problem interface.
pass2.c (check_dir_block): Check for duplicate '.' and '..' entries.
problem.c, problem.h: Add new problem codes PR_2_DUP_DOT and
PR_2_DUP_DOT_DOT.
problem.c: Added new problem codes for some of the superblock
corruption checks, and for the pass header messages. ("Pass
1: xxxxx")
util.c (print_resource_track): Now takes a description argument.
super.c, unix.c, e2fsck.c: New files to separate out the
operating-specific operations out from e2fsck.c. e2fsck.c now
contains the global e2fsck context management routines, and
super.c contains the "pass 0" initial validation of the
superblock and global block group descriptors.
pass1.c, pass2.c, pass3.c, pass4.c, pass5.c, util.c: Eliminate
(nearly) all global variables and moved them to the e2fsck
context structure.
problem.c, problem.h: Added new problem codes PR_0_SB_CORRUPT,
PR_0_FS_SIZE_WRONG, PR_0_NO_FRAGMENTS, PR_0_BLOCKS_PER_GROUP,
PR_0_FIRST_DATA_BLOCK
expect.1, expect.2:
Updated tests to align with e2fsck problem.c changes.
hangeLog
akefile.in
adblocks.c
2fsck.c
2fsck.h
handler.c
scan.c
essage.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
roblem.c
roblem.h
cantest.c
uper.c
wapfs.c
nix.c
til.c
7cf73dcd3d173d88ceab26d381f4abac362d8518 14-Aug-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog, e2fsck.h, message.c, pass1.c, pass2.c, problem.c, problem.h:
message.c: Add compression for the word "Illegal"
problem.c: Added entries for PR_2_BAD_CHAR_DEV and PR_2_BAD_BLOCK_DEV
pass1.c (pass1, check_device_inode), pass2.c (process_bad_inode): Use
a more stringent test for a valid device.
ChangeLog, Makefile.in:
Makefile.in (install): Fix rm command to use $(DESTDIR) appropriately.
hangeLog
2fsck.h
essage.c
ass1.c
ass2.c
roblem.c
roblem.h
a47b66ee09960a8bf00e72b431ec56d68e11a301 11-Aug-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog, error_message.c, error_table.h, et_name.c:
error_table.h:
et_name.c (error_table_name):
error_message.c (error_message.c): Make code be 16-bit safe.
ChangeLog, e2fsck.c:
e2fsck.c (check_mount): Add stronger warning message about the perils
of running e2fsck on a mounted filesystem.
hangeLog
2fsck.c
024996cf0a54c2b294810a15942747c8fa9238e3 17-Jun-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog:
Check-in for the 1.11 source release.
hangeLog
da2e97f7cf048b0c089ab5d0f756d0b40275ed59 12-Jun-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass1.c, problem.c:
pass1.c (mark_table_blocks): Mark the superblock and group descriptor
blocks first, so that any conflicts between these and the bitmap or
inode table blocks is noticed.
problem.c: Fix message printed out when a block or inode bitmap
conflicts with other fs data, has the correct group number in it.
hangeLog
ass1.c
roblem.c
7ac02a5ebddcc6187c893eedc80d92777b399575 11-Jun-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog, pass2.c:
Check the error return from ext2fs_dblist_iterate.
hangeLog
ass2.c
583ccdc32d9f2feaf1a157cc6aad1f39152b8680 09-May-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Fix minor typos and grammer oops found by Bill Hawes (whawes@star.net).
hangeLog
2fsck.8.in
f635d7f65bd002984ce9a202d491d4f187b996b2 09-May-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog, mke2fs.c, badblocks.c:
Pass the blocksize to the bad blocks command so that all of the
filesystem gets tested in the case where the blocksize 2048 or 4096.
ChangeLog, badblocks.c:
Fix bug where ext2fs_badblocks_list_test would test the list (and
exceed array boundaries) if there were no bad blocks on the bad blocks
list. (Showed up when user tried: mke2fs -c -b 4096).
hangeLog
adblocks.c
a29f4d30f24d68f1f1c75548e020689ede532c05 29-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checkin of e2fsprogs 1.10
hangeLog
akefile.in
ass1b.c
2ecc6fefa176f3203598225eb9ae2f61c3ae9c10 29-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checked in e2fsprogs 1.09
hangeLog
akefile.in
521e36857227b21e7ab47b0a97f788d2af9f9717 29-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checked in e2fsprogs 1.08.
hangeLog
2fsck.c
2fsck.h
ass1.c
ass1b.c
ass2.c
roblem.c
roblem.h
21c84b71e205b5ab13f14343da5645dcc985856d 29-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checked in e2fsprogs-1.07
hangeLog
akefile.in
irinfo.c
2fsck.c
2fsck.h
essage.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
roblem.c
roblem.h
wapfs.c
til.c
5c576477ccb2f0ca8c5d5af2e2354fd8eeff1589 29-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checked in e2fsprogs 1.06
hangeLog
2fsck.8.in
2fsck.c
ass1.c
ass4.c
wapfs.c
til.c
1e3472c5f37ca3686dd69b079d4d02a302f5798d 29-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checked in e2fsprogs 1.05
hangeLog
akefile.in
2fsck.8.in
2fsck.c
2fsck.h
ass1.c
ass1b.c
ass2.c
ass4.c
wapfs.c
62c06f790c4920ec2721515e36d599751f6d4d2d 29-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checked in e2fsprogs 1.04.
hangeLog
akefile.in
2fsck.c
7f88b04341d88c5df0360d930832c38040303b61 26-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checkin of e2fsprogs 1.03.
hangeLog
2fsck.c
ass1.c
ass2.c
ass3.c
ass4.c
til.c
74becf3c0a065f8d64e07ce4d31f9fe53be91d62 26-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checkin of e2fsprogs 1.02.
hangeLog
akefile.in
adblocks.c
2fsck.8
2fsck.8.in
2fsck.c
2fsck.h
ass1.c
297f47a13edce54d08517182e714083a0a7f196c 26-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checked in e2fsprogs 1.01.
hangeLog
2fsck.8
2fsck.c
50e1e10fa0ac12a3e2a9d20a75ee9041873cda96 26-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checked in e2fsprogs 0.5c
depend
hangeLog
akefile
akefile.in
adblocks.c
2fsck.8
2fsck.c
2fsck.h
handler.c
xtend.c
lushb.c
mages/README
mages/badbblocks.img.gz
mages/baddir.img.gz
mages/badinode.img.gz
mages/badlkcnt.img.gz
mages/badroot.img.gz
mages/badtable.img.gz
mages/bbfile.img.gz
mages/bitmapblks.img.gz
mages/bitmaps.img.gz
mages/dirlink.img.gz
mages/dup.img.gz
mages/dup2.img.gz
mages/dupfsblks.img.gz
mages/dupsuper.img.gz
mages/end-bitmap.img.gz
mages/expand.img.gz
mages/illfsblks.img.gz
mages/lotsbad.img.gz
mages/lpf.img.gz
mages/messy_inode.img.gz
mages/mke2fs2b.img.gz
mages/noroot.img.gz
mages/okgroup.img.gz
mages/overfsblks.img.gz
mages/test_script
scan.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
cantest.c
til.c
f3db3566b5e1342e49dffc5ec3f418a838584194 26-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checkin of e2fsprogs 0.5b
depend
hangeLog
akefile
adblocks.c
irinfo.c
2fsck.8
2fsck.c
2fsck.h
handler.c
mages/README
mages/badbblocks.img.gz
mages/bbfile.img.gz
mages/bitmapblks.img.gz
mages/dupfsblks.img.gz
mages/dupsuper.img.gz
mages/illfsblks.img.gz
mages/lotsbad.img.gz
mages/messy_inode.img.gz
mages/okgroup.img.gz
mages/overfsblks.img.gz
mages/test_script.log
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
cantest.c
til.c
3839e65723771b85975f4263102dd3ceec4523c0 26-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checkin of e2fsprogs 0.5b
depend
HANGES
akefile
adblocks.c
irinfo.c
2fsck.8
2fsck.c
2fsck.h
handler.c
lushb.c
mages/README
mages/baddir.img.gz
mages/badinode.img.gz
mages/badlkcnt.img.gz
mages/badroot.img.gz
mages/badtable.img.gz
mages/bbfile.img.gz
mages/bitmaps.img.gz
mages/dirlink.img.gz
mages/dup.img.gz
mages/dup2.img.gz
mages/end-bitmap.img.gz
mages/expand.img.gz
mages/lpf.img.gz
mages/mke2fs2b.img.gz
mages/noroot.img.gz
mages/test_script
mages/test_script.log
alloc.h
trace.awk
trace.c
ass1.c
ass1b.c
ass2.c
ass3.c
ass4.c
ass5.c
til.c