History log of /external/e2fsprogs/e2fsck/dirinfo.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
749f07121d9c98c317987a87f44c458745f39f15 30-May-2016 Theodore Ts'o <tytso@mit.edu> Add configure --disable-tdb which disables e2fsck's scratch_files feature

The scratch_files feature is not really needed except on 32-bit
platforms, since tdb's performance is pretty awful given how we are
using it. Maybe SQLite would be faster, but for 64-bit platforms,
enabling swap works fairly well, especially using the rbtree for the
bitmap abstraction.

We leave tdb for Android since it's unlikely that someone will be
trying to connect petabyte+ sized file systems to a mobile handset.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/dirinfo.c
8beba812a961f9fdf46610ad7fb6df5ba90b5069 24-May-2015 Theodore Ts'o <tytso@mit.edu> e2fsck,misc: include ext2fs.h to avoid clang warnings

e2fsck/dirinfo.c and misc/e4crypt.c use functions from libext2fs, so
we need to include its header file or clang will complain.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/dirinfo.c
beec19ff21d41c84dbbc2ab8d0df25147912ff59 05-Nov-2014 Darrick J. Wong <darrick.wong@oracle.com> e2fsck: fix dangling pointer when dir_info array is resized

e2fsck uses an array to store directory usage information during pass
3; the usage context also contains a pointer to the last directory
looked up. When expanding the dir_info array, this cache pointer
needs to be cleared if the array resize changed the pointer location,
or else we'll later walk off the end of this dead pointer.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reported-by: Sami Liedes <sami.liedes@iki.fi>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/dirinfo.c
e9a5c6e3607d17641543aa5e801af22563fb1410 11-Sep-2014 Theodore Ts'o <tytso@mit.edu> e2fsck: notice when the realloc of dir_info fails

If the reallocation of dir_info fails, we will eventually cause e2fsck
to fail with an internal error. So if the realloc fails, print a
message and bail out with a fatal error early when at the time of the
reallocation failure.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/e2fsck/dirinfo.c
253a96500a8fbe7266fe2daa066768cbaa1d3137 09-Jan-2014 Theodore Ts'o <tytso@mit.edu> Save and restore umask around calls to mkstemp()

The races would be hard to exploit, but let's close them off.

Addresses-Coverity-Id: #709504
Addresses-Coverity-Id: #709505
Addresses-Coverity-Id: #709506

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/dirinfo.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>
/external/e2fsprogs/e2fsck/dirinfo.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>
/external/e2fsprogs/e2fsck/dirinfo.c
d1154eb460efe588eaed3d439c1caaca149fa362 18-Sep-2011 Theodore Ts'o <tytso@mit.edu> Shorten compile commands run by the build system

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

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

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

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/e2fsck/dirinfo.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>
/external/e2fsprogs/e2fsck/dirinfo.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>
/external/e2fsprogs/e2fsck/dirinfo.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>
/external/e2fsprogs/e2fsck/dirinfo.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>
/external/e2fsprogs/e2fsck/dirinfo.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>
/external/e2fsprogs/e2fsck/dirinfo.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>
/external/e2fsprogs/e2fsck/dirinfo.c
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>
/external/e2fsprogs/e2fsck/dirinfo.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>
/external/e2fsprogs/e2fsck/dirinfo.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>
/external/e2fsprogs/e2fsck/dirinfo.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.
/external/e2fsprogs/e2fsck/dirinfo.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.
/external/e2fsprogs/e2fsck/dirinfo.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().
/external/e2fsprogs/e2fsck/dirinfo.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.
/external/e2fsprogs/e2fsck/dirinfo.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.
/external/e2fsprogs/e2fsck/dirinfo.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.
/external/e2fsprogs/e2fsck/dirinfo.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.
/external/e2fsprogs/e2fsck/dirinfo.c
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.
/external/e2fsprogs/e2fsck/dirinfo.c
21c84b71e205b5ab13f14343da5645dcc985856d 29-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checked in e2fsprogs-1.07
/external/e2fsprogs/e2fsck/dirinfo.c
f3db3566b5e1342e49dffc5ec3f418a838584194 26-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checkin of e2fsprogs 0.5b
/external/e2fsprogs/e2fsck/dirinfo.c
3839e65723771b85975f4263102dd3ceec4523c0 26-Apr-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checkin of e2fsprogs 0.5b
/external/e2fsprogs/e2fsck/dirinfo.c