]> git.ipfire.org Git - thirdparty/e2fsprogs.git/log
thirdparty/e2fsprogs.git
12 years agomisc: quiet "unused variable" compiler warnings
Andreas Dilger [Thu, 16 Jun 2011 02:17:38 +0000 (22:17 -0400)] 
misc: quiet "unused variable" compiler warnings

Some of the newly-merged patches added "unused variable" compiler
warnings.  Delete unused variables.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agocheck: build all dependencies before "make check"
Andreas Dilger [Thu, 16 Jun 2011 02:17:38 +0000 (22:17 -0400)] 
check: build all dependencies before "make check"

If "make check" is run on a clean repository, it fails due to missing
dependencies for building the test programs.  Have "make check" build
all dependencies before starting the tests to ensure that it can finish
without error.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agoe2fsck: Fix pass5 handling for bigalloc && uninit_bg file systems
Theodore Ts'o [Thu, 16 Jun 2011 02:15:34 +0000 (22:15 -0400)] 
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>
12 years agolibext2fs: fix regression in ext2fs_new_block2() for uninit_bg file systems
Theodore Ts'o [Thu, 16 Jun 2011 02:11:59 +0000 (22:11 -0400)] 
libext2fs: fix regression in ext2fs_new_block2() for uninit_bg file systems

Commit b0ecb787ef introduced a bug in check_block_uninit(), which is
used by ext2fs_new_block2().  This bug resulted in the block bitmap
for the block group in question not having space reserved for the file
system metadata blocks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agomke2fs: add support for cluster size in mke2fs.conf
Theodore Ts'o [Tue, 14 Jun 2011 18:30:22 +0000 (14:30 -0400)] 
mke2fs: add support for cluster size in mke2fs.conf

Add support for specifying the cluster size in mke2fs.conf

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agomke2fs: Add support for [devices] stanza in mke2fs.conf
Theodore Ts'o [Tue, 14 Jun 2011 18:17:56 +0000 (14:17 -0400)] 
mke2fs: Add support for [devices] stanza in mke2fs.conf

Add the [devices] stanza which allows device-specific defaults to be
specified in the mke2fs.conf file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoMerge branch 'maint' into next
Theodore Ts'o [Sat, 11 Jun 2011 16:54:50 +0000 (12:54 -0400)] 
Merge branch 'maint' into next

12 years agoe2fsprogs: ignore generated files for "git status"
Andreas Dilger [Sat, 11 Jun 2011 16:51:44 +0000 (12:51 -0400)] 
e2fsprogs: ignore generated files for "git status"

Ignore files generated by "make" or "make check" in "git status".
Ignore backup files from editing files and generated tags files.
Delete a temporary file in tests/d_loaddump/script at test cleanup.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agoext2fs: fix error handling in ext2fs_add_dir_block
Andreas Dilger [Sat, 11 Jun 2011 16:51:21 +0000 (12:51 -0400)] 
ext2fs: fix error handling in ext2fs_add_dir_block

In ext2fs_add_dir_block() the dblist allocation size was changed to
grow as the number of items in the dblist increases.  However, the
error handling in case of allocation failure wasn't changed to match.

Fix the error case to revert to the old allocation size on failure.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agomke2fs: add extent-mapped journal regression test
Andreas Dilger [Sat, 11 Jun 2011 16:22:36 +0000 (12:22 -0400)] 
mke2fs: add extent-mapped journal regression test

All of the regression tests in e2fsprogs still use a block-mapped
journal (if any journal at all).  Add a simple regression test that
tests extent-mapped journals for both mke2fs and e2fsck.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agomke2fs: add test for large journal with lazy init
Andreas Dilger [Sat, 11 Jun 2011 16:17:29 +0000 (12:17 -0400)] 
mke2fs: add test for large journal with lazy init

Add test for internal journal over 4GB in size, using the
lazy_journal_init and lazy_itable_init features.  Otherwise
the filesystem metadata would be too large to reliably run on
test systems, and take too long to create/check the filesystem.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agomke2fs: skip zeroing journal blocks
Andreas Dilger [Sat, 11 Jun 2011 16:17:29 +0000 (12:17 -0400)] 
mke2fs: skip zeroing journal blocks

Add the ability to skip zeroing journal blocks on disk.  This can
significantly speed up mke2fs with large journals.  At worst the
uninitialized journal is only a very short-term risk (if at all),
because the journal will be overwritten on any new filesystem as
soon as any significant amount of data is written to disk, and
the new journal TID would need to match the offset/TID of an old
commit block still left on disk.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agoext2fs: Handle internal journal over 2^32 bytes
Andreas Dilger [Sat, 11 Jun 2011 16:17:29 +0000 (12:17 -0400)] 
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>
12 years agoext2fs: don't use O_DIRECT if not available
Andreas Dilger [Sat, 11 Jun 2011 15:50:01 +0000 (11:50 -0400)] 
ext2fs: don't use O_DIRECT if not available

O_DIRECT is not defined on OSX.  Since direct IO is only a new
optimization and not needed for correct functionality, disable
it if O_DIRECT is unavailable.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agomisc: fix compile warnings on OSX
Andreas Dilger [Sat, 11 Jun 2011 15:50:01 +0000 (11:50 -0400)] 
misc: fix compile warnings on OSX

The BLKFLSBUF and FDFLUSH ioctls are Linux specific, and do not
really have anything to do with __GNUC__ (which is also used on
OS/X and Solaris).  Only print these warnings on Linux systems.

statfs64() is deprecated on OSX and generates a deliberate warning.
Fix some other warnings that show up on OSX builds.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agoext2fs: fix ext2fs_warn_bitmap32() return warning
Andreas Dilger [Sat, 11 Jun 2011 15:33:02 +0000 (11:33 -0400)] 
ext2fs: fix ext2fs_warn_bitmap32() return warning

This was reported as "control reaches end of non-void function",
but comparing to other similar functions it should be a void
function.  Since it is only declared in the "private" ext2fsP.h
header, it should be OK to change the function prototype.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agodebugfs: fix icheck finding blocks used for xattrs
Andreas Dilger [Sat, 11 Jun 2011 15:29:54 +0000 (11:29 -0400)] 
debugfs: fix icheck finding blocks used for xattrs

This was an "uninitialized variable" warning, but it turns out to be
a real bug.  Without this change, it is not possible to use "icheck"
to find blocks that are used for the i_file_acl (xattr) block.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agotune2fs: add dir_index feature to tune2fs man page
Andreas Dilger [Sat, 11 Jun 2011 15:29:54 +0000 (11:29 -0400)] 
tune2fs: add dir_index feature to tune2fs man page

Add description of missing dir_index feature to tune2fs(8) man page.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agoext2fs: fix undeclared posix_memalign() warning
Andreas Dilger [Sat, 11 Jun 2011 15:04:42 +0000 (11:04 -0400)] 
ext2fs: fix undeclared posix_memalign() warning

Older distros do not define posix_memalign() by default in the
headers.  If ext2fs.h is included early in the headers, it is
possible to "#define _XOPEN_SOURCE 600" so that the stdlib.h
header will define it, but if ext2fs.h is included after stdlib.h
there is no posix_memalign() declaration.

Add a posix_memalign() declaration if stdlib.h didn't do it.  This
is a bit of a hack for GNU headers, but it works on Linux and OS/X
without problems.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agomisc: clean up compiler warnings
Andreas Dilger [Sat, 11 Jun 2011 14:58:25 +0000 (10:58 -0400)] 
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>
12 years agoe2fsck: add basic bigalloc support to check (but not yet repair) file systems
Theodore Ts'o [Fri, 10 Jun 2011 22:58:16 +0000 (18:58 -0400)] 
e2fsck: add basic bigalloc support to check (but not yet repair) file systems

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agomke2fs: support creating bigalloc file systems
Theodore Ts'o [Fri, 10 Jun 2011 22:57:22 +0000 (18:57 -0400)] 
mke2fs: support creating bigalloc file systems

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agolibext2fs: allocate clusters to files in expand_dir.c and mkjournal.c
Theodore Ts'o [Fri, 10 Jun 2011 22:54:53 +0000 (18:54 -0400)] 
libext2fs: allocate clusters to files in expand_dir.c and mkjournal.c

Teach ext2fs_expand_dir() and ext2fs_add_journal_inode() about
allocating blocks when clustered allocation is enabled.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agolibext2fs: teach block allocation functions about bigalloc/clusters
Theodore Ts'o [Fri, 10 Jun 2011 22:51:58 +0000 (18:51 -0400)] 
libext2fs: teach block allocation functions about bigalloc/clusters

Optimize ext2fs_new_block2() and ext2fs_get_free_blocks2() when
bigalloc is enabled.  Also fix the uninitialized block bitmap code so
that it correctly deals clustered allocation.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agolibext2fs: teach bitmap functions about bigalloc/cluster
Theodore Ts'o [Fri, 10 Jun 2011 21:55:09 +0000 (17:55 -0400)] 
libext2fs: teach bitmap functions about bigalloc/cluster

This patch makes the following changes:

* ext2fs_allocate_block_bitmap() now allocates a bitmap with cluster
  granularity for bigalloc file systems.  For mke2fs and e2fsck, a
  newly added function, ext2fs_allocate_subcluster_bitmap() allocates
  a bitmap with block granularity (even for bigalloc file systems).
  The newly added function ext2fs_get_bitmap_granularity() will return
  the number of bits (log2) of the granularity used by the bitmap.

* The ext2fs_{mark,unmark,test}_block_bitmap2() functions will shift
  their passed-in argument by log2(cluster_ganularity) bits right.
  This means that the arguments for the single-argument bitmap
  functions will be interpreted with block granluarity, since this
  minimizes code changes in the rest of the code base.

* The ext2fs_{get,set}_block_bitmap_range() functions will interpret
  their arguments in cluster granularity.  This is a bit inconsistent,
  but the caller of those functions will need to be taught about the
  subtleties of clusters for bigalloc file systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agolibext2fs: create extent-based directories if the extents feature is enabled
Theodore Ts'o [Fri, 10 Jun 2011 17:58:18 +0000 (13:58 -0400)] 
libext2fs: create extent-based directories if the extents feature is enabled

This allows mke2fs to create the root and lost+found directories using
extents.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoMerge branch 'maint' into next
Theodore Ts'o [Tue, 7 Jun 2011 17:38:38 +0000 (13:38 -0400)] 
Merge branch 'maint' into next

Conflicts:
misc/mke2fs.c

12 years agomke2fs: Don't erase flash device if "-n" is given
Andreas Dilger [Tue, 7 Jun 2011 16:22:29 +0000 (10:22 -0600)] 
mke2fs: Don't erase flash device if "-n" is given

If "mke2fs -n" is used, there should be no changes to the underlying
device.  Unfortunately, when the "discard" option was added in commit
c7cd908be59f48c66b4f3ac9a631ffe3dde4f1ab, it did not check for the "-n"
flag, and will discard all data on a flash device even if "-n" is given.

Check for the "noaction" flag before discarding any filesystem data.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agoMerge branch 'maint' into next
Theodore Ts'o [Sun, 5 Jun 2011 00:24:36 +0000 (20:24 -0400)] 
Merge branch 'maint' into next

Conflicts:
lib/ext2fs/bitmaps.c
lib/ext2fs/rw_bitmaps.c
misc/dumpe2fs.c

12 years agodumpe2fs: teach dumpe2fs to be cluster aware
Theodore Ts'o [Sun, 5 Jun 2011 00:06:32 +0000 (20:06 -0400)] 
dumpe2fs: teach dumpe2fs to be cluster aware

Add support to dumpe2fs so it can display the block bitmaps correctly
for bigalloc file systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agolibext2fs: Teach block bitmap read, write, and allocation funcs about clusters
Theodore Ts'o [Sun, 5 Jun 2011 00:05:22 +0000 (20:05 -0400)] 
libext2fs: Teach block bitmap read, write, and allocation funcs about clusters

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agolibext2fs: change fs->clustersize to fs->cluster_ratio_bits
Theodore Ts'o [Sat, 4 Jun 2011 14:20:47 +0000 (10:20 -0400)] 
libext2fs: change fs->clustersize to fs->cluster_ratio_bits

The log2 of the ratio of cluster size to block size is far more useful
than just storing the cluster size.  So make this change, and then
define basic utility macros: EXT2FS_CLUSTER_RATIO(),
EXT2FS_CLUSTER_MASK(), EXT2FS_B2C(), EXT2FS_C2B(), and
EXT2FS_NUM_B2C().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agolibext2fs: change EXT2_MAX_BLOCKS_PER_GROUP() to be cluster size aware
Theodore Ts'o [Sat, 4 Jun 2011 20:40:26 +0000 (16:40 -0400)] 
libext2fs: change EXT2_MAX_BLOCKS_PER_GROUP() to be cluster size aware

Change the EXT2_MAX_BLOCKS_PER_GROUP so that it takes the cluster size
into account.  This way we can open bigalloc file systems without
ext2fs_open() thinking that they are corrupt.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agolibext2fs: require cluster size == block_size when opening a !bigalloc fs
Theodore Ts'o [Sat, 4 Jun 2011 20:36:19 +0000 (16:36 -0400)] 
libext2fs: require cluster size == block_size when opening a !bigalloc fs

In ext2fs_open() check to make sure the cluster size superblock field
is the same as the block size field when the bigalloc feature is not
set.  This is necessary since we will start introducing calculations
based on the cluster size field.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agolibcom_err: Fix install rule if installing with hard links
Theodore Ts'o [Sat, 4 Jun 2011 15:24:18 +0000 (11:24 -0400)] 
libcom_err: Fix install rule if installing with hard links

If $(LINK_INSTALL_FLAGS) is -f instead of -sf, the Makefile's install
rule would not work correctly while installing com_err.h

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoe2fsck: don't check/clone duplicate xattr blocks in fs without xattr feature
Eric Sandeen [Tue, 31 May 2011 23:59:56 +0000 (19:59 -0400)] 
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>
12 years agoMerge branch 'maint' into next
Theodore Ts'o [Wed, 1 Jun 2011 00:08:58 +0000 (20:08 -0400)] 
Merge branch 'maint' into next

Conflicts:
misc/tune2fs.c

12 years agotune2fs: Fix overflow of interval check
Kazuya Mio [Mon, 18 Apr 2011 20:11:39 +0000 (20:11 +0000)] 
tune2fs: Fix overflow of interval check

Add the check of maximum check interval.
s_checkinterval is 32bit variable, so it cannot be set more than 2^32.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 years agoe2fsprogs: Unify the upper limit of reserved blocks count
Kazuya Mio [Mon, 18 Apr 2011 20:11:34 +0000 (20:11 +0000)] 
e2fsprogs: Unify the upper limit of reserved blocks count

In e2fsprogs, the upper limit of reserved blocks count is a half of
filesystem's blocks count. This patch fixes the incorrect checks of
reserved blocks count.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agomke2fs: don't set stripe/stride to 1 block
Eric Sandeen [Mon, 4 Apr 2011 19:11:52 +0000 (15:11 -0400)] 
mke2fs: don't set stripe/stride to 1 block

Block devices may set minimum or optimal IO hints equal to
blocksize; in this case there is really nothing for ext4
to do with this information (i.e. search for a block-aligned
allocation?) so don't set fs geometry with single-block
values.

Zeev also reported that with a block-sized stripe, the
ext4 allocator spends time spinning in ext4_mb_scan_aligned(),
oddly enough.

Reported-by: Zeev Tarantov <zeev.tarantov@gmail.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agotests: New i_e2image test to validate image creation/conversion
Lukas Czerner [Wed, 18 May 2011 11:36:55 +0000 (13:36 +0200)] 
tests: New i_e2image test to validate image creation/conversion

This commit adds new regression test called i_e2image which should
validate expected behaviour of e2image raw and qcow2 image creation
and qcow2 -> raw image conversion. You can run it with "make check" as
the rest of regression tests.

Testing is performed on three filesystem images with different block
sizes (1024, 2048, 4096). It creates raw and qcow2 images from the
original and then convert qcow2 image back to raw image. The results are
checksummed and compared with pre-prepared results. All md5sums should
stay the same and raw image created from original and qcow2 image should
be the same as well (just for the record).

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoe2image: Support for conversion QCOW2 image into raw
Lukas Czerner [Wed, 18 May 2011 12:20:47 +0000 (14:20 +0200)] 
e2image: Support for conversion QCOW2 image into raw

This commit adds support for converting QCOW2 image created previously
with e2image into raw image. The QCOW2 image is detected automatically,
so there is not new option. Just use following command:

  e2image -r image.qcow image.raw

No that this tool is aimed to quickly convert qcow2 image created with
e2image into raw image. In order to improve speed we are doing some
assumption I believe might not be true for regular qcow2 images. So it
was not tested with regular QCOW2 images and it might not work with
them. The intention of this tool is only convert images previously
created by e2image.

Note that there is nothing special with QCOW2 images created by e2images
and it can be used with tools like qemu-img, or qemu-nbd without any
problems.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoe2image: Add support for qcow2 format
Lukas Czerner [Wed, 18 May 2011 11:36:53 +0000 (13:36 +0200)] 
e2image: Add support for qcow2 format

This commit adds support for exporting filesystem into QCOW2 image
format. Like sparse format this saves space, by writing only necessary
(metadata blocks) into image. Unlike sparse image, QCOW2 image is NOT
sparse, hence does not change its size by copying with not-sparse-aware
tools.

New options '-Q' has been added to tell the e2image to use QCOW2 as an
output image format. QCOW2 supports encryption and compression, however
e2image so far does no support such features, however you can still
scramble filenames with '-s' option.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoe2fsprogs: Add memory allocation and zero-out helpers
Lukas Czerner [Wed, 18 May 2011 12:19:52 +0000 (14:19 +0200)] 
e2fsprogs: Add memory allocation and zero-out helpers

Add functions ext2fs_get_memzero() which will malloc() the memory
using ext2fs_get_mem(), but it will zero the allocated memory afterwards
with memset().

Add function ext2fs_get_arrayzero() which will use calloc() for
allocating and zero-out the array.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agodebugfs: document htree-related commands in man page
Eric Sandeen [Wed, 11 May 2011 16:49:07 +0000 (11:49 -0500)] 
debugfs: document htree-related commands in man page

The debugfs commands dirsearch, dx_hash, and htree_dump were
never documented in the man page.  Do so.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agodebugfs: remove unused htree_dump "-l" argument
Eric Sandeen [Wed, 11 May 2011 16:46:19 +0000 (11:46 -0500)] 
debugfs: remove unused htree_dump "-l" argument

The long_opt / -l argument was apparently never implemented,
so remove it and associated argument parsing.

This slightly changes the (undocumented) behavior because it
no longer defaults to cwd if no filespec is specified...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agomke2fs: Allow specifying reserved_ratio via mke2fs.conf
Aditya Kali [Tue, 10 May 2011 21:51:31 +0000 (14:51 -0700)] 
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>
13 years agomke2fs: make s_inodes_per_group >= 8 in ext2fs_initialize
Tao Ma [Mon, 9 May 2011 15:38:42 +0000 (23:38 +0800)] 
mke2fs: make s_inodes_per_group >= 8 in ext2fs_initialize

current mkfs.ext4 fails if we tried with the following parameters:

mkfs.ext4  -m 0 -N 16 -O ^has_journal,^resize_inode,^uninit_bg,extent,meta_bg -b 1024 /dev/sdb3

It will cause segfault, but it is caused by another issue.  See my
patch "mke2fs: Avoid segmentation fault in
ext2fs_alloc_generic_bmap". And with that patch, the mkfs.ext4 will
fail with the error: /dev/sdb3: Memory allocation failed while setting
up superblock

The reason is that in ext2fs_initialize, we align s_inodes_per_group
to 8, but fails to consider the case that s_inodes_per_group < 8.
So make at least 8 inodes for s_inodes_per_group.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoe2fsprogs: fix memory leak in ext2fs_free_generic_bmap()
Lukas Czerner [Mon, 21 Mar 2011 10:14:00 +0000 (11:14 +0100)] 
e2fsprogs: fix memory leak in ext2fs_free_generic_bmap()

In ext2fs_free_generic_bmap() when we are freeing 64-bit bitmap, we do
call free_bmap() to free backend specific bitmap structures, however we
should also free ext2fs_generic_bitmap structure as well.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoe2fsprogs: fix freeing bitmap in allocation error path
Lukas Czerner [Mon, 21 Mar 2011 10:13:41 +0000 (11:13 +0100)] 
e2fsprogs: fix freeing bitmap in allocation error path

In ext2fs_alloc_generic_bmap() error path, when new bitmap allocation
fails ext2fs_generic_bitmap should be freed, however in current state it
first frees ext2fs_generic_bitmap and then
ext2fs_generic_bitmap->description which is wrong. This commit fix the
free ordering.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoMerge branch 'maint' into next
Theodore Ts'o [Sun, 8 May 2011 03:24:55 +0000 (23:24 -0400)] 
Merge branch 'maint' into next

13 years agoe2fsck: make the "fs is mounted; continue?" prompt more paranoid
Theodore Ts'o [Sun, 8 May 2011 03:14:06 +0000 (23:14 -0400)] 
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>
13 years agologsave: Update usage message so it is correct
Carsten Hey [Sun, 27 Mar 2011 01:14:09 +0000 (03:14 +0200)] 
logsave: Update usage message so it is correct

Addresses-Debian-Bug: #619788
Signed-off-by: Carsten Hey <carsten@debian.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agofilefrag: count 0 extents properly when verbose
Eric Sandeen [Thu, 5 May 2011 18:21:08 +0000 (13:21 -0500)] 
filefrag: count 0 extents properly when verbose

/boot/a: 0 extents found

works properly, but

Filesystem type is: ef53
Filesystem cylinder groups is approximately 61
File size of a is 0 (0 blocks, blocksize 1024)
 ext logical physical expected length flags
a: 1 extent found

yields 1 extent when it should be 0.

Fix this up by special-casing no extents returned in verbose
mode; skip printing the header for the columns too, since there
are no columns to print.

Also, in nonverbose mode we can set fm_extent_count to 0
so that FIEMAP will just query the extent count without gathering
details; clarify this with a comment.

Addresses-RedHat-Bugzilla: 653234
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoMerge branch 'maint' into next
Theodore Ts'o [Fri, 18 Mar 2011 20:44:37 +0000 (16:44 -0400)] 
Merge branch 'maint' into next

Conflicts:
lib/e2p/ls.c

13 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Fri, 18 Mar 2011 20:42:54 +0000 (16:42 -0400)] 
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoe2fsprogs: man page typo fixes
Eric Sandeen [Thu, 10 Mar 2011 16:09:35 +0000 (10:09 -0600)] 
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>
13 years agoadd new superblock field: s_overhead_blocks
Theodore Ts'o [Fri, 18 Mar 2011 18:47:15 +0000 (14:47 -0400)] 
add new superblock field: s_overhead_blocks

It turns out that it's very hard to calculate overheads in the face of
clustered allocation (bigalloc).  This is because multiple metadata
blocks from different block groups can end up in the same allocation
cluster.  Calculating the exact overhead requires O(all block bitmaps)
in memory, or O(number of block groups**2) in time.  So we will
calculate this at mkfs time and stash it in the superblock.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agomke2fs: If the device supports discard, don't print an error message
Theodore Ts'o [Mon, 28 Feb 2011 01:09:54 +0000 (20:09 -0500)] 
mke2fs: If the device supports discard, don't print an error message

Check to see if the device supports discard before starting the
progress bar, and then printing an error about inappropriate ioctl for
device (when creating a file system image to a file, for example).

Also, add a function signature in the ext2_io.h header file for
io_channel_discard() and fix an extra, uneeded argument in mke2fs's
call to that function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agoMerge branch 'maint' into next
Theodore Ts'o [Mon, 28 Feb 2011 00:47:44 +0000 (19:47 -0500)] 
Merge branch 'maint' into next

Conflicts:
lib/ext2fs/initialize.c

13 years agoAdd basic BIGALLOC support for cluster-based allocation
Theodore Ts'o [Sat, 26 Feb 2011 02:43:54 +0000 (21:43 -0500)] 
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>
13 years agoe2fsprogs: reserving code points for new ext4 quota feature
Aditya Kali [Tue, 15 Feb 2011 22:27:27 +0000 (14:27 -0800)] 
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>
13 years agomke2fs: Display progress report during the device discard
Lukas Czerner [Mon, 24 Jan 2011 19:52:00 +0000 (20:52 +0100)] 
mke2fs: Display progress report during the device discard

For some time now we are doing initial discard of the device prior to
filesystem creation. However, there is no feedback for the user and
hence on some devices with slow TRIM implementation it may appear that
mke2fs is stuck.

This commit introduce new function mke2fs_discard_device(), which is a
wrapper for io_channel_discard(). The discard is done in chunks of
2GB, which seems reasonably well for both slow and fast devices, and
discard progress is reported back to the user.

I gave up on doing fancy things like align discard according to
discard_alignment, checking for discard granularity and computing
estimate time. First of all, because it would require either new ioctl
to retrieve those information or use of libudev library, none of it
seems to be worth it. Regarding discard_granularity, I doubt there is
any sane device with discard granularity that big it would affect this.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoMerge branch 'maint' into next
Theodore Ts'o [Mon, 21 Feb 2011 02:54:43 +0000 (21:54 -0500)] 
Merge branch 'maint' into next

Conflicts:
misc/mke2fs.conf.5.in

13 years agomke2fs: Simple man page nodiscard option correction
Lukas Czerner [Tue, 1 Feb 2011 16:56:41 +0000 (17:56 +0100)] 
mke2fs: Simple man page nodiscard option correction

It is not true that 'nodiscard' is set as default, so remove this
sentence. The default is 'discard' and it is properly documented in man
page.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoe2fsprogs: enable user namespace xattrs by default
Eric Sandeen [Thu, 17 Feb 2011 21:56:17 +0000 (15:56 -0600)] 
e2fsprogs: enable user namespace xattrs by default

User namespace xattrs are generally useful, and I think extN
is the only filesystem requiring a special mount option to
enable them, when xattrs are otherwise available.  So this
change sets that mount option into the defaults, via a
mke2fs.conf option.

Note that if xattrs are config'd off, this will lead to a
mostly-harmless:

   EXT4-fs (sdc1): (no)user_xattr options not supported

message at mount time...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoe2fsprogs: turn off enforced fsck intervals by default
Eric Sandeen [Thu, 17 Feb 2011 21:55:15 +0000 (15:55 -0600)] 
e2fsprogs: turn off enforced fsck intervals by default

The forced fsck often comes at unexpected and inopportune moments,
and even enterprise customers are often caught by surprise when
this happens.  Because a filesystem with an error condition will
be marked as requiring fsck anyway, I submit that the time-based
and mount-based checks are not particularly useful, and that
administrators can schedule fscks on their own time, or tune2fs
the enforced intervals if they so choose.  This patch disables the
intervals by default, and I've added a new mkfs.conf option to
turn on the old behavior of random, unexpected, time-consuming
fscks at boot time.  ;)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoe2fsprogs: create com_err.h link in includedir
Eric Sandeen [Wed, 16 Feb 2011 18:01:39 +0000 (12:01 -0600)] 
e2fsprogs: create com_err.h link in includedir

After debian bug #192277, debian/rules started making a symlink
to com_err.h in /usr/include.  Now I have Fedora bug #550889
for the same issue, and perhaps it's time to make this link
by default, rather than fixing it up in packaging steps?

[ Changed by tytso to remove the explicit -s option; this will default
  to creating a hard link by default, which slightly faster.  If
  people want to use symlinks for all links during the install
  process, they can use configure option --enable-symlink-install.
  The reason for this change is that some file systems, like AFS,
  don't support symlinks, and AFS users complain when they can't build
  or install into AFS.  So I don't want to use symlinks
  unconditionally without a way of switching things back and forth,
  and it's easier if we just make all links made during the install
  process to be hard links or sym links. ]

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agobadblocks: Add accounting for different types of errors
Theodore Ts'o [Sun, 20 Feb 2011 20:29:51 +0000 (15:29 -0500)] 
badblocks: Add accounting for different types of errors

When using the -v option, report a breakdown of the number of read,
write, and comparison errors that were found by badblocks.

Thanks to Ragnar Kjørstad for providing this patch.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agobadblocks: Fix up recover_block handling in badblocks
Theodore Ts'o [Sun, 20 Feb 2011 20:19:47 +0000 (15:19 -0500)] 
badblocks: Fix up recover_block handling in badblocks

If there was a bad block for block #0, badblocks would never switch
back testing blocks more efficiently.  In addition, we were
double-incrementing the blocks to be tested in the read/write test due
to failure to remove code.

Thanks to Ragnar Kjørstad for pointing these problems out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agoMerge branch 'maint' into next
Theodore Ts'o [Fri, 18 Feb 2011 06:19:05 +0000 (01:19 -0500)] 
Merge branch 'maint' into next

13 years agobadblocks: Only report errors when reading/writing one block at a time
Theodore Ts'o [Fri, 18 Feb 2011 03:58:21 +0000 (22:58 -0500)] 
badblocks: Only report errors when reading/writing one block at a time

With Direct I/O, the kernel can report 0 bytes read even though the
first block has no errors.  So there are any errors, we need try to
read/write blocks one at a time and to get an accurate report.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agobadblocks: Add the -B option which forces the use of buffered I/O
Theodore Ts'o [Thu, 17 Feb 2011 04:40:46 +0000 (23:40 -0500)] 
badblocks: Add the -B option which forces the use of buffered I/O

If for some reason direct I/O does not work correctly, force the use
of buffered I/O.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agobadblocks: Fix bug so that O_DIRECT mode is correctly entered
Theodore Ts'o [Thu, 17 Feb 2011 04:35:49 +0000 (23:35 -0500)] 
badblocks: Fix bug so that O_DIRECT mode is correctly entered

The check to see if the block number is properly aligned was not done
correctly.  Fix this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agoMerge branch 'maint' into next
Theodore Ts'o [Fri, 11 Feb 2011 00:04:46 +0000 (19:04 -0500)] 
Merge branch 'maint' into next

13 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Fri, 11 Feb 2011 00:03:42 +0000 (19:03 -0500)] 
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agofilefrag: remove useless assignment
Jim Meyering [Tue, 1 Feb 2011 18:25:35 +0000 (19:25 +0100)] 
filefrag: remove useless assignment

The very next one memset's all bytes of fiemap to 0.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agopo: update zh_CN.po (from translationproject.org)
Dark Raven [Wed, 26 Jan 2011 23:54:25 +0000 (18:54 -0500)] 
po: update zh_CN.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agopo: update de.po (from translationproject.org)
Philipp Thomas [Wed, 26 Jan 2011 23:54:24 +0000 (18:54 -0500)] 
po: update de.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agopo: update id.po (from translationproject.org)
Theodore Ts'o [Mon, 24 Jan 2011 20:23:56 +0000 (15:23 -0500)] 
po: update id.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agopo: update vi.po (from translationproject.org)
Clytie Siddall [Mon, 24 Jan 2011 20:03:44 +0000 (15:03 -0500)] 
po: update vi.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Mon, 24 Jan 2011 20:03:43 +0000 (15:03 -0500)] 
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Mon, 24 Jan 2011 20:03:43 +0000 (15:03 -0500)] 
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Mon, 24 Jan 2011 20:03:42 +0000 (15:03 -0500)] 
po: update nl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Mon, 24 Jan 2011 20:03:42 +0000 (15:03 -0500)] 
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agopo: update de.po (from translationproject.org)
Philipp Thomas [Mon, 24 Jan 2011 20:03:41 +0000 (15:03 -0500)] 
po: update de.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Mon, 24 Jan 2011 20:03:41 +0000 (15:03 -0500)] 
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoresize2fs: fix computation of the real end of the bitmap to be 64-bit
Theodore Ts'o [Fri, 7 Jan 2011 21:38:13 +0000 (16:38 -0500)] 
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>
13 years agoe4defrag: Use libext2fs to get the correct superblock information
Kazuya Mio [Sun, 19 Dec 2010 22:01:24 +0000 (22:01 +0000)] 
e4defrag: Use libext2fs to get the correct superblock information

Currently, e4defrag always does byte-swapping when it gets superblock
information, so the calculation of the best extents count is not
correct on little endian machine. This doesn't cause data corruption,
but it may confuse users by showing the wrong extent count.  To solve
this problem, we use ext2fs_open() instead of get_superblock_info()
that is the original function.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoconfigure: control whether e4defrag is built/installed via --disable-defrag
Theodore Ts'o [Fri, 24 Dec 2010 20:19:44 +0000 (15:19 -0500)] 
configure: control whether e4defrag is built/installed via --disable-defrag

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agoe4defrag: fix segfault when e4defrag races with unlink/truncate
Kazuya Mio [Thu, 18 Nov 2010 21:51:25 +0000 (21:51 +0000)] 
e4defrag: fix segfault when e4defrag races with unlink/truncate

If a file gets deleted or truncated while e4defrag is trying to
operate on it, it's possible for it seg fault.

Addresses-Red-Hat-Bugzilla: #641926

Reported-by: Michal Piotrowski <mkkp4x4@gmail.com>
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agoMerge branch 'maint' into next
Theodore Ts'o [Thu, 23 Dec 2010 00:00:21 +0000 (19:00 -0500)] 
Merge branch 'maint' into next

Conflicts:
resize/resize2fs.c

13 years agoUpdate Release Notes, Changelogs, version.h, etc. for 1.41.14 release v1.41.14
Theodore Ts'o [Wed, 22 Dec 2010 23:55:15 +0000 (18:55 -0500)] 
Update Release Notes, Changelogs, version.h, etc. for 1.41.14 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agomke2fs: don't complain if the fs type "default" is not defined in mke2fs.conf
Theodore Ts'o [Wed, 22 Dec 2010 23:31:36 +0000 (18:31 -0500)] 
mke2fs: don't complain if the fs type "default" is not defined in mke2fs.conf

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agomke2fs: take the device size into account when determining the size type
Theodore Ts'o [Wed, 22 Dec 2010 23:22:40 +0000 (18:22 -0500)] 
mke2fs: take the device size into account when determining the size type

If the file system size was not specified on the command line, we were
always using the usage type "floppy" since we didn't determine the
device size until after calling parse_fs_types().  Doh!

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agoresize2fs: do not clear resize inode for 0 resvd blocks
Eric Sandeen [Tue, 21 Dec 2010 21:32:05 +0000 (15:32 -0600)] 
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>
13 years agolibext2fs: Don't use the extended rec_len encoding for standard file systems
Theodore Ts'o [Wed, 22 Dec 2010 18:53:02 +0000 (13:53 -0500)] 
libext2fs: Don't use the extended rec_len encoding for standard file systems

If the file system has a blocksize less than 64k, then don't use the
extended rec_len encoding, to be consistent with what the kernel will
do.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agomke2fs.8.in: add ENVIRONMENT section
Namhyung Kim [Mon, 29 Nov 2010 08:55:17 +0000 (17:55 +0900)] 
mke2fs.8.in: add ENVIRONMENT section

Add ENVIRONMENT section and describe behavior of MKE2FS_SYNC,
MKE2FS_CONFIG, MKE2FS_FIRST_META_BG, MKE2FS_DEVICE_SECTSIZE
and MKE2FS_SKIP_CHECK_MSG.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agolibext2fs: fix possible memory leak in write_journal_inode()
Namhyung Kim [Mon, 29 Nov 2010 08:55:16 +0000 (17:55 +0900)] 
libext2fs: fix possible memory leak in write_journal_inode()

ext2fs_zero_block2() allocates static buffer if needed so it
should be freed at last (call it again with 0 args).

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 years agomke2fs: clean up error handling in mke2fs_setup_tdb()
Theodore Ts'o [Wed, 22 Dec 2010 02:57:02 +0000 (21:57 -0500)] 
mke2fs: clean up error handling in mke2fs_setup_tdb()

Avoid memory leaks on error paths, and make sure we issue the correct
error messages in the case of (highly) unlikely errors.

Original patch submitted by Namhyung Kim <namhyung@gmail.com>, but
highly rewritten since then.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>