History log of /external/e2fsprogs/resize/resize2fs.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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.
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.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/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.c
e9736a3ba88b73e38fd56f5a7d1ee3b514cd713c 01-Oct-2013 Theodore Ts'o <tytso@mit.edu> resize2fs: relocate inode table blocks if necessary when shrinking

If the file system is being shrunk, and a block group's inode table
falls beyond the end of the inode table, we need to try to relocate
the inode table blocks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
2215293c7e85c88d2fbc06f9e9438fca9a25213c 01-Oct-2013 Theodore Ts'o <tytso@mit.edu> resize2fs: fix -M size calculations to avoid cutting off the inode table

If the file system's inode table blocks in the last block group are
located in the middle or the end of the block group, it's possible for
resize2fs -M to use a size which will require relocating the inode
table blocks in the last block group. This can lead to all sorts of
problems, so solve it by simply guaranteeing that we will never do
that.

Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
e231f17500477f7abbea5c441971be491a04fdf4 01-Oct-2013 Theodore Ts'o <tytso@mit.edu> resize2fs: add debugging support for resize2fs -M calcuations

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
0851517daa6f11f7bc6b63a82deef7f4561ee3c7 09-Sep-2013 Darrick J. Wong <darrick.wong@oracle.com> resize2fs: use blk64_t and location getters for free_gdp_blocks()

free_gdp_blocks needs to be taught to use 64-bit fields and the appropriate
getters, otherwise it'll truncate high block numbers (when, say, resizing a
>16T fs) and mark the low numbered group descriptor blocks as free. Yikes.

Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
80391dcd2ec853981a11e1178ff7a19598a4e81c 19-Jun-2013 Eric Sandeen <sandeen@redhat.com> resize2fs: move bitmaps if shrinking would orphan them

It is possible to have a flex_bg filesystem with block groups
which have inode & block bitmaps at some point well past the
start of the group.

If an offline shrink puts the new size somewhere between
the start of the block group and the (old) location of
the bitmaps, they can be left beyond the end of the filesystem,
i.e. result in fs corruption.

Check each remaining block group for whether its bitmaps
are beyond the end of the new filesystem, and reallocate
them in a new location if needed.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
f026f1a37061a021f7188c9e45d0fbff1bde9e60 31-Mar-2013 Theodore Ts'o <tytso@mit.edu> resize2fs: fix off-line resize of file systems with flex_bg && !resize_inode

When doing an off-line resize2fs of an initially very small file
system, it's possible to run out of reserved gdt blocks (which are
reserved via the resize inode). Once we run out, we need to move the
allocation bitmaps and inode table out of the way to grow the gdt
blocks. Unfortunately, when moving these metadata blocks, it was
possible that a block that had been just been newly allocated for a
new block group could also get allocated for a metadata block for an
existing block group that was being moved.

To prevent this, after we grow the gdt blocks and allocate the
metadata blocks for the new block groups, make sure all of these
blocks are marked as reserved.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reported-by: John Jolly <john.jolly@gmail.com>
/external/e2fsprogs/resize/resize2fs.c
d1a1a583c13dd43e828f28c9c93cc53df715c891 20-Jan-2013 Theodore Ts'o <tytso@mit.edu> resize2fs: move a cluster at a time with bigalloc file systems

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
1773c87c7e9ee5c4b8753919320d6d06910ea25b 20-Jan-2013 Theodore Ts'o <tytso@mit.edu> resize2fs: correctly account for clusters when calculating summary stats

Fixes resize2fs so it correctly calculates the number of free clusters
in each block group for file systems with the bigalloc feature
enabled.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.c
a0ba54ec00abce6ce9e7e5f2d5f6e0899559ebb8 03-Jan-2013 Theodore Ts'o <tytso@mit.edu> resize2fs: use [un]mark_block_range bitmap functions to reduce CPU usage

Use ext2fs_[un]mark_block_range2() functions to reduce the CPU
overhead of resizing large file systems by 45%, primarily by
reducing the time spent in fix_uninit_block_bitmaps().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
1eb31c4885156b595e6ceb4516cb1e1fb2d251fd 03-Jan-2013 Theodore Ts'o <tytso@mit.edu> resize2fs: add resource tracking as a debug option

Add a new debug flag which prints how much time is consumed by the
various parts of resize2fs's processing.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
2279fd78fe875e612ff998fe658a2c18ee13c66b 03-Jan-2013 Theodore Ts'o <tytso@mit.edu> resize2fs: fix 32-bit overflow when calculating the number of free blocks

This caused the free blocks count in the superblock to be incorrect
after resizing a 64-bit file system if the number of free blocks
overflowed a 32-bit value.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
5d3a88fbe9e0291d7d5baa8391cbd78d9cc29767 03-Jan-2013 Theodore Ts'o <tytso@mit.edu> resize2fs: fix 32-bit overflow issue which can corrupt 64-bit file systems

Fix a 32-bit overflow bug caused by a missing blk64_t cast which can
cause the block bitmap to get corrupted when doing an off-line resize
of a 64-bit file system.

This problem can be reproduced as follows:

rm -f foo.img; touch foo.img
truncate -s 8T foo.img
mke2fs -F -t ext4 -O 64bit foo.img
e2fsck -f foo.img
truncate -s 21T foo.img
resize2fs foo.img
e2fsck -fy foo.img

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
831f309c624d77e41c83ee7c55d900e347cd44fe 29-Dec-2012 Theodore Ts'o <tytso@mit.edu> resize2fs: create optimized flex_bg block groups

Now that we are reserving all of the bg-specific metadata before we
try to allocate the metadata for the new block groups, we don't have
to temporarily disable the flex_bg feature flag while we allocate the
new metadata blocks --- this allows the newly created block groups to
have a much more optimized layout, instead of fragmenting the inode
table and block/inode bitmaps in sepraate block groups.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
ddcf1dbff2b8523c2207fbebaa4e5f42880dd2a3 29-Dec-2012 Theodore Ts'o <tytso@mit.edu> resize2fs: handle bg descriptors which overlap with other bg's metadata

With flex_bg file systems, bg-specific metadata (i.e., bitmaps and the
inode table blocks) can be located in another block group. Hence,
when we grow the number of block group descriptors, we need to check
if we need to relocate metadata blocks not just for the block group
where the bgd blocks are located, but in all block groups.

This change fixes the following test case:

rm -f foo.img; touch foo.img
truncate -s 32G foo.img
mke2fs -F -t ext4 -E resize=12582912 foo.img
e2fsck -f foo.img
truncate -s 256G foo.img
./resize2fs foo.img
e2fsck -fy foo.img

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
4b04fb30e01c7418331caa01ecf071bd55672f1a 29-Dec-2012 Theodore Ts'o <tytso@mit.edu> resize2fs: reserve all metadata blocks for flex_bg file systems

For flex_bg file systems, if we need to relocate an allocation bitmap
or inode table, we need to make sure that all metadata blocks have
been reserved, lest we end up overwriting a metadata block belonging
to a different block group.

This change fixes the following test case:

rm -f foo.img; touch foo.img
truncate -s 32G foo.img
mke2fs -F -t ext4 -E resize=12582912 foo.img
e2fsck -f foo.img
truncate -s 64G foo.img
./resize2fs foo.img
e2fsck -fy foo.img

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
2ebaeb35dba540f5de578c848a5d1787d0ef2720 29-Dec-2012 Theodore Ts'o <tytso@mit.edu> resize2fs: reserve fs metadata blocks first in blocks_to_move()

This is the first commit to add support for off-line resizing using
flex_bg without the assist of using the resize_inode to reserve gdt
blocks. This functionality has been broken up into separate commits
which are hopefully obviously correct to make them easier to review
for correctness.

In this first step, we break up the for loop at the end of
blocks_to_move() so that we first mark all of the metadata blocks
which don't need to be moved in the reserve_blocks bitmap, and then
try to allocate the metadata blocks are new or which need to moved
second.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
5e27a274d320b44c631a37d4b04a84aa3ca5428c 30-Nov-2012 Theodore Ts'o <tytso@mit.edu> resize2fs: fix gcc -Wall nits and valgrind complaints

One of these fixes was triggering failures when running:

./test_scripts --valgrind r_move_itable r_inline_xattr r_resize_inode

It should be a false positive, but it fixing this makes it easier to
see real problems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
2d8c0c8a4fd99d79caa45afba1462dd5ae0f1e45 14-Sep-2012 Theodore Ts'o <tytso@mit.edu> resize2fs: grow uninit_bg file systems more efficiently

If the uninit_bg feature is enabled and the kernel supports
lazy_itable_init, skip zeroing the inode table so that the resize
operation can go much more quickly. Also set the itable_unused fields
so that the first e2fsck after the resize will run faster.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
7f82034438e424c766e1ad5847ed0e4ccc090edf 03-Sep-2012 Theodore Ts'o <tytso@mit.edu> resize2fs: fix overhead calculation for meta_bg file systems

The file system overhead calculation in calculate_minimum_resize_size
was incorrect meta_bg file systems. This caused the minimum size to
underflow for very large file systems, which threw resize2fs into a
loop generally lasted longer than the user's patience.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
ba8bfa1a6dca8a6b65c6c938f3848e90e26bbe09 16-Feb-2012 Jan Kara <jack@suse.cz> resize2fs: take s_first_data_block into account for resize2fs -M

calculate_minimum_resize_size() forgot to account s_first_data_block
into minimum filesystem size. Thus in case the size of filesystem was
such that the last group had the minimal size (50 blocks + metadata
overhead), the code in adjust_fs_info() decided the group is unneeded,
removed it, and in some cases the resizing then failed with ENOSPC.

Fix the issue by properly accounting for s_first_data_block in
calculate_minimum_resize_size().

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.c
515e555a0c36ae0294d71ba9ba45f7fa576cfd0f 17-Oct-2011 Theodore Ts'o <tytso@mit.edu> resize2fs: don't fail when shrinking an empty file system

This commit fixes a failure when running the commands:

dd if=/dev/zero of=fs bs=1k count=100k; mke2fs fs; resize2fs -Mp fs

We should not try truncating the file system if there is only a single
block group in the file system.

Addresses-Sourceforge-Bug: #3404051

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.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/resize/resize2fs.c
98f4547198b369bef7e41eb7ce4a16855726c393 16-Sep-2011 Eric Sandeen <sandeen@redhat.com> e2fsprogs: add ext2fs_group_blocks_count helper

Code to count the number of blocks in the last partial
group is cut and pasted around the e2fsprogs codebase
a few times.

Making this a helper function should improve matters.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.c
2696f2501c864e0e26e203023907a5441197c92b 07-Jan-2011 Theodore Ts'o <tytso@mit.edu> resize2fs: fix computation of the real end of the bitmap to be 64-bit

real_end had been previously declared with a bogus type, which is why
this was missed earlier.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
da2a5a4baede2a227d2da587eb74ceae66778fbc 23-Dec-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
resize/resize2fs.c
d16db7d9ded85f4a7f8d91562246cc2f59bf204d 21-Dec-2010 Eric Sandeen <sandeen@redhat.com> resize2fs: do not clear resize inode for 0 resvd blocks

I ran into odd behavior where mkfs.ext4 of a 16T filesystem would
create a resize inode with 0 reserved blocks, and mark the resize_inode
feature.

A subsequent slight downward resize of the filesystem would remove
the resize inode, making any further offline resizing impossible.

This is especially odd in light of the fact that a large downward
resize (say, to 8T) will actually add blocks to the resize inode -
so a small resize removes it, a large resize expands it ...

commit 8ade268cf2fde8629b51bfd1c044a83db88234cd had added this:

If the filesystem is grown to the point where the resize_inode is no
longer needed, clean it up properly so e2fsck doesn't have to.

but, it seems e2fsck does not care about this situation, either.

So, simply leave the resize_inode intact in this case, and everything
seems to be happy.

Note, this is for the 1.41.xx branch.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
8728d50657e90e0ca39981106ad617d600b9acad 14-Jun-2010 Valerie Aurora Henson <vaurora@redhat.com> resize2fs: Fix up to be 64-bit block number safe

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
cc84d866e2f29d92b5a732fead4df2dd9f814f2b 11-Feb-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
e2fsck/pass1.c
4828bbe9e7380da0d9153109ab290e88b5d53bf5 06-Feb-2010 Theodore Ts'o <tytso@mit.edu> resize2fs: Fix fix uninit group test accessing invalid memory

Commit 74128f8 added tests for uninit groups, but it could access past
the end of the group_desc[] array after processing the last group:

==19668== Invalid read of size 2
==19668== at 0x40518C: resize_fs (resize2fs.c:1824)
==19668== by 0x405A46: main (main.c:451)
==19668== Address 0x5a0d002 is not stack'd, malloc'd or (recently) free'd
==19668==
==19668== Invalid read of size 2
==19668== at 0x405391: resize_fs (resize2fs.c:1864)
==19668== by 0x405A46: main (main.c:451)
==19668== Address 0x5a0d002 is not stack'd, malloc'd or (recently) free'd
==19668==

It was found by Eric Sandeen running the regression suite through
valgrind.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
4486af5b4c1b117ac88a92cd2336cb41c15107d3 16-Nov-2009 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
misc/mke2fs.c
d93d5bbf605f81eb13fa71a55dfbed06f88fe930 09-Nov-2009 Eric Sandeen <sandeen@redhat.com> resize2fs: exit fix_sb_journal_backup early for external journal

Resizing a filesystem with an external journal fails when it tries
to read inode 0:

# touch testfs
# truncate testfs 1342177280
# touch testjournal
# truncate testjournal 134217728
# mke2fs -O journal_dev testjournal
# losetup /dev/loop0 testjournal
# mkfs.ext4 -J device=/dev/loop0 testfs 127680
# resize2fs testfs
resize2fs 1.41.9 (22-Aug-2009)
Resizing the filesystem on testfs to 327680 (4k) blocks.
resize2fs: Illegal inode number while trying to resize testfs
Please run 'e2fsck -fy testfs' to fix the filesystem
after the aborted resize operation.

I think the right, simple thing to do is just bail out early
for an external journal here, as there are no backup blocks
to update.

Reported-by: mjevans1983@gmail.com
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
6493f8e85defc568a4ca8cdb4a53361f36fb94ba 26-Oct-2009 Theodore Ts'o <tytso@mit.edu> Convert ext2fs_group_of_blk() to ext2fs_group_of_blk2()

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.c
2884d208a37fe8813267198a247694bc90b00f96 04-Sep-2009 Peng Tao <bergwolf@gmail.com> resize2fs: fix minimum resize size calculation with flex_bg

When flex_bg is on, calculate_minimum_resize_size() should add more meta
blocks for newly added flex_bg.

Addresses-RedHat-Bugzilla: #519131
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.c
dc615a21c3c43cd9071926df2633d5b23e2e726b 07-Sep-2009 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next
3346084beaa450528dcb7180068f7b2366c800c5 23-Aug-2009 Valerie Aurora Henson <vaurora@redhat.com> resize2fs: Move everything to new bitmap interface

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
96cdb37e27ff101fb23cefe422b4f77fb55209be 10-Jul-2009 Theodore Ts'o <tytso@mit.edu> resize2fs: If resize2fs fails, tell the user to run e2fsck

If the resize operation fails in the middle of the operation, mark the
filesystem as needing to be checked, and tell the user that they
should run e2fsck -fy on the device.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
8a6ede8b7a8d5be0d49d6bfa7616537b61dfdc1b 18-Jun-2009 Eric Sandeen <sandeen@redhat.com> resize2fs: update sb journal backup if journal was moved

This was reported in Fedora, since the livecd creator does
a lot of resizing.

If we've moved the journal blocks during resize (more likely now,
due to the journal being in the middle) the backup blocks in the
superblock don't get updated, and a subsequent e2fsck will find
issues:

e2fsck 1.41.6 (30-May-2009)
Backing up journal inode block information.

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/mnt/test/img: ***** FILE SYSTEM WAS MODIFIED *****
/mnt/test/img: 11/16000 files (0.0% non-contiguous), 17789/38400 blocks

This can be shown in a simple test:

# dd if=/dev/zero of=img bs=1 count=0 seek=3000M
# mke2fs -t ext4 -F img
# resize2fs img 150M
# e2fsck -f img

(thanks to the Fedora reporter Mads Kiilerich for the testcase!
https://bugzilla.redhat.com/show_bug.cgi?id=506105#c2)

So, update the backup journal in the superblock before resize2fs exits.

Addresses-RedHat-Bugzilla: #505339

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
e2ca097fc641e9be2bbafc3db7fd96e4ac87387a 15-Jun-2009 Theodore Ts'o <tytso@mit.edu> resize2fs: fix miscellaneous memory leaks

Fix various memory leaks which were discovered using valgrind.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
69f7c80eaf25a642b0eb85f4557605c89acd80b6 19-May-2009 Eric Sandeen <sandeen@redhat.com> resize2fs: fix minimum size calculations

The extra padding added to the minimum size calculations:

/*
* We need to reserve a few extra blocks if extents are
* enabled, in case we need to grow the extent tree. The more
* we shrink the file system, the more space we need.
*/
if (fs->super->s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)
blks_needed += (fs->super->s_blocks_count - blks_needed)/500;

can go quite wrong if we've already added up more "blks_needed"
than our current size, and the above subtraction wraps. This can
easily happen for a filesystem which is almost completely full.

In this case, just return the current fs size as the minimum and
be done with it.

With this fix we could probably call calculate_minimum_resize_size()
for each resize2fs invocation and refuse to resize smaller than that?

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
2d7361ebfae31d462027479fd32799e01b37ec19 19-Apr-2009 Theodore Ts'o <tytso@mit.edu> resize2fs: Fix corruption bug impacting ext4 filesystems with uninit_bg

Due to a fencepost bug, when skipping a block group whose block bitmap
was uninitialized (and hence could not contain any blocks eligible for
relaocation), the block immediately following the block group wasn't
checked as well. If it was in use and required relocation, it
wouldn't get properly relocated, with the result that an inode using
such a block would end up, post resize, with a pointer to a block now
outside the bounds of the filesystem.

This commit fixes this fencepost error.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
c09043f1abb99c73d681e630ee0a4b142e4abf6b 19-Apr-2009 Theodore Ts'o <tytso@mit.edu> resize2fs: Fix data corruption bug when shrinking the inode table for ext4

If we need to shrink the inode table, we need to make sure the inodes
contained in the part of the inode table we are vacating don't get
reused as part of the filesystem shrink operation. This wasn't a
problem with ext3 filesystems, since the inode table was located in
the block group that was going away, so that location was not eligible
for reallocation.

However with ext4 filesystems with flex_bg enabled, it's possible for
a portion of the inode table in the last flex_bg group to be
deallocated, but in a part of the filesystem which could be used as
data blocks. So we must mark those blocks as reserved to prevent
their reuse, and adjust the minimum filesystem size calculation to
assure that we don't shrink a filesystem too small for the resize
operation to succeed.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
1ac84a948dc0cb867fb33b43ab1d67c71d207cc8 18-Apr-2009 Theodore Ts'o <tytso@mit.edu> resize2fs: Fix data corruption bug when growing an ext4 filesystem off-line

When allocating a new set of block group metadata as part of growing
the filesystem, the resize2fs code assumes that the bitmap and inode
table blocks are in their own block group; an assumption which is
changed by the flex_bg feature. This commit works around the problem
by temporarily turning off flex_bg while allocating the new block
group metadata, to avoid potentially overwriting previously allocated
data blocks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.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/resize/resize2fs.c
793a04a0719d5688a0033e4bda3cf267f57ea760 20-Jan-2009 Theodore Ts'o <tytso@mit.edu> resize2fs: Reserve some extra space for -P/-M for ext4 filesystems

Some extra blocks may be needed to expand some extent allocation trees
while we are shrinking the filesystem. We don't know exactly how
much, so we use a hueristic.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
9227c5bbbd0861878ae73f7dceb4deb9e9f06a3c 19-Jan-2009 Theodore Ts'o <tytso@mit.edu> resize2fs: Release bitmap and itable blocks in flex_bg filesystems

Previously resize2fs assumed that bitmap and inode table blocks were
always located in their respective block group. However, this is no
longer true with flex_bg. So it is necessary to check all of the
block groups which will be truncated to see if they have metadata
blocks that need to be marked as no longer being in use in the new,
shrunk filesystem.

This bug fixes resize2fs -M, which would otherwise fail because
without the released blocks, there would not be enough space in the
filesystem. This bug also avoids (mostly harmless) filesystem
corruptions reported by e2fsck regarding blocks marked in use but not
actually used (these being the bitmap and inode table blocks
associated with the truncated block groups).

Note: in theory it is possible to have block group N utilize bitmap
and inode table blocks in block group N+X with flex_bg. At the moment
neither mke2fs nor e2fsck will create filesystems like this, which is
good, because resize2fs doesn't handle this case correctly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
c58a08e673a10d0e5fa4855ca58ab2cbf48fd029 19-Jan-2009 Theodore Ts'o <tytso@mit.edu> resize2fs: Move all required blocks for ext4 filesystems

In the function blocks_to_move(), when checking to see if a block
group's block bitmap is initialized, we need to check the old_fs's
block group descriptors, not the new file system's (already truncated)
group descriptor data structures. Otherwise we will end up
derferencing past the end of the array boundary, and the resulting
garbage value may indicate that the bitmap is uninitialized, and so
all of the blocks in that block group will be skipped, resulting in
some blocks not getting marked as needing relocation.

This showed up in the following test case:

mke2fs -t ext4 -b 1024 test.img 1048576
resize2fs test.img 80000

The journal inode after the resize operation looked like this:

debugfs: stat <8>
Inode: 8 Type: regular Mode: 0600 Flags: 0x80000
...
BLOCKS:
(IND):35385, (0-5836):2356-8192, (5837-21959):8454-24576, (21960-32506):24838-35
384, (32507-32767):434177-434437
TOTAL: 32769

The blocks 434177-434437 were not moved because block group 53 was
wrongly thought to have an unitialized block group.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.c
88dbf8287f831d02e8d5023be4f9b42ca224fb75 22-Aug-2008 Theodore Ts'o <tytso@mit.edu> resize2fs: Make sure we close out the progress bar in pass #4

This fixes a cosemtic issue where we don't complete the progress bar
and issue a newline before printing the final resize successful
message.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
7f9c96ee74315388d758675f69a930b9990e0789 22-Aug-2008 Theodore Ts'o <tytso@mit.edu> resize2fs: supply block allocator for extents function

In the rare case where new blocks are needed while mutating an extent
tree, supply a specialized block allocator so that extent_node_split()
allocates valid blocks for the interior nodes of the extent tree.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
86acdebd539864908127561034752082c86105e2 22-Aug-2008 Theodore Ts'o <tytso@mit.edu> resize2fs: Fix support for filesystems with the uninit_bg feature

If the filesystem has the uninit_bg feature, then parts of the block
and inode bitmap may not be initialized. Teach resize2fs how to deal
with these case appropriately. (Most of these fixes were fortunately
not necessary for the common case where the resize_inode is present to
reserve space, and where the filesystem is being expanded instead of
being shrunk.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
c89f1b4ca5020c9ae847b13a9a680e05fe2ce5d9 18-Aug-2008 Theodore Ts'o <tytso@mit.edu> resize2fs: Fix double bumping of directory in-use counts

When moving directories into new block groups (which would only happen
when shrinking a filesystem), resize2fs would increase the directory
in-use count by 2 times the necessary value, due to a change in
ext2fs_inode_alloc_stats() made in e2fsprogs 1.26. This is largely
harmless, but it does result in a filesystem corruption for e2fsck to
fix.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
8ade268cf2fde8629b51bfd1c044a83db88234cd 10-Jul-2008 Theodore Ts'o <tytso@mit.edu> resize2fs: Clean up the resize inode properly if necessary

If the filesystem is grown to the point where the resize_inode is no
longer needed, clean it up properly so e2fsck doesn't have to.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
71ff129e9f5c942ce4d2eb20e269100d15c1a6ae 18-Jun-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'

Conflicts:

README
resize/online.c
version.h
9ff8ece57d46a9419fc60057547810824881bb45 18-Jun-2008 Theodore Ts'o <tytso@mit.edu> mke2fs, tune2fs, resize2fs: Use floating point to calculate percentages

When calculating the number reserved blocks, use floating point for
better accuracy, since for big filesystems it really makes a
difference. In addition, mke2fs and tune2fs accepts a floating point
number from the user, so they should provide that level of accuracy.

Addresses-Debian-Bug: #452639

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
74128f8d7e93fe633aa87951319a4afd252a4494 17-Jun-2008 Theodore Ts'o <tytso@mit.edu> resize2fs: Fix support for the uninit_bg feature

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
2c25f7e75ad10078ecfed08b9295fb1904c8bb80 07-Jun-2008 Theodore Ts'o <tytso@mit.edu> Fix gcc -Wall warnings in resize2fs

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.c
236efede1922fa173b3c2f20d9e0886856664ab4 22-Oct-2007 Jose R. Santos <jrs@us.ibm.com> Make resize2fs uninit block group aware

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>
/external/e2fsprogs/resize/resize2fs.c
199ddaaa445e14fca8113b0db85e2576267071c9 13-Mar-2008 Josef Bacik <jbacik@redhat.com> resize2fs: Add options to print (and resizing to) the minimum filesystem size

Add the -P option to print the minimum filesystem size and exit.

Add the -M option to force resizing the filesystem to the minimum
filesystem size.

Signed-off-by: Josef Back <jbacik@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
a040a99b6cc4bf9f10d39747ca6947f0462a2eb2 13-Mar-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'

Conflicts:

lib/ext2fs/ext2_err.et.in
edfd9b0a9fe7b90f56da981ca26d5233cc3749d6 09-Mar-2008 Theodore Ts'o <tytso@mit.edu> resize2fs: Fix resizing filesystems with large inodes

Use ext2fs_get_next_inode_full() in resize2fs and clean up large inode
handling; previous attempt was not properly handling all cases, and
was incorrectly setting i_extra_isize. This caused some extended
attributes to get removed or randomly assigned to other inodes as a
result of the resize, which can be unfortunate on systems using
SELinux.

The previous commit didn't fix things completely on big-endian systems
like PowerPC.

Addresses-Red-Hat-Bugzilla: #434893

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
399033a6ab713bc1f8ebad90e47fced0e7491b62 29-Feb-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'
4ef28824ca29e86053398c3e4cecca6d88b2b397 28-Feb-2008 Eric Sandeen <sandeen@redhat.com> resize2fs: Fix movement of large (greater than 128 byte) inodes

inode_scan_and_fix() in resize2fs needs to do read/write of the full
inode to be sure it gets all data from larger (>128 byte) inodes.

Addresses-Red-Hat-Bugzilla: #434893

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.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
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>
/external/e2fsprogs/resize/resize2fs.c
f2de1d38d0819b17895977fabc52d81d0ea6ec00 30-Aug-2007 Valerie Clement <valerie.clement@bull.net> libext2fs: Add EXT2_DESC_SIZE and EXT2_DESC_PER_BLOCK macros

Add macros to support variable-length group descriptors for ext4.

Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.c
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>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.c
62c6d1403ea00dd72890862c761a41baa10a7ad4 12-Sep-2006 Eric Sandeen <esandeen@redhat.com> Remove unused variables

Signed-off-by: Eric Sandeen <esandeen@redhat.com>
/external/e2fsprogs/resize/resize2fs.c
a8862d9e90d0d94761ba28dbbf9674308fd7d7c0 30-Aug-2006 Theodore Ts'o <tytso@mit.edu> Fix potential 2**32-1 overflow by using e2p_percent()

Add a new functiom, e2p_percent(), which correct calculates the percentage
of a number based on a given percentage, without worrying about overflow
issues. This is used where we calculate the number of reserved blocks using
a percentage of the total number of blocks in a filesystem.

Based on patches from Eric Sandeen, but generalized to use this new function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
/external/e2fsprogs/resize/resize2fs.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>
/external/e2fsprogs/resize/resize2fs.c
69022e029f3273b3b860bf701219cd3fe615f76b 30-Aug-2006 Theodore Ts'o <tytso@mit.edu> Fix potential 2**32-1 overflow problems by ext2fs_div_ceil()

Add a new function, ext2fs_div_ceil(), which correctly calculates a division
of two unsigned integer where the result is always rounded up the next
largest integer. This is used everywhere where we might have
previously caused an overflow when the number of blocks
or inodes is too close to 2**32-1.

Based on patches from Eric Sandeen, but generalized to use this new function

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

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

Signed-off-by: Takashi Sato <sho@tnes.nec.co.jp>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
bf69235ad0073c80386b70caba0e1b58e5f85697 18-Mar-2006 Theodore Ts'o <tytso@mit.edu> Add support for on-line resizing to resize2fs

If the filesystem is mounted, attempt to use the on-line resizing
ioctls to resize the filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
68963d5a262ad49cbdad8f946e59ebc34677fe33 29-Dec-2005 Theodore Ts'o <tytso@mit.edu> Clean up gcc -Wall complaints in resize2fs

Remove unused variables in mark_table_blocks()

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
2787276ec59e1d52087d307bc30446d088ec65bc 09-Aug-2005 Theodore Ts'o <tytso@mit.edu> Fix fencepost error in resize2fs caught by valgrind

There was a off-by-one fencepost error in the logic used to check if
we avoid copying zero-filled blocks when moving an inode table down by
a block or two. Thanks to valgrind for catching it. As far as I know
this fencepost error wasn't causing any actual problems, but it was
definitely a bug.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/resize/resize2fs.c
f35fd3d5eeb3e35660ea87adbc170978c3cdf9e3 09-May-2005 Theodore Ts'o <tytso@mit.edu> Fix some minor typo's and grammar's strings, and remove debugging strings
from needing to be translated. Patch is from Benno Schulenberg.
/external/e2fsprogs/resize/resize2fs.c
64ad98acbe694e74925ad4e4fc88fd10fd3b3a44 26-Jan-2005 Theodore Ts'o <tytso@mit.edu> resize2fs.c: Fix bug where we don't release the blocks belonging
to the old inode table blocks when we move the inode
table. (Addresses Debian Bug: #290894)
/external/e2fsprogs/resize/resize2fs.c
9213a93b22accd2a27064b12f6bc5f1221ca6a70 24-Dec-2004 Theodore Ts'o <tytso@mit.edu> Fix resize2fs so that it properly handles filesystems with the resize_inode
feature enabled.
/external/e2fsprogs/resize/resize2fs.c
06191693d4d253a8496677dd02e3b8529a7fce2c 17-Sep-2004 Theodore Ts'o <tytso@mit.edu> resize2fs.c (check_and_change_inodes): Fix debugging printf to
mask off the high 256 bits of dirent->name_len (which is
where the file type information is stored). (Addresses
Debian Bug #271605)
/external/e2fsprogs/resize/resize2fs.c
b969b1b8a5c13992cadb026114731958644540d8 28-Dec-2003 Matthias Andree <matthias.andree@gmx.de> Fix more compiler warnings.
/external/e2fsprogs/resize/resize2fs.c
544349270e4c74a6feb971123884a8cf5052a7ee 07-Dec-2003 Theodore Ts'o <tytso@mit.edu> Fix gcc -Wall nitpicks
/external/e2fsprogs/resize/resize2fs.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/resize/resize2fs.c
7d7bdd578b307cad1dc248310eb279c6fb73b682 24-Jun-2003 Theodore Ts'o <tytso@mit.edu> Fix bug in resize2fs which caused it to fail on filesystems with a
non-empty bad block list. Resize2fs now discards any blocks on the
badblock list which are no longer part of the filesystem as the result
of a filesystem shrink. (Note: this means that shrinking and then
enlarging a filesystem is no longer a reversible operation;
information about bad blocks in the part of the filesystem
which is to be chopped off will be lost.)
/external/e2fsprogs/resize/resize2fs.c
424cb7b62aa417db2eaec79cfaec7433b31f8726 06-Mar-2003 Theodore Ts'o <tytso@mit.edu> Bug fix; we were incorrectly moving the block and inode bitmaps
for sparse superblock filesystems. (Address Debian bug #174766)
/external/e2fsprogs/resize/resize2fs.c
085d2a8397d4eb37ad604f568edb8b2662c22d46 01-Nov-2002 Theodore Ts'o <tytso@mit.edu> resize2fs.c (inode_scan_and_fix, check_and_change_inodes): When
moving an inode, set the ctime field so that people using
dump/restore will backup the changed inode. Also update
the mtime and ctime of directories which get updated when
we need to move an inode.
/external/e2fsprogs/resize/resize2fs.c
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.
/external/e2fsprogs/resize/resize2fs.c
0ccd488a764c14b27983b92435deca5e1adf9061 16-Aug-2002 Theodore Ts'o <tytso@mit.edu> Fix stupid typo in previous changeset.
/external/e2fsprogs/resize/resize2fs.c
ed909bbe20d3fbeeee65c48dc0df2dbffdf2a0a9 16-Aug-2002 Theodore Ts'o <tytso@mit.edu> Fix up extended attribute handling in e2image, resize2fs, and in
debugfs's icheck command.
/external/e2fsprogs/resize/resize2fs.c
cefbf4870c0593e3c7a01b8d5494463b247d90f0 26-Jul-2002 Theodore Ts'o <tytso@mit.edu> resize2fs.c (block_mover): If there are no blocks to move,
release the bmap table. This significantly speeds up
resize2fs when shrinking or expanding a filesystem by a
very small number of blocks (which EVMS will do).
/external/e2fsprogs/resize/resize2fs.c
116db1b513f6901415d1f5f8c01fc297d7cc64a4 01-Apr-2002 Theodore Ts'o <tytso@mit.edu> main.c (main): If we are resizing a plain file which is smaller
than the requested size, then we will attempt to
transparently extend the filesize in a sparse fashion by
writing a block at the end of the requested part of the
filesystem.

main.c (main), resize2fs.c (resize_fs), resize2fs.h: Change the
function prototype of resize_fs() so that it can modify
the new_size parameter with the actual new size of the
filesystem after the resize operation. (This can
sometimes be less than the requested new size if there
isn't enough space to create the necessary block group
metadata for that last bit of disk space.) Resize2fs now
prints the actual new size of the filesystem when it finishes.
/external/e2fsprogs/resize/resize2fs.c
546a1ff18cc912003883ff67ba3e87c69f700fc4 08-Mar-2002 Theodore Ts'o <tytso@mit.edu> Fix various gcc -Wall complaints.
/external/e2fsprogs/resize/resize2fs.c
dfcdc32f8d6623a35a9e66f503c535e4081b7266 11-Jan-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, libext2fs.texinfo:
libext2fs.texinfo: Change ino_t to ext2_ino_t
ChangeLog, extent.c, main.c, resize2fs.c:
extent.c, main.c, resize2fs.c: Change ino_t to ext2_ino_t.
ChangeLog, mke2fs.c:
mke2fs.c: Change ino_t to ext2_ino_t.
ChangeLog, test_icount.c, test_rel.c:
test_icount.c, test_rel.c: Change ino_t to ext2_ino_t
/external/e2fsprogs/resize/resize2fs.c
a13575f4d29a908add19ea27baa102bc6944ee30 13-Jun-2000 Theodore Ts'o <tytso@mit.edu> ChangeLog, extent.c, main.c, resize2fs.c, resize2fs.h:
main.c, resize2fs.c, resize2fs.h, extent.c: Add NLS support.
/external/e2fsprogs/resize/resize2fs.c
0cee8a5c423c2a1054c7366e74870592ec8db95e 06-Apr-2000 Theodore Ts'o <tytso@mit.edu> Many files:
Update copyright of files in preparation for release of resize2fs.
Also removed the (obsolete) beta-test check that had been in the code,
as well as the old spec files used to package the separate
distribution of resize2fs.
Makefile.in: No longer build resize2fs.static, since there's no real
point in it any more.
Modified Files:
ChangeLog Makefile.in extent.c main.c resize2fs.8.in
resize2fs.c resize2fs.h sim_progress.c test_extent.c
Removed Files:
e2fsprogs-1.12.spec pq.gif resize2fs.spec version.h
/external/e2fsprogs/resize/resize2fs.c
1333fe93446a09ceb866a7f2a1ca0c196964b952 03-Sep-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, resize2fs.c:
resize2fs.c: Rename max to max_groups and max_dirs to avoid possible
conflicts with a cpp macro named "max".
/external/e2fsprogs/resize/resize2fs.c
084307590c5e28b6a8305933220ff5b2bd1bcda2 10-Jun-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, resize2fs.c:
Change blkcnt_t to be e2_blkcnt_t to avoid collision with the LFS API.
/external/e2fsprogs/resize/resize2fs.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/resize/resize2fs.c
101c84f2e049bffcdb6c5ba1784842cdd50dbf05 24-Mar-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, main.c, resize2fs.c:
main.c (main): Check to make sure we can really resize this
filesystem. If there are compatible feature sets that we don't
support, we need to abort.
resize2fs.c: Change to use the new prototype required by
block_iterate2 (which uses blkcnt_t for the blockcount).
version.h, RELEASE-NOTES:
Interim commit of changes to date.
/external/e2fsprogs/resize/resize2fs.c
2bc4d4f7e52ae1af9fb1a3dcff7c8752145d5a5c 21-Mar-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, resize2fs.c:
resize2fs.c (inode_scan_and_fix): If we are expanding the filesystem,
temporarily set rfs->old_fs->super->s_blocks_count to ultimate size of
the filesystem, to avoid catching an error on the block iterator.
/external/e2fsprogs/resize/resize2fs.c
bce49798f7f4380dff5693bc8308019b3cf8de25 08-Mar-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, resize2fs.c:
resize2fs.c (blocks_to_move): Create the meta_bmap using the old
filesystem, not the new filesystem.
(get_new_block): Don't try checking the old block bitmap if the block
we're testing is beyond the boundaries of the old filesystem.
/external/e2fsprogs/resize/resize2fs.c
3b627e8d6735fd81906117d580ee70292b2cfaaf 24-Feb-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, main.c, resize2fs.c, resize2fs.h:
Change the progress function to return an errcode_t; this allows the
progress function to return a error indicating a user-requested
cancel.
/external/e2fsprogs/resize/resize2fs.c
f4b2a6db3f13f4210697bcd273086006c719929b 21-Feb-1998 Theodore Ts'o <tytso@mit.edu> ChangeLog, main.c, resize2fs.8.in, resize2fs.c:
main.c (check_mount, main): Resize2fs now checks the size of the
partition, and uses this as a default new_size of the partition if one
is not specified. Resize2fs will not let you resize a mounted
partition.
resize2fs.c: Change how the progress function for the INODE_SCAN pass
is performed, so that the maximum size is never zero.
resize2fs.8.in: Updated man page.
/external/e2fsprogs/resize/resize2fs.c
a8519a2dbec429846d89fee581a2ecb829904cd2 16-Feb-1998 Theodore Ts'o <tytso@mit.edu> Many files:
Major reoganization of how resizing works. Functions in
ext2_block_move.c, and ext2_inode_move.c moved into resize2fs.c.
Multiple passes in those two files also combined into a single inode
scanning pass. Made the inode table moving function better handling
the case where it needs to abort mid-operation. When moving blocks
around, made the block allocation function preferentially avoid the
old group descriptor blocks, to make resize2fs more robust.
/external/e2fsprogs/resize/resize2fs.c
63b44fbe303ea00118cbe24cbbcde351a9bc0aac 13-Feb-1998 Theodore Ts'o <tytso@mit.edu> Many files:
resize2fs.c, resize2fs.h, ext2_block_move.c, ext2_inode_move.c,
main.c: Reorganize how the progress functions are called.
/external/e2fsprogs/resize/resize2fs.c
ca8abba7e0970fd1702db53e3f89ceb68c70768c 19-Jan-1998 Theodore Ts'o <tytso@mit.edu> Many files:
resize2fs.h: If EXT2_FLAT_INCLUDES is defined, then assume all
of the ext2-specific header files are in a flat directory.
ext2_block_move.c, ext2_inode_move.c, extent.c, resize2fs.c,
resize2fs.h: Rename variables named "new" to "new_block",
"new_inode", or "new_loc" to avoid C++ reserved word
clash.
ext2_block_move.c, ext2_inode_move.c, extent.c, resize2fs.c,
sim_progress.c: Use ext2fs_get_memory(),
ext2fs_free_memory(), et. al., instead of malloc() and
free().
ext2_block_move.c, ext2_inode_move.c, extent.c: Explicitly cast
all assignments from void * to be compatible with C++.
banalysis.c, banalysis.h, ext2_inode_move.c, ext2_block_move.c:
Change private to priv_data to avoid C++ namespace clash.
ChangeLog, badblocks.8.in:
badblocks.8.in: Add documentation for the -s option.
/external/e2fsprogs/resize/resize2fs.c
80c0fc3492278168448017e79730905aa5b9b62b 03-Nov-1997 Theodore Ts'o <tytso@mit.edu> Many files:
resize2fs.c, ext2_block_move.c ext2_inode_move.c: Only include printf
statements if RESIZE2FS_DEBUG is defined.
main.c: Don't read in the bitmaps since resize2fs.c does that.
e2label.c, mke2fs.c:
Adjust header files.
/external/e2fsprogs/resize/resize2fs.c
c762c8e63216a301c9de7d24c6136d8370378a08 17-Jun-1997 Theodore Ts'o <tytso@mit.edu> Many files:
Checkin of work to date. (Pretty much completely working now.)
/external/e2fsprogs/resize/resize2fs.c
05e112a11b6508c2b12d5d4ee0c322171db9b538 14-Jun-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog, Makefile.in, version.h:
Allow people to set the version.h to something like 1.10-PLUS.
.del-inodemap.c~24510e64, main.c, resize2fs.c, resize2fs.h:
More interim work. All is functioning except progress meter.
/external/e2fsprogs/resize/resize2fs.c
052db4b76e552682c1ad94ff4943faa98c958343 12-Jun-1997 Theodore Ts'o <tytso@mit.edu> Makefile.in, .del-inodemap.c~24510e64, main.c, resize2fs.c, resize2fs.h:
New snapshot (almost fully functional)
/external/e2fsprogs/resize/resize2fs.c
1e1da29fbd4204a267ebd7c64d37e1f95a9dad08 09-Jun-1997 Theodore Ts'o <tytso@mit.edu> Many files:
bmove.c (ext2fs_move_blocks): New function which takes a bitmap of
blocks which need to be moved, and moves those blocks to another
location in the filesystem.
rs_bitmap.c (ext2fs_resize_generic_bitmap): When expanding a bitmap,
make sure all of the new parts of the bitmap are zero.
bitmaps.c (ext2fs_copy_bitmap): Fix bug; the destination bitmap wasn't
being returned to the caller.
alloc_tables.c (ext2fs_allocate_group_table): Add new function
ext2fs_allocate_group_table() which sets the group tables for a
particular block group. The relevant code was factored out of
ext2fs_allocate_tables().
dblist.c (make_dblist): Adjust the initial size of the directory block
list to be a bit more realize (ten plus twice the number of
directories in the filesystem).
Check in interim work.
/external/e2fsprogs/resize/resize2fs.c
24b2c7a7a14cec8480a75af7d535cf267e6abe1f 07-Jun-1997 Theodore Ts'o <tytso@mit.edu> ChangeLog, Makefile.in, configure.in:
configure.in (rmakefile): Added (optional) private directory for resize2fs.
Makefile.in: Change recursive descent rules to check to see if a
directory exists before trying to make it.
Many files:
Initial checkin of work done to date.
/external/e2fsprogs/resize/resize2fs.c