]> git.ipfire.org Git - thirdparty/e2fsprogs.git/log
thirdparty/e2fsprogs.git
10 years agoUpdate release notes, etc., for final 1.42.8 release v1.42.8
Theodore Ts'o [Fri, 21 Jun 2013 03:11:13 +0000 (23:11 -0400)] 
Update release notes, etc., for final 1.42.8 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agomke2fs: calculate journal blocks just after fs initialize
Ashish Sangwan [Sat, 11 May 2013 03:42:13 +0000 (09:12 +0530)] 
mke2fs: calculate journal blocks just after fs initialize

We can calculate journal blocks as soon as blocksize is set.
It will help to figure out wrong journal blocks count earlier.
This will save some un-necessary initialization.

Without patch output =>
mke2fs /dev/sdc1 -J size=1048576
mke2fs 1.42.7 (21-Jan-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
61312 inodes, 244936 blocks
12246 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=251658240
8 block groups
32768 blocks per group, 32768 fragments per group
7664 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376

Allocating group tables: done
Writing inode tables: done

The requested journal size is 268435456 blocks; it must be
between 1024 and 10240000 blocks.  Aborting.

With patch output =>
mke2fs /dev/sdc1 -J size=1048576
mke2fs 1.42.7 (21-Jan-2013)

The requested journal size is 268435456 blocks; it must be
between 1024 and 10240000 blocks.  Aborting.

Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoresize2fs: move bitmaps if shrinking would orphan them
Eric Sandeen [Wed, 19 Jun 2013 01:37:05 +0000 (20:37 -0500)] 
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>
10 years agoUse ext2fs_cpu_to_be32() instead of cpu_to_be32() in kernel-jbd.h
Theodore Ts'o [Sun, 16 Jun 2013 22:58:40 +0000 (18:58 -0400)] 
Use ext2fs_cpu_to_be32() instead of cpu_to_be32() in kernel-jbd.h

Avoid compatibility problems by using the byte swapping functions
defined by e2fsprogs, instead of the ones defined in the system header
files.  We use them everywhere else, so we should use them in
kernel-jbd.h too.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoUpdate Release Notes, Changelogs, version.h, for 1.42.8 release
Theodore Ts'o [Sun, 16 Jun 2013 22:36:34 +0000 (18:36 -0400)] 
Update Release Notes, Changelogs, version.h, for 1.42.8 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoWork around Debian Bug #712530
Theodore Ts'o [Sun, 16 Jun 2013 20:14:40 +0000 (16:14 -0400)] 
Work around Debian Bug #712530

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

Addresses-Debian-Bug: #708307

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoTry to use secure_getenv() in preference to __secure_getenv()
Theodore Ts'o [Sun, 16 Jun 2013 18:34:59 +0000 (14:34 -0400)] 
Try to use secure_getenv() in preference to __secure_getenv()

If secure_getenv() use it in preference to __secure_getenv().
Starting with (e)glibc version 2.17, secure_getenv() exists, while
__secure_getenv() only works with shared library links (where it is a
weak symbol), but not for static links with /lib/libc.a

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agomke2fs: don't set root dir UID/GID automatically
Andreas Dilger [Sun, 16 Jun 2013 01:45:37 +0000 (21:45 -0400)] 
mke2fs: don't set root dir UID/GID automatically

Don't change the root directory's UID/GID automatically just because
mke2fs was run as a non-root user.  This can be confusing for users,
and is not flexible for non-root installation tools that need to
create a filesystem with different ownership from the current user.

Add the "-E root_owner[=uid:gid]" option to mke2fs so that the user
and group can be explicitly specified for the root directory.  If
the "=uid:gid" argument is not specified, the current UID and GID
are extracted from the running process, as was done in the past.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agomke2fs: clarify mke2fs and mke2fs.conf man pages
Theodore Ts'o [Sun, 16 Jun 2013 01:19:39 +0000 (21:19 -0400)] 
mke2fs: clarify mke2fs and mke2fs.conf man pages

Addresses-Debian-Bug: #712429
Addresses-Debian-Bug: #712430

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: fix crash when using e2image -I with a 64-bit file system
Theodore Ts'o [Sun, 16 Jun 2013 00:52:08 +0000 (20:52 -0400)] 
e2image: fix crash when using e2image -I with a 64-bit file system

Addresses-Debian-Bug: #703067

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agomke2fs: sort option parsing, deprecate "-R"
Andreas Dilger [Sat, 15 Jun 2013 22:47:30 +0000 (18:47 -0400)] 
mke2fs: sort option parsing, deprecate "-R"

A minor cleanup to order the command-line option parsing in
alphabetical order, except for "-E" and "-R", which need to
be co-located.

Print a message that the "-R" option is deprecated.  It has
been deprecated since 2005 (commit c6a44136b9b).

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agotests: clean up sed filtering of test output
Andreas Dilger [Sat, 15 Jun 2013 22:44:09 +0000 (18:44 -0400)] 
tests: clean up sed filtering of test output

The sed filters for test outputs that are used to remove build and
test specific information (such as version strings, dates, times,
UUIDs) were unconditionally deleting the first line of output.  This
would normally contain the tool version string, but in some cases
contained other information that was being lost.  This can lead to
difficulty debugging test failures.

The sed filtering has been changed to only remove the actual version
strings.  As well, similar filter strings were duplicated throughout
many scripts, and "sed" and "tr" were often called multiple times in
a pipeline.  These have been consolidated into a single filter.sed
file to avoid having to maintain these filters in multiple places.

In a few cases, accidentally deleted messages have been restored to
the expect output for the tests.  In other cases, trivial whitespace
has been changed in the expect files.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agolibext2fs: optimize ext2fs_bg_has_super()
Theodore Ts'o [Sat, 15 Jun 2013 22:29:52 +0000 (18:29 -0400)] 
libext2fs: optimize ext2fs_bg_has_super()

Reduce the CPU time needed when checking whether a block group has a
sparse superblock.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: remove lib/ext2fs/sparse.c
Theodore Ts'o [Mon, 10 Jun 2013 13:15:43 +0000 (09:15 -0400)] 
libext2fs: remove lib/ext2fs/sparse.c

This file was never getting compiled, and there is no user of
ext2fs_list_backups() in the e2fsprogs sources.  So remove it as a
clean up.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agotests: add new test f_extent_oobounds
Theodore Ts'o [Fri, 7 Jun 2013 03:52:08 +0000 (23:52 -0400)] 
tests: add new test f_extent_oobounds

This tests creates a file system where the last entry in one leaf
block overlaps with logical block range in the first entry of the next
leaf block.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2fsck: detect invalid extents at the end of an extent-block
David Jeffery [Fri, 7 Jun 2013 00:04:33 +0000 (20:04 -0400)] 
e2fsck: detect invalid extents at the end of an extent-block

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

From a part of a dump_extents output:

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

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

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

Signed-off-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
10 years agoe2fsck: fix gcc -Wall nits
Theodore Ts'o [Mon, 20 May 2013 01:13:33 +0000 (21:13 -0400)] 
e2fsck: fix gcc -Wall nits

Perhaps the most serious fix up is a type-punning warning which could
result in miscompilation with overly enthusiastic compilers.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agomisc: fix gcc -Wall warnings
Theodore Ts'o [Mon, 20 May 2013 00:03:48 +0000 (20:03 -0400)] 
misc: fix gcc -Wall warnings

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: fix gcc -Wall warnings
Theodore Ts'o [Sun, 19 May 2013 22:50:10 +0000 (18:50 -0400)] 
libext2fs: fix gcc -Wall warnings

Primarily signed vs unsigned and const warnings.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agochattr: clarify that the compression flags are not supported by ext4
Theodore Ts'o [Mon, 13 May 2013 13:10:16 +0000 (09:10 -0400)] 
chattr: clarify that the compression flags are not supported by ext4

... or indeed by any mainline kernel, since the compression patches
were never stablized.

Addresses-Debian-Bug: #707609

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reported-by: "Creidieki M. Crouch" <creidieki@gmail.com>
11 years agoe2fsck: don't use IO_FLAG_EXCLUSIVE for read-only root file systems
Theodore Ts'o [Sat, 4 May 2013 23:07:18 +0000 (19:07 -0400)] 
e2fsck: don't use IO_FLAG_EXCLUSIVE for read-only root file systems

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

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

Reported-by: Calvin Owens <jcalvinowens@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoconfigure: update configure script to be in sync with the configure.in file
Theodore Ts'o [Sat, 4 May 2013 23:01:09 +0000 (19:01 -0400)] 
configure: update configure script to be in sync with the configure.in file

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agotests: add new test f_zero_xattr
Theodore Ts'o [Thu, 25 Apr 2013 04:28:05 +0000 (00:28 -0400)] 
tests: add new test f_zero_xattr

E2fsck previously was complaining with zero-length extended attributes
if they appeared in the in-inode xattr space.  Test to make sure
e2fsck is now happy with such xattrs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoe2fsprogs: allow 0-length xattr values in e2fsck
Eric Sandeen [Thu, 25 Apr 2013 04:14:33 +0000 (00:14 -0400)] 
e2fsprogs: allow 0-length xattr values in e2fsck

e2fsck thinks that this:

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

results in a filesystem with corruption:

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

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

Reported-by: David Shaw <dshaw@jabberwocky.com>
Reported-by: Harald Reindl <h.reindl@thelounge.net>
Addresses-Red-Hat-Bugzilla: #557959
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agocrcsum: remove the -b option since ext2fs_crc32c_be is dropped in 1.43.x
Theodore Ts'o [Mon, 22 Apr 2013 04:04:36 +0000 (00:04 -0400)] 
crcsum: remove the -b option since ext2fs_crc32c_be is dropped in 1.43.x

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibext2fs: only use override function when reading an 128 byte inode
Theodore Ts'o [Mon, 22 Apr 2013 03:53:26 +0000 (23:53 -0400)] 
libext2fs: only use override function when reading an 128 byte inode

The ext2fs_read_inode_full() function should not use fs->read_inode()
if the caller has requested more than the base 128 byte inode
structure and the inode size is greater than 128 bytes.  Otherwise the
caller won't get all of the bytes that they were asking for, since
there's no way for the fs->read_inode override function can know what
the size of the buffer passed to ext2fs_read_inode_full().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoe2image: fix flag settings in e2image.h
Tomas Racek [Mon, 22 Apr 2013 03:48:58 +0000 (23:48 -0400)] 
e2image: fix flag settings in e2image.h

This prevents from SIGSEGV when -s options is used.

Signed-off-by: Tomas Racek <tracek@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
11 years agoe2image: require that -a option is used only with raw or QCOW2 image
Tomas Racek [Mon, 22 Apr 2013 03:21:32 +0000 (23:21 -0400)] 
e2image: require that -a option is used only with raw or QCOW2 image

All data cannot be included in normal image file so e2image should exit
in this case.

Signed-off-by: Tomas Racek <tracek@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
11 years agoe2image: man: fix typo
Tomas Racek [Mon, 22 Apr 2013 03:21:32 +0000 (23:21 -0400)] 
e2image: man: fix typo

Signed-off-by: Tomas Racek <tracek@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoe2image: remove useless exit call
Tomas Racek [Mon, 22 Apr 2013 03:21:32 +0000 (23:21 -0400)] 
e2image: remove useless exit call

Exit is called right after the install_image anyway so this one can
be removed.

Signed-off-by: Tomas Racek <tracek@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agotune2fs: disallow tune2fs to set inode size larger than block size
Akira Fujita [Mon, 22 Apr 2013 03:14:28 +0000 (23:14 -0400)] 
tune2fs: disallow tune2fs to set inode size larger than block size

Disallow tune2fs command to set the inode size to be larger than the
block size.  Without this patch, tune2fs makes the file system to be
unmountable.

Steps to reproduce:

1.Create ext4 without flex_bg (or just create ext3)
  # mke2fs -t ext4 -O ^flex_bg DEV

2.Set inode size larger than block size
  # tune2fs -I 8192 DEV

3. We failed to mount FS
  # mount DEV MP
    mount: wrong fs type, bad option, bad superblock on /dev/sda7,
           missing codepage or helper program, or other error
           In some cases useful info is found in syslog - try
           dmesg | tail  or so

Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agotests: add more tests for off-line resizing
Theodore Ts'o [Mon, 1 Apr 2013 00:34:24 +0000 (20:34 -0400)] 
tests: add more tests for off-line resizing

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agotests: create crcsum progam to support resizing tests
Theodore Ts'o [Mon, 1 Apr 2013 00:31:46 +0000 (20:31 -0400)] 
tests: create crcsum progam to support resizing tests

The only checksum program which we can reliably count upon being
installed on all systems is "sum", which is not a particular robust
checksum.  The problem with using md5sum or sha1sum is it hat it may
not be installed on all systems.  So create a crcsum program which is
used so we can validate that a data file on a resized file system has
not been corrupted.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agomke2fs: don't display bigalloc/quota fs feature warnings in quiet mode
Theodore Ts'o [Mon, 1 Apr 2013 00:29:46 +0000 (20:29 -0400)] 
mke2fs: don't display bigalloc/quota fs feature warnings in quiet mode

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoresize2fs: fix off-line resize of file systems with flex_bg && !resize_inode
Theodore Ts'o [Sun, 31 Mar 2013 17:24:39 +0000 (13:24 -0400)] 
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>
11 years agoblkid: remove no-op statement which caused a clang warning
Theodore Ts'o [Wed, 13 Mar 2013 18:34:08 +0000 (14:34 -0400)] 
blkid: remove no-op statement which caused a clang warning

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agodebugfs: fix command failures for extent_inode commands that take arguments
Theodore Ts'o [Wed, 13 Mar 2013 18:19:16 +0000 (14:19 -0400)] 
debugfs: fix command failures for extent_inode commands that take arguments

The extent_inode commands split_node, replace_node, and insert_node
take arguments which resulted in confusing error messages after
succeeding.  Fix this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoe2fsck: fix build failure with --enable-jbd-debug
Theodore Ts'o [Wed, 13 Mar 2013 18:02:53 +0000 (14:02 -0400)] 
e2fsck: fix build failure with --enable-jbd-debug

Commit e3507739e4185 introduced a build failure if e2fsprogs is
configured with --enable-jbd-debug.  Fix this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibext2fs: Provide prototype for ext2fs_symlink()
Jan Kara [Mon, 25 Feb 2013 05:55:07 +0000 (05:55 +0000)] 
libext2fs: Provide prototype for ext2fs_symlink()

New function ext2fs_symlink() doesn't have a prototype in ext2fs.h and
thus debugfs compilation gives warning:

debugfs.c:2219:2: warning: implicit declaration of function 'ext2fs_symlink'

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoe2p: Fix 's' handling in parse_num_blocks2()
Jan Kara [Mon, 25 Feb 2013 05:55:05 +0000 (05:55 +0000)] 
e2p: Fix 's' handling in parse_num_blocks2()

parse_num_blocks2() wrongly did:
num << 1;
when log_block_size < 0. That is obviously wrong as such statement has
no effect (and the compiler properly warns about it). Callers expect
returned value to be in bytes when log_block_size < 0 so fix the
statement accordingly.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agochattr: allow clearing the extent flag
Theodore Ts'o [Sat, 23 Feb 2013 03:23:05 +0000 (22:23 -0500)] 
chattr: allow clearing the extent flag

In order to support kernels which support conversion of extent-mapped
files to direct/indirect mapped files, remove the sanity check which
prevented clearing the extent flag in chattr.  Kernels which don't
support this will simply give an Operation Not Supported error.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agodebugfs: add sanity check to make sure we never shift 64 bits right
Theodore Ts'o [Mon, 28 Jan 2013 14:02:23 +0000 (09:02 -0500)] 
debugfs: add sanity check to make sure we never shift 64 bits right

In the tables which are used to parse the fields for the set_fields
command, there should never be a entry which has a size set to 8
bytes, and two pointers defined.  Not only would it result in
undefined behavior in the compiled code, it doesn't make any sense and
is definitely a bug.

Reported-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agopo: update de.po (from translationproject.org)
Philipp Thomas [Mon, 28 Jan 2013 03:44:56 +0000 (22:44 -0500)] 
po: update de.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoFix warnings about functions not returning a value
Philipp Thomas [Mon, 28 Jan 2013 03:41:44 +0000 (22:41 -0500)] 
Fix warnings about functions not returning a value

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agobuild: quiet build warnings for "gcc -Wall"
Andreas Dilger [Mon, 28 Jan 2013 03:29:01 +0000 (22:29 -0500)] 
build: quiet build warnings for "gcc -Wall"

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agocontrib: add missing '-p' to fallocate's usage message
Zheng Liu [Fri, 25 Jan 2013 03:44:19 +0000 (11:44 +0800)] 
contrib: add missing '-p' to fallocate's usage message

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibext2fs: fix ext2fs_llseek on i386
Phillip Susi [Thu, 24 Jan 2013 16:21:56 +0000 (11:21 -0500)] 
libext2fs: fix ext2fs_llseek on i386

ext2fs_llseek() was using lseek instead of lseek64.  The
only time it would use lseek64 is if passed an offset that
overflowed 32 bits.  This works for SEEK_SET, but not
SEEK_CUR, which can apply a small offset to move the file
pointer past the 32 bit limit.

The code has been changed to instead try lseek64 first, and
fall back to lseek if that fails.  It also was doing a
runtime check of the size of off_t.  This has been moved to
compile time.

This fixes a problem which would cause e2image when built for
x86-32 to bomb out when used with large file systems.

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoUpdate Release Notes, Changelogs, version.h, for final 1.42.7 release v1.42.7
Theodore Ts'o [Tue, 22 Jan 2013 03:03:18 +0000 (22:03 -0500)] 
Update Release Notes, Changelogs, version.h, for final 1.42.7 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agomke2fs, tune2fs, resize2fs: add warning messages for bigalloc and quota
Theodore Ts'o [Tue, 22 Jan 2013 00:07:38 +0000 (19:07 -0500)] 
mke2fs, tune2fs, resize2fs: add warning messages for bigalloc and quota

The bigalloc and quota features have some known issues, so issue
warnings in case users try to use them.

More information can be found here:
https://ext4.wiki.kernel.org/index.php/Bigalloc
https://ext4.wiki.kernel.org/index.php/Quota

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agocontrib: fix namespace leakage in spd_readdir
Theodore Ts'o [Mon, 21 Jan 2013 22:19:50 +0000 (17:19 -0500)] 
contrib: fix namespace leakage in spd_readdir

Declare the internal symbols alloc_dirstruct() and cache_dirstruct()
as static so they don't leak out into the global namespace.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agocontrib: add thread locking and readdir64_r support to spd_readdir
Theodore Ts'o [Mon, 21 Jan 2013 22:15:25 +0000 (17:15 -0500)] 
contrib: add thread locking and readdir64_r support to spd_readdir

This is part of a series of improvements from a 2008 version of
spd_readdir.c that somehow didn't make it into the version which we
checked into e2fsprogs git tree.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agocontrib: add safe_getenv() support to spd_readdir
Theodore Ts'o [Mon, 21 Jan 2013 21:35:16 +0000 (16:35 -0500)] 
contrib: add safe_getenv() support to spd_readdir

This is part of a series of improvements from a 2008 version of
spd_readdir.c that somehow didn't make it into the version which we
checked into e2fsprogs git tree.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoresize2fs: move a cluster at a time with bigalloc file systems
Theodore Ts'o [Sun, 20 Jan 2013 05:25:00 +0000 (00:25 -0500)] 
resize2fs: move a cluster at a time with bigalloc file systems

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoresize2fs: correctly account for clusters when calculating summary stats
Theodore Ts'o [Sun, 20 Jan 2013 04:41:36 +0000 (23:41 -0500)] 
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>
11 years agolibext2fs: teach the ext2fs_*_block_bitmap_range2() about clusters
Theodore Ts'o [Sun, 20 Jan 2013 04:21:11 +0000 (23:21 -0500)] 
libext2fs: teach the ext2fs_*_block_bitmap_range2() about clusters

The ext2fs_{mark,unmark,test}_block_bitmap2() functions understand
about clusters, and will take block numbers and convert them to
clusters before checking the bitmap.  The
ext2fs_*_block_bitmap_range2() functions did not do this, which made
them inconsistent.  Fortunately, nothing has depended on this
incorrect behavior, and in fact most of the usage of these functions
have only recently been added, and only for optimizations that were
only enabled for non-bigalloc file systems.

So this is a change in previously exported functions, but (a) it
doesn't change the behavior at all for non-bigalloc file systems, and
(b) the change is more likely to fix bugs for bigalloc file systems.
For example, this change fixes a problem with resize2fs and bigalloc
file systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoUpdate Release Notes, Changelogs, version.h, etc. for 1.42.7 release
Theodore Ts'o [Wed, 16 Jan 2013 18:50:12 +0000 (13:50 -0500)] 
Update Release Notes, Changelogs, version.h, etc. for 1.42.7 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoresize2fs: check in test-resize script
Theodore Ts'o [Wed, 16 Jan 2013 18:43:36 +0000 (13:43 -0500)] 
resize2fs: check in test-resize script

This should be made into a more formal, automated test case, but for
now, save this as script since it's useful for validating resize2fs's
handling of very large file systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoUpdate config.{guess,sub} to the latest version
Theodore Ts'o [Wed, 16 Jan 2013 18:10:54 +0000 (13:10 -0500)] 
Update config.{guess,sub} to the latest version

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agopo: update vi.po (from translationproject.org)
Trần Ngọc Quân [Wed, 16 Jan 2013 04:30:36 +0000 (23:30 -0500)] 
po: update vi.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Wed, 16 Jan 2013 04:30:36 +0000 (23:30 -0500)] 
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Wed, 16 Jan 2013 04:30:36 +0000 (23:30 -0500)] 
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Wed, 16 Jan 2013 04:30:36 +0000 (23:30 -0500)] 
po: update nl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Wed, 16 Jan 2013 04:30:35 +0000 (23:30 -0500)] 
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agopo: update de.po (from translationproject.org)
Philipp Thomas [Wed, 16 Jan 2013 04:30:35 +0000 (23:30 -0500)] 
po: update de.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Wed, 16 Jan 2013 04:30:35 +0000 (23:30 -0500)] 
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoUpdate misc/Makefile.in using "make depend"
Theodore Ts'o [Wed, 16 Jan 2013 04:28:17 +0000 (23:28 -0500)] 
Update misc/Makefile.in using "make depend"

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoe2image: add -a switch to include all data
Phillip Susi [Tue, 15 Jan 2013 20:31:23 +0000 (15:31 -0500)] 
e2image: add -a switch to include all data

Normally the raw and QCOW2 images only contain fs metadata.
Add a new switch ( -a ) to include all data.  This makes it
possible to use e2image to clone a whole filesystem.

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agotests: create test for debugfs creating special files
Theodore Ts'o [Tue, 15 Jan 2013 19:52:30 +0000 (14:52 -0500)] 
tests: create test for debugfs creating special files

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agodebugfs: fix mknod command so that it updates the block group statistics
Theodore Ts'o [Tue, 15 Jan 2013 19:50:02 +0000 (14:50 -0500)] 
debugfs: fix mknod command so that it updates the block group statistics

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agodebugfs: add symlink command
Darren Hart [Fri, 4 Jan 2013 20:00:59 +0000 (12:00 -0800)] 
debugfs: add symlink command

Add support for symbolic links using a new symlink command.  Modeled
after the do_mkdir() command.

Testing demonstrates both fastlinks and slowlinks work correctly.
Very long target paths fail as the command parsing appears to truncate
the input to somewhere around 256 bytes.

Signed-off-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Andreas Dilger <adilger@dilger.ca>
11 years agolibext2fs: add the ext2fs_symlink() function
Darren Hart [Fri, 4 Jan 2013 20:00:58 +0000 (12:00 -0800)] 
libext2fs: add the ext2fs_symlink() function

Creating symlinks is a complex affair when accounting for slowlinks.

Create a new function, ext2fs_symlink(), modeled after ext2fs_mkdir().
Like ext2fs_mkdir(), ext2fs_symlink() takes on the task of allocating a
new inode and block (for slowlinks), setting up sane default values in
the inode, copying the target path to either the inode (for fastlinks)
or to the first block (for slowlinks), and accounting for the inode and
block stats.  Disallow link targets longer than blocksize as the Linux
kernel prevents this.

It does not attempt to expand the parent directory, instead returning
EXT2_ET_DIR_NO_SPACE and leaving it to the caller to expand just as
ext2fs_mkdir() does.  Ideally, I think both of these functions should
make a single attempt to expand the directory.

[ Fixed a few bugs discovered when creating a test case for ext2fs_symlink() ]

Signed-off-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Andreas Dilger <adilger@dilger.ca>
11 years agolibext2fs: add error codes from 1.43.x development branch
Theodore Ts'o [Wed, 16 Jan 2013 19:07:25 +0000 (14:07 -0500)] 
libext2fs: add error codes from 1.43.x development branch

To maintain the error codes numbering, we need to pull in the changes
from the 1.43.x development branch for the libext2's error table.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agomke2fs: document bigalloc and cluster-size
Zheng Liu [Sun, 13 Jan 2013 09:08:15 +0000 (17:08 +0800)] 
mke2fs: document bigalloc and cluster-size

Bigalloc feature has been used for a long time, but the documentation
in mke2fs is still missing.  So add it.

Addresses-Debian-Bug: #669730

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agolibext2fs: avoid 32-bit overflow in ext2fs_initialize with a 512M cluster size
Theodore Ts'o [Tue, 15 Jan 2013 00:29:54 +0000 (19:29 -0500)] 
libext2fs: avoid 32-bit overflow in ext2fs_initialize with a 512M cluster size

If the user attemps to create a 512MB cluster, we need to adjust the
defaults to avoid a 32-bit overflow of s_blocks_per_group.  Also check
to make sure that the caller of ext2fs_initialize() has not given a
value of s_clusters_per_group that would result in an overflow of
s_blocks_per_group.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
11 years agomke2fs: teach mke2fs to understand -b 4k and -C 256M
Theodore Ts'o [Tue, 15 Jan 2013 00:03:11 +0000 (19:03 -0500)] 
mke2fs: teach mke2fs to understand -b 4k and -C 256M

The -b and -C options now use parse_num_blocks2() instead of strtol,
so that users can specify -C 256M instead of the much less convenient
-C 268435456.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
11 years agolibe2p: teach parse_num_blocks2() to return bytes if log_block_size < 0
Theodore Ts'o [Tue, 15 Jan 2013 00:01:25 +0000 (19:01 -0500)] 
libe2p: teach parse_num_blocks2() to return bytes if log_block_size < 0

Previously the behavior of parse_num_block2 was undefined if
log_block_size was less than zero.  It will now return a number in
units of bytes.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
11 years agomke2fs: the -g option will now specify the clusters per block group
Theodore Ts'o [Mon, 14 Jan 2013 22:30:23 +0000 (17:30 -0500)] 
mke2fs: the -g option will now specify the clusters per block group

If bigalloc is enabled, then -g will specify the clusters per block
group.  (If bigalloc is not enabled, then a cluster == a block, so the
meaning of -g is not changed.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
11 years agomke2fs: enforce that the cluster size must be greater that the block size
Theodore Ts'o [Mon, 14 Jan 2013 22:28:00 +0000 (17:28 -0500)] 
mke2fs: enforce that the cluster size must be greater that the block size

In addition, do not allow a cluster size of 1024, since that will be
interpreted by ext2fs_initialize() as requesting the default cluster
size.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Reported-by: Zheng Liu <wenqing.lz@taobao.com>
11 years agomke2fs: require the bigalloc feature explicity if the cluster size is set
Zheng Liu [Sun, 13 Jan 2013 09:08:13 +0000 (17:08 +0800)] 
mke2fs: require the bigalloc feature explicity if the cluster size is set

When cluster-size is specified without the bigalloc feature, mke2fs
will ignore this argument silently.  But user might think bigalloc
feature has been enabled unless they use the dumpe2fs command.  So now
we ask user to set bigalloc feature explicity when cluster-size is
enabled.  This can make sure that users understand what they are doing
because bigalloc might impact the performance for some workloads.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agodebugfs: fix gcc-wall complaints
Theodore Ts'o [Mon, 14 Jan 2013 19:41:46 +0000 (14:41 -0500)] 
debugfs: fix gcc-wall complaints

Fix the missing function prototypes from the recently added new
debugfs commands, plus some signed vs unsigned comparison complaints.

Also change the abbreviation of the block_dump command from "bp" to
the more appropriate "bp".

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoresize2fs: add debugging code to test the old online resizing interfaces
Theodore Ts'o [Sat, 12 Jan 2013 22:33:44 +0000 (17:33 -0500)] 
resize2fs: add debugging code to test the old online resizing interfaces

The old online resize ioctl interfaces are still present in the
kernel, and we want to make it easy to test both the kernel code for
those older interfaces, and resize2fs's use of those interfaces in a
relatively easy manner.

To do this, resize2fs will now check the environment variable
RESIZE2FS_KERNEL_VERSION.  If the version given is less than 3.3, then
do not try using the new resizing ioctl, but instead use the resizing
ioctls that were used before Linux version 3.3.

If the version given is less than 3.7, then emulate sanity checks
which get done to protect against the fact that the new resizing ioctl
prior to 3.7 did not handle meta_bg resizing.  (This was previously
tested via the presence of the RESIZE2FS_NO_META_BG_RESIZE environment
variable.  But the new environment variable, RESIZE2FS_KERNEL_VERISON,
is more general.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
11 years agodebugfs: document zap_block & block_dump
Eric Sandeen [Fri, 11 Jan 2013 07:40:25 +0000 (07:40 +0000)] 
debugfs: document zap_block & block_dump

What little docs there were had a cut & paste error.
We can do better. :)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoconfig: silence printf format warnings
Eric Whitney [Fri, 4 Jan 2013 10:27:12 +0000 (10:27 +0000)] 
config: silence printf format warnings

The printfs in the asm_types.c code contained within parse-types.sh
expect sizeof to return an int.  Fix this for architectures where this
isn't true (x86_64, etc.) so we don't see warning messages while
running the configure script.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibext2fs: ext2fs_open2() should not set ret_fs after a MMP failure
Theodore Ts'o [Wed, 9 Jan 2013 01:47:11 +0000 (20:47 -0500)] 
libext2fs: ext2fs_open2() should not set ret_fs after a MMP failure

The addition of MMP code was added in the wrong place, so ret_fs could
get set (and EXT2_FLAG_NOFREE_ON_ERROR was cleared as well, which
could confuse e2fsck which depends on this flag being cleared if
ext2fs_open2() succeeded.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoe2fsck: avoid memory corruption on ext2fs_open2 failure
Nickolai Zeldovich [Tue, 8 Jan 2013 20:45:31 +0000 (15:45 -0500)] 
e2fsck: avoid memory corruption on ext2fs_open2 failure

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

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoe2fsck: do not crash on long log file names
Nickolai Zeldovich [Tue, 8 Jan 2013 20:31:18 +0000 (15:31 -0500)] 
e2fsck: do not crash on long log file names

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

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoe2fsck: show size requested when memory allocation fails
Eric Sandeen [Mon, 7 Jan 2013 21:45:54 +0000 (15:45 -0600)] 
e2fsck: show size requested when memory allocation fails

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

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

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agomke2fs: check extents feature when bigalloc feature is enabled
Zheng Liu [Sun, 6 Jan 2013 12:25:17 +0000 (20:25 +0800)] 
mke2fs: check extents feature when bigalloc feature is enabled

When bigalloc feature is enabled in mkfs, extents feature also needs
to be enabled.  But now when bigalloc feature is enabled without
extents feature, users will not get any warning messages until they
try to mount this file system.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoFix 32-bit overflow problems: dgrp_t * s_blocks_per_group
Theodore Ts'o [Thu, 3 Jan 2013 18:42:38 +0000 (13:42 -0500)] 
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>
11 years agoresize2fs: use [un]mark_block_range bitmap functions to reduce CPU usage
Theodore Ts'o [Thu, 3 Jan 2013 13:35:25 +0000 (08:35 -0500)] 
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>
11 years agoresize2fs: add resource tracking as a debug option
Theodore Ts'o [Thu, 3 Jan 2013 03:43:36 +0000 (22:43 -0500)] 
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>
11 years agoresize2fs: fix 32-bit overflow when calculating the number of free blocks
Theodore Ts'o [Thu, 3 Jan 2013 14:01:22 +0000 (09:01 -0500)] 
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>
11 years agoresize2fs: fix 32-bit overflow issue which can corrupt 64-bit file systems
Theodore Ts'o [Thu, 3 Jan 2013 04:31:04 +0000 (23:31 -0500)] 
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>
11 years agoClean up texinfo files
Theodore Ts'o [Wed, 2 Jan 2013 15:06:09 +0000 (10:06 -0500)] 
Clean up texinfo files

Fix up the com_err.texinfo file so it will produce a valid printed
output, by cleaning up some errors in the texinfo file, and updating
texinfo.tex to be consistent with the version in the doc subdirectory.

Also add rules so we can generate pdf and ps files from
com_err.texinfo and libext2fs.texinfo.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoUpdate changelogs for 1.42.7 release
Theodore Ts'o [Tue, 1 Jan 2013 22:17:14 +0000 (17:17 -0500)] 
Update changelogs for 1.42.7 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agodebugfs: fixup the hard-coded buffer length in dump_file
Zheng Liu [Tue, 1 Jan 2013 12:30:14 +0000 (20:30 +0800)] 
debugfs: fixup the hard-coded buffer length in dump_file

Allocate the block buffer in dump_file() instead of assuming that the
block size is no more than 8k.

CC: George Spelvin <linux@horizon.com>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agodebain: update e2fslibs.symbols with newly exported functions
Theodore Ts'o [Tue, 1 Jan 2013 19:57:06 +0000 (14:57 -0500)] 
debain: update e2fslibs.symbols with newly exported functions

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoFix gcc -Wall nits
Theodore Ts'o [Tue, 1 Jan 2013 18:28:27 +0000 (13:28 -0500)] 
Fix gcc -Wall nits

This fixes the last set of gcc -Wall complaints.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agofilefrag: improvements to filefrag FIEMAP handling
Andreas Dilger [Thu, 22 Nov 2012 15:06:12 +0000 (15:06 +0000)] 
filefrag: improvements to filefrag FIEMAP handling

Update the filefrag program to allow displaying the extents in
some different formats.  Try and stay within 80 columns.
* add -k option to print extents in kB-sized units (like df -k)
* add -b {blocksize} to print extents in blocksize units
* add -e option to print extent format, even when FIBMAP is used
* add -X option to print extents in hexadecimal format

Internally, the FIBMAP handling code has been moved into its own
function like FIEMAP, so that the code is more modular.  Extent
offsets are now handled in bytes instead of in blocks, to allow
printing extents with arbitrary block sizes.  The extent header
printing also moved into its own function so that it can be shared
between the FIEMAP and FIBMAP handling routines, since it got more
complex with the different output options.

Only print error about FIBMAP being root-only a single time.
Print the filesystem type if it changes between specified files.
Add fsync() for FIBMAP if "-s" is given.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agolibquota: quiet log_err() bad format warnings
Andreas Dilger [Thu, 29 Nov 2012 12:47:54 +0000 (05:47 -0700)] 
libquota: quiet log_err() bad format warnings

The macro for log_err() was written so that it needed to always
have an argument, but GCC was unhappy to have an argument when
none was specified in the format string.  Use the CPP "##" to
eat the preceeding comma if no argument is specified.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>