]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit - e2fsck/super.c
e2fsck: rebuild sparse extent trees & convert non-extent ext3 files
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 2 Apr 2015 02:34:40 +0000 (19:34 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 21 Apr 2015 20:22:59 +0000 (16:22 -0400)
commite228d700d5b59d2d2e0e3a54c4c76b66ed71afdf
treeff12ae8e5554d80ece36ddd263132c28a2416abe
parenta5abfe0382729fba2c5fea6aaae486cb8bc98f00
e2fsck: rebuild sparse extent trees & convert non-extent ext3 files

Teach e2fsck to (re)construct extent trees.  This enables us to do
either of the following: compress a highly sparse extent tree into
fewer ETB blocks; or convert a ext3-style block mapped file to an
extent file.  The reconstruction is performed during pass 1E or 3A,
as detailed below.

For files that are already extent based, this algorithm will
automatically run (pending user approval) if pass1 determines either
(1) that a whole level of extent tree will fit into a higher level of
the tree; (2) that the size of any level can be reduced by at least
one ETB block; or (3) the extent tree is unnecessarily deep.  It will
not run at all if errors are found and the user declines to fix the
errors.

The option "-E bmap2extent" can be used to force e2fsck to convert all
block map files to extent trees, and to rebuild all extent files'
extent trees.  After conversion, files larger than 12 blocks should be
defragmented to eliminate empty holes where a block lives.

The extent tree constructor is pretty dumb -- it creates a list of
leaf extents (adjacent extents are collapsed), marks all indirect
blocks / ETB blocks free, installs a new extent tree root in the
inode, then loads the leaf extents into the tree.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
18 files changed:
e2fsck/Makefile.in
e2fsck/e2fsck.8.in
e2fsck/e2fsck.c
e2fsck/e2fsck.h
e2fsck/extents.c [new file with mode: 0644]
e2fsck/pass1.c
e2fsck/problem.c
e2fsck/problem.h
e2fsck/rehash.c
e2fsck/super.c
e2fsck/unix.c
tests/f_extent_bad_node/expect.1
tests/f_extent_bad_node/expect.2
tests/f_extent_int_bad_magic/expect.1
tests/f_extent_leaf_bad_magic/expect.1
tests/f_extent_oobounds/expect.1
tests/f_extent_oobounds/expect.2
tests/f_extents/expect.1