Commit Graph

1036 Commits (b2f5ce5516a0b6d261876884139043c8e6579f0a)

Author SHA1 Message Date
Theodore Ts'o 5aa6c3f61c Add configure options --enable-symlink-build and --enable-symlink-install
These options allow e2fsprogs to be built using symlinks instead of
hard links, and to be installed using symlinks instead of hard links,
respectively.

Addresses-Sourceforge-Bug: #1436294

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-17 19:21:42 -04:00
Eric Sandeen 1bb14a22b5 mke2fs: be explicit if external journal device is not found
This for RH bug #572935 -
RFE: Misleading error message from mke2fs -J option

If the journal device UUID is typo'd or otherwise not found,
the error message looks like it's a usage() type of problem.

It'd be helpful to explicitly say that the device requested
could not be found.

Addresses-Red-Hat-Bug: #572935

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-05-12 12:54:12 -04:00
Theodore Ts'o d531450cdd mke2fs: Allow a flex_bg size of 1
It's unusual, and rarely needed, but it's legal value.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-10 21:49:58 -04:00
Theodore Ts'o c5b23f6c0e Merge branch 'maint' into next 2010-03-15 18:53:45 -04:00
Eric Sandeen ecced2c358 mke2fs: Don't ask to proceed in case of a badly aligned partition
Just print the warning message in this case.

Addresses-Red-Hat-Bug: #569021
Addresses-Launchpad-Bug: #530071

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15 00:14:00 -04:00
Theodore Ts'o cc84d866e2 Merge branch 'maint' into next
Conflicts:
	e2fsck/pass1.c
2010-02-10 18:20:58 -05:00
Eric Sandeen 13b0b1231e mke2fs: fix up topo complaints on regular files
mkfsing a plain file would lead to a warning about being unable
to determine geometry; we should just skip the topology-getting
if we see that we have a regular file.

This was breaking "make check" but I had missed it since I
inadvertently stopped running the checks during the Fedora
RPM build.

Also, add a newline to the warning.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-02-05 22:50:21 -05:00
Theodore Ts'o 3067d96a2d mke2fs: Fix printf type warning
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-01-31 18:51:31 -05:00
Theodore Ts'o 2d07b3ad98 Merge branch 'maint' into next
Conflicts:
	configure
	lib/ext2fs/alloc_tables.c
	misc/mke2fs.c
2010-01-31 18:49:08 -05:00
Theodore Ts'o ca92d98f0a filefrag: Fix a core dump on sparc32 platforms with 8k file systems
On 32-bit platforms where the file system block size is 8k or greater,
the calculation bpib*bpib*bpib* will overflow a 32-bit calculation,
leading to a divide by zero error.  Fix this.

Thanks to Mikulas Patocka for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 01:03:04 -05:00
Eric Sandeen f3befe3e6b mke2fs: open device writable for trim/discard
Sorry about that, the discard ioctl doesn't actually work
unless you open the file with write capabilities...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-25 07:05:37 -05:00
Eric Sandeen c7cd908be5 mke2fs support for BLKDISCARD
Try calling the BLKDISCARD ioctl at mkfs time to pre-discard all blocks
on an ssd, or a thinly-provisioned storage device.

No real error checking; if it fails, it fails, and that's ok - it's
just an optimization.  Also, it cannot work in conjunction with
the undo io manager, for obvious reasons.

Optionally disabled with a "-K" (mnemonic: Keep) option.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-16 21:53:39 -05:00
Matthias Andree d0a4e54e6a Disconnect e4defrag from build on non-Linux hosts.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-16 00:31:06 -05:00
Theodore Ts'o 4486af5b4c Merge branch 'maint' into next
Conflicts:
	misc/mke2fs.c
2009-11-16 00:30:57 -05:00
Eric Sandeen 5827d2412d mke2fs support for BLKDISCARD
Try calling the BLKDISCARD ioctl at mkfs time to pre-discard all blocks
on an ssd, or a thinly-provisioned storage device.

No real error checking; if it fails, it fails, and that's ok - it's
just an optimization.  Also, it cannot work in conjunction with
the undo io manager, for obvious reasons.

Optionally disabled with a "-K" (mnemonic: Keep) option.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-15 23:54:03 -05:00
Theodore Ts'o b49f78fe6e Convert ext2fs_group_{first,last}_block() to *block2()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-25 21:24:06 -04:00
Theodore Ts'o 6493f8e85d Convert ext2fs_group_of_blk() to ext2fs_group_of_blk2()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-25 20:50:15 -04:00
Valerie Aurora Henson d7cca6b06f 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>
2009-10-25 21:43:47 -04:00
Eric Sandeen e633b58ac7 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>
2009-10-25 21:41:32 -04:00
Theodore Ts'o 72a729dbf9 Merge branch 'maint' into next
Conflicts:
	configure
	configure.in
2009-10-24 15:14:54 -04:00
Theodore Ts'o c5fbf38855 tune2fs.8: Clarify tune2fs's -i option
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-24 14:25:39 -04:00
Theodore Ts'o 77f464fb19 dumpe2fs: Fix usage message for -o superblock=<num> and -o blocksize=<num>
Addresses-Launchpad-Bug: #448099

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-24 14:15:55 -04:00
Theodore Ts'o 95bcea9fc1 Merge branch 'maint' into next
Conflicts:
	configure
	configure.in
	misc/mke2fs.c
2009-10-04 20:40:46 -04:00
Eric Sandeen 9ed8e5fec2 mke2fs: get device topology values from blkid
Handle automatic selection of stride/stripe:

mke2fs 1.41.9 (22-Aug-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=16 blocks, Stripe width=32 blocks
...

And warn on block device misalignment:

mke2fs 1.41.9 (22-Aug-2009)
/dev/sdc1 alignment is offset by 32256 bytes.
This may result in very poor performance, (re)-partitioning suggested.
Proceed anyway? (y,n)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-10-04 15:09:18 -04:00
Theodore Ts'o e1f0850795 Don't use in-tree header files if using system uuid or blkid libraries
This commit forces the use of the system-provided blkid or uuid header
files if we are using the system-provided blkid or uuid libraries.
This avoids using the in-tree header files with the system libraries.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-04 14:45:08 -04:00
Cristian Rodríguez 484ddc8767 fix fd leak that causes fsck to fail with "too many open files"
fsck leaks fds when invoked with -R -A -M -a -t noopts=nofail

Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-10-03 13:38:47 -04:00
Theodore Ts'o 1d4a493fa2 e2undo: Initialize com_err error tables for the ext2fs library
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-08 21:29:21 -04:00
Valerie Aurora Henson 4efbac6fed 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>
2009-09-07 20:46:34 -04:00
Valerie Aurora Henson a63745e81c 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>
2009-09-07 22:29:45 -04:00
Theodore Ts'o 7a9f055f0e mke2fs.8.in: Clarify flex_bg feature description
Add a more explicit description of how specifying the flex_bg file
system feature changes the layout of the per-block group metadata.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07 16:21:32 -04:00
Theodore Ts'o 73ebdf9972 tune2fs.8: Document the flex_bg file system option in the man page
Addresses-Sourceforge-Bug: #2822186

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07 16:21:32 -04:00
Theodore Ts'o 1d9b818317 dumpe2fs: Print more information about the inline journal
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-06 18:55:09 -04:00
Valerie Aurora Henson 95fd65bb7f libext2fs: create generic numeric progress meters and use them
With 64-bit file systems, mke2fs can take a long time to do things
other than write inode tables.  I exported the mke2fs numeric progress
meter and used it for allocating group tables and the final file
system flush.

Signed-off-by: Valerie Aurora (Henson) <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-23 19:20:03 -04:00
Theodore Ts'o 732c8cd58f 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>
2009-09-07 21:15:12 -04:00
Valerie Aurora Henson 24a117abd0 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>
2009-09-07 21:14:24 -04:00
Theodore Ts'o dc615a21c3 Merge branch 'maint' into next 2009-09-07 17:02:35 -04:00
Kyle McMartin a9e55a1191 e4defrag: fix ppc build
ppc glibc seems to be missing sync_file_range, so we fell back
to the local define, and there ppc differs as well, so the
build was failing.

Thanks to Kyle for the patch w/ the tidy solution.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-09-07 17:00:33 -04:00
Theodore Ts'o c1b875979f e4defrag: Link with ext2fs library
Since e4defrag uses ext2fs_swab32, it needs to link against the ext2fs
library.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-23 22:34:28 -04:00
Theodore Ts'o 31b5a2b961 mke2fs.conf: Use the feature name "extent" instead of "extents"
The feature name "extent" is documented in mke2fs.conf, although both
"extent" and "extents" are accepted by e2fsprogs.

Addreses-Debian-Bug: #540111

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-23 15:06:48 -04:00
Theodore Ts'o ffd8078297 e2freefrag: Update manpage to include e2fsprogs version and release date
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22 23:41:49 -04:00
Valerie Aurora Henson 3c041a514c Convert tune2fs, dumpe2fs, and e2image to the new bitmap interface
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22 21:15:30 -04:00
Aneesh Kumar K.V 154a5d7537 tune2fs: handle bad blocks when resizing inodes
When increasing inode size if we find that the new block
that we needed to increase the inode table size is a bad
block we fail. This make sure we don't end up with a corrupt
file system when doing inode resize on a file system having
bad blocks.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-20 13:13:20 -04:00
Aneesh Kumar K.V 91fac97938 tune2fs: Handle fs meta-data blocks during inode resize
With file system formated for RAID arrays we can have inode bitmap
and block bitmap after inode table. Make sure we move them around
properly when doing inode resize.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-20 13:12:49 -04:00
Aneesh Kumar K.V a9e5177be9 tune2fs: Make e2fsprogs handle ENOSPC better with inode resize
This removes the metadata block bitmap and makes the error handling
simpler. It also check for the enospc with the correct number needed
blocks. Also added specific error messages. We need to run e2undo
only if we start modiyfing inode, group desc and inode table.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-20 13:12:49 -04:00
Eric Sandeen 334cfccbca filefrag: don't print extent header on bmap fallback
The extent list header gets printed before we fall back to bmap:

# filefrag -v /mnt/test/bar
Filesystem type is: 58465342
File size of /mnt/test/bar is 12288 (3 blocks, blocksize 4096)
 ext logical physical expected length flags <---- HERE
Discontinuity: Block 2 is at 17 (was 16)
/mnt/test/bar: 2 extents found

so delay printing it until we know fiemap is working.

(though ideally it'd be nice to have the same verbose output
regardless of the interface we used, I think).

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-15 23:52:27 -04:00
Eric Sandeen 1f3d16deaa filefrag: fix frag count in bmap case
The fragmentation count in the bmap case seems to be
off by one:

/mnt/test/bar: 0 extents found

Addresses-Debian-Bug: #540376

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-15 23:52:00 -04:00
Theodore Ts'o 5d5e01d7e0 filefrag: Add option to force use of the FIBMAP ioctl
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-15 23:15:44 -04:00
Theodore Ts'o 0d990d0af7 Add V=1 support when linking e2freefrag in misc/Makefile.in
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 23:22:32 -04:00
Theodore Ts'o 1e48a456b6 e2freefrag: Take into account the last free extent in the file system
Fix a bug in e2freefrag where if the last free extent is at the very
end of the filesystem, it would be disregarded.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 23:22:24 -04:00
Theodore Ts'o 3e343b8d9a e2freefrag: Fix to work correctly for file systems with 1kb block sizes
If the file system has a non-zero s_first_data_block, as is the case
when the block size is 1kb, e2freefrag would incorrectly try to
reference invalid data blocks in the block allocation bitmap.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 23:21:23 -04:00
Theodore Ts'o cba91c4b52 e2freefrag: Do not print chunk-related information by default
Only print information related to chunk sizes if a chunksize is
printed.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 23:21:23 -04:00
Theodore Ts'o aff2cf8ed2 e2freefrag: Clarify e2freefrag's messages
"Free chunks" is confusing since it has nothing to do with the
chunksize; use "free extents" instead.

Also add a missing newline in an error message.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 23:21:17 -04:00
Theodore Ts'o 137a7dc05c e2freefrag: Initialize the ext2 error table
... so error messages are printed correctly

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 19:15:45 -04:00
Valerie Aurora Henson 463e732777 Convert mke2fs to new bitmap interface
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-05 00:17:56 -04:00
Theodore Ts'o 1d72214658 Merge branch 'maint' into next 2009-08-22 13:18:29 -04:00
Theodore Ts'o 88fca201ac Move declaration of FS_IOC_FIEMAP ioctl to fiemap.h
This helps e4defrag compile on systems where the system header files
don't yet define FS_IOC_FIEMAP.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22 13:16:14 -04:00
Theodore Ts'o baa8dbeb4e Merge branch 'maint' into next
Conflicts:
	misc/Makefile.in
2009-08-01 20:43:00 -04:00
Eric Sandeen 4f1d0e8608 e4defrag: remove a lot of cruft
e4defrag.c had a lot of stuff copied into it from other
places, redefinitions of existing interfaces, etc.

We should be able to remove most of this, as the tool only
works on recent kernels anyway, we should just pick up
definitions from recent kernel headers whenever possible.

I've left the local definitions of fallocate, fadvise
(changed to posix_fadvise) and sync_file_range, and
wrapped them in #ifdef configure-time tests - though
really it seems like only fallocate should be necessary
by now, and perhaps the others can be dropped.

We still need some Makefile work so that it won't try to
build e4defrag if the right pieces aren't there (and
if the local definitions won't work...)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-27 10:53:46 -04:00
Andreas Dilger ad751f11ec e2freefrag: Improve output to include be more like xfs_db's freesp -s
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-24 18:33:46 -04:00
Theodore Ts'o 0b2681f45b e2freefrag: New program which displays how fragmented the free space is
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-22 03:40:58 -04:00
Theodore Ts'o d0c537748d mke2fs: Add strings.h include for strcasecmp() declaration
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-18 18:41:51 -04:00
Eric Sandeen bbbb81c1d9 filefrag: fix it so it works in the bmap fallback case.
It looks like some debugging crept in?

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-18 09:56:10 -04:00
Theodore Ts'o 3c77b8ec54 Fix miscellaneous gcc -Wall warnings in blkid and tune2fs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-11 23:56:49 -04:00
Theodore Ts'o 9d4bade4ac filefrag: Restore "perfect" number of extents calculation for ext2/ext3
The FIEMAP support added in e2fsprogs 1.41.6 broke the "perfection
would be XXX expects" calculation restore it.

Also fix some gcc -Wall warnings as well.  (Cleaning up gcc -Wall is
what caused me to notice this regression).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-11 23:44:56 -04:00
Peng Tao f97ea10fde filefrag: fix fm_start in filefrag_fiemap loop
When used with -v and the targeted file has more than 144
extents(double of the length of fm_extents array provided by buf),
filefrag_fiemap loops and calls fiemap ioctl() multiple times to
calculate the actual number of extents in a file. Each call to fiemap
ioctl() uses fm_start as the starting logical offset. The patch fixes
fm_start in each loop( except for the first one) and makes the extent
calculation correct for files with more that 144 extents.

To produce the problem, first run filefrag -v on a highly fragmented
file.  Then change the buf size in filefrag_fiemap to make it large
enough to have all the extent mapped in a single loop and run filefrag
-v after recompiling.  The former will produce a much smaller extent
count because of the false fm_start used in the loop. And the two will
produce different extent output since the 145th extent.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-02 00:24:15 -04:00
Peng Tao ca4d95a932 remove bogus "-e" option from filefrag manpage
filefrag doesn't support "-e" option, so clean it up in the manpage.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-02 00:16:52 -04:00
Theodore Ts'o c13351f6c5 Add support for configure --enable-verbose-makecmds
Some people don't want to see the concise "kernel-style" make output.
This configure option allows build engines that want to see the full
set of commands executed by the makefile to get what they want.  Most
people will find this more distracting than useful, unless they need
to debug the Makefiles.

(It is not necessary to rerun configure to enable this verbose make
output temprarily; if a developer wants to do a quick debug of a
directory's makefile, he or she can simply edit the definition of the
$(E) and $(Q) variables in the Makefile; instructions can be found in
the MCONFIG file which is included in at the beginning of every
Makefile.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-02 00:11:17 -04:00
Theodore Ts'o a6a1c0815c Fix Makefile dependencies for libcom_err
The e2fsprogs makefiles were using the same Makefile variable
LIBCOM_ERR for the link-line arguments as well as the dependencies.
Since LIBCOM_ERR can now include non-file arguments such as
"-lpthread", we need to use a separate DEPLIBCOM_ERR variable that
only has build file dependencies.

Do the same thing for STATIC_LIBCOM_ERR and PROFILED_LIBCOM_ERR.

Addresses-Sourceforge-Patches: #2813809

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-01 22:06:51 -04:00
Theodore Ts'o 6013bbf596 Do not build and install uuidgen from if the uuid library was disabled.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-30 21:34:08 -04:00
Theodore Ts'o caa6003b64 libuuid, uuidd: Avoid infinite loop while reading from the socket fd
If for some reason the uuidd daemon or the process calling uuidd
exited unexpectely, the read_all() function would end up looping
forever, either in uuidd or in libuuid.  Fix this terminating the loop
if no data can be read after five tries to read from the file
descriptor.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-29 20:03:20 -04:00
Theodore Ts'o 2842bb3188 uuidd: Avoid closing the server socket when calling create_daemon()
In the event that file descriptors 0-2 are closed when uuidd is
started, the server socket could be created as a file descriptor that
will get closed when create_daemon() tries detaching the uuidd daemon
from its controlling tty.   Avoid this case by using dup(2).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-29 19:32:50 -04:00
Theodore Ts'o 427f95f879 logsave: Don't send the ^A and ^B delimiters to the console
Some terminal programs may print wierd characters when they see the
\001 or \002 characters.  So filter them out if the -s option
(skip_mode) is enabled.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-29 15:09:29 -04:00
Theodore Ts'o c510d6f268 badblocks: Make sure the list of bad blocks found is flushed on interrupt
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-29 01:04:02 -04:00
Theodore Ts'o 4001b8a8ff badblocks.8: Alphabetize options in badblocks man page
... to make it easier to find a specific option in the man page.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-29 01:03:27 -04:00
Theodore Ts'o e3dee8c91f badblocks.8: Update description of the -s option in badblocks man page
Addresses-Debian-Bug: #523063

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-29 00:59:35 -04:00
Theodore Ts'o 83bfa27d32 badblocks: Print the currently tested block number when interrupted with ^C
This can be useful for the user who wishes to restart the badblocks
program after interrupting it.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-29 00:52:27 -04:00
Eric Sandeen 1b600bfa48 lsattr: exit with a non-zero status on errors
lsattr doesn't return an error if you point it at a file that
doesn't exist.

This is slightly trickier because it can take more than one
file as an arg, but ls seems to report an error if any occurred,
so this does the same, it'll report the last error that was
encountered.

Addresses-RedHat-Bugzilla: #489841
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-06-21 21:46:34 -04:00
Theodore Ts'o 8a48035095 Fix encoding for rec_len in directories for >= 64k blocksize file systems
Previously e2fsprogs interpreted 0 for a rec_len of 65536 (which could
occur if the directory block is completely empty in 64k blocksize
filesystems), while the kernel interpreted 65535 to mean 65536.  The
kernel will accept both to mean 65536, and encodes 65535 to be 65536.
This commit changes e2fsprogs to match.

We add the encoding agreed upon for 128k and 256k filesystems, but we
don't enable support for these larger block sizes, since they haven't
been fully tested.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-21 21:07:38 -04:00
Theodore Ts'o 1acde2b277 dumpe2fs, tune2fs: fix miscellaneous memory leaks
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-15 03:55:10 -04:00
Theodore Ts'o 3b5126de44 badblocks: Remove 4096 blocksize limit
There is no need to prohibit the use of block sizes larger than 4k in
the badblocks program.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-02 09:31:24 -04:00
Theodore Ts'o 1384cc64b5 Fix spelling mistake in the man page for chattr
Addresses-Debian-Bug: #531385

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-02 09:02:39 -04:00
Theodore Ts'o e78968f7a4 filefrag: Fix error checking for the fiemap ioctl
Thanks to Peng Tao for reporting this problem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-02 08:45:22 -04:00
Theodore Ts'o 5635e75c91 Merge branch 'maint' into next 2009-07-21 17:07:33 -04:00
Theodore Ts'o 6a0ee32dcb Merge branch 'maint' into next 2009-07-12 01:14:39 -04:00
Kazuya Mio ae50746004 e4defrag: Fix compile warnings
When compile e2fsprogs git tree with gcc-wall option, we get some warnings about
e4defrag. This patch fixes them.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-11 14:52:21 -04:00
Theodore Ts'o 1d21f4bd8d e4defrag: Fix a core dump when trying to defrag a file with no blocks
Signed-off-by Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-09 15:03:39 -04:00
Theodore Ts'o 4836459a3f Add e4defrag to the misc directory
To make it easier to maintain changes and fixes to the e4defrag
program, check it into the e2fsprogs source tree.

Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: Takashi Sato <t-sato@yk.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-09 14:56:43 -04:00
Theodore Ts'o 4f858546e1 Update man pages to include ext4 in the synposis, instead of just "ext2/ext3"
The e2fsprogs programs have historically just said that they operate
on ext2 and ext3 file system in their man pages.  Update them to say
that they also operate on ext4 file systems.

Addresses-Launchpad-bug: #381854

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-05-30 12:34:28 -04:00
Theodore Ts'o 93aa024699 mke2fs.8: Fix man page to use hyphens instead of minus signs for options
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-05-30 00:15:22 -04:00
Eric Sandeen 312c2a404c chattr: manpage tidyups
Tidy up the chattr(1) manpage to completely document all
available options, and differentiate those which are read-only
early in the manpage as well.

* Remove "I" from settable attribute list
* add "e" to 2nd list of settable attributes & descriptions
* Note that h/E/I/X/Z are readonly
* Correct "H" to "h" for huge file attribute description
* fix long_name for indexed directory in flags_array

Addresses-Red-Hat-Bugzilla: BZ#502971

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-05-28 08:33:09 -04:00
Aneesh Kumar K.V 7c8da6e376 chattr: Add extent conversion support
This patch adds new option, +e to chattr. The +e option
is used to convert the ext3 format (non extent) file
to ext4 (extent) format. This can be used to migrate
the ext3 file system to ext4 file system.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-05-28 08:32:29 -04:00
Kalpak Shah e62847c5db filefrag: Add support to use the FIEMAP ioctl
The FIEMAP ioctl is more efficient and doesn't require root
privileges.  So if it is available, use it in preference to repeated
FIBMAP calls.

Signed-off-by: Kalpak Shah <kalpak.shah@sun.com>
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-05-02 21:02:29 -04:00
Theodore Ts'o de7a86e23c mke2fs.8: Clarify in the man page that fs defaults come from mke2fs.conf
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-22 22:46:48 -04:00
Theodore Ts'o 9266fc7a2f tune2fs: Fix format string warnings
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-22 15:13:37 -04:00
Theodore Ts'o 6e6b71d697 logsave: Fix warn_unused_result warnings from gcc
Fixed a potential bug where by partial returns from the write(2)
system call could some bytes to be lost when writing to the log file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-22 15:12:40 -04:00
Theodore Ts'o 14b596d409 configure.in: add --disable-libblkid option
Add an option to switch between the private (in-tree) libblkid and
public (in-system installed) library.  The private version is still
enabled by default.

If --disable-libblkid is specified the findfs(8) program, which is a
variant of tune2fs, is also not built or installed.

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-22 09:18:30 -04:00
Theodore Ts'o 27c3e539b6 Explain the significance of the 'T' attribute in the chattr.1 man page
Addresses-Debian-Bug: #365619

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-21 22:18:19 -04:00
Theodore Ts'o c927bec16f tune2fs: Clarify manpage regarding how to see the current settings
Addresses-Debian-Bug: #515693

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-18 11:39:22 -04:00
Theodore Ts'o f203bbdbec e2fsck, tune2fs: Fix Hurd compilation problem due to lack of PATH_MAX
Hurd doesn't define PATH_MAX, so calculate the exact size needed for
the tdb filename, and allocate it dynamically.

Addresses-Debian-Bug: #521602

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-18 10:53:32 -04:00
Theodore Ts'o 38e7385e74 uuidd: Fix warn_unused_result warnings from gcc
Fixed a potential bug caused by partial returns from the write system
call (especially possible for network connections).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-18 09:14:31 -04:00
Theodore Ts'o a620baddee mke2fs: Don't try to create the journal in super-only mode
Since we aren't initializing the inode table, creating the journal
will just fail.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-03-31 07:42:24 -04:00
Jim Meyering 45e338f533 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>
2009-03-08 20:37:12 -04:00
Eric Sandeen eb630fd870 e2fsprogs: blkid.static make target
Nice for testing w/o needing to swizzle around system
libraries...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-03-06 02:41:46 -05:00
Theodore Ts'o 8d8224550c mke2fs, tune2fs: Do not allow the reserved_ratio to be negative
Add a check to make sure the argument to the -m option (which
specifies the reserved ratio) is greater than zero.

Addresses-Debian-Bug: #517015

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-03-06 02:25:06 -05:00
Theodore Ts'o b7c5b40308 Add support for a new superblock field: s_kbytes_written
This field tracks the lifetime amount of writes to the filesystem.  It
will be updated by the kernel as well as by e2fsprogs programs which
write to the filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-03-06 01:59:23 -05:00
Theodore Ts'o 37d17a65ec mke2fs: If the device size is exactly 16TB treat it as if it had 16TB - 1 block
This allows users who create a 16TB LVM to have mke2fs do (mostly) the
right thing automatcally.
2009-01-20 14:03:03 -05:00
Theodore Ts'o b0afdda1bc mke2fs: Add -U option to specify the UUID for the new filesystem
Patch integrated from Mandriva

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 13:20:31 -05:00
Theodore Ts'o 1a71bd4200 mke2fs: Treat an argv[0] of "mke3fs" the same as "mkfs.ext3"
Mandriva apparently uses "mke3fs" as an alias for mkfs.ext3.  I'm not
particularly fond of that practice, but we'll include it as legacy
support.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 12:02:40 -05:00
Theodore Ts'o 31f1815fa9 tune2fs: Fix tune2fs -I so it won't corrupt RAID filesystems
If a filesystem is built with the stride extended-option (which is
often used in RAID filesystems to make sure the block and inode
allocation bitmaps don't end up hitting one disk platter harder than
the rest), this can cause tune2fs -I to corrupt the filesystem because
it fails to handle the case where the allocation bitmaps are located
after the inode table, where the inode table needs to grow.  Handle
this case correctly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 11:49:17 -05:00
Theodore Ts'o ec43da2f35 tune2fs: General (whitespace) cleanup
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 02:34:39 -05:00
Theodore Ts'o 5bf81baea0 tune2fs: Don't allow the -I option if the flex_bg feature is enabled
With flex_bg usually the inode table for most block groups are packed
right against each other, so expanding the inode table size needs
special handling that's not currently in tune2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 01:50:07 -05:00
Theodore Ts'o a11d0746b4 dumpe2fs: Only print inline journal information if the journal is internal
Currently dumpe2fs displays an error if run on a filesystem with an
external journal.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-15 15:05:51 -05:00
Theodore Ts'o ad64399d15 Add support to build profiled binaries in the misc directory
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-15 12:34:28 -05:00
Theodore Ts'o 27c6de45a4 tune2fs: Fix inefficient O(n**2) algorithms when expanding the inode size
When running "tune2fs -I 256" on moderate to large filesystems, the
time required to run tune2fs can take many hours (20+ before some
users gave up in disgust).  This was due to some O(n**2) and O(n*m)
algorithms in move_block() and inode_scan_and_fix(), respectively.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-15 00:32:39 -05:00
Theodore Ts'o 9d4a4dc287 tune2fs: Update the block group checksums when changing the UUID
Since the block group checksums depend on the UUID, we need to update
the block group checksums when setting the UUID.  We only do so if all
of the checksums are correct, however.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-14 17:42:27 -05:00
Theodore Ts'o 08c8b1ab34 mke2fs.8: Add an explanation of how the -t and -O options interact
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-02 08:47:48 -04:00
Theodore Ts'o 42e572b5b6 badblocks: Fix progress output for "badblocks -sw /dev/XXX"
Always initialize the starting time so that badblocks -sw works.
Thanks Jelle de Jong (jelledejong at powercraft.nl) for reporting this
bug.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-01 20:00:54 -04:00
Theodore Ts'o 711d3846a0 Fix various spelling mistakes in various man pages
Thanks to A. Costa for pointing these out.

Addresses-Debian-Bug: #498100
Addresses-Debian-Bug: #498101
Addresses-Debian-Bug: #498102
Addresses-Debian-Bug: #498103

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-07 14:08:40 -04:00
Manish Katiyar 504f7a2981 badblocks: Display time and percentage complete in verbose mode.
Addresses-Debian-Bug: #429739.

Signed-off-by: "Manish Katiyar" <mkatiyar@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-05 07:51:33 -04:00
Theodore Ts'o 29551cacca Fix e2initrd_helper, blkid, and fsck from linking with unneeded libraries
... especially when using ELF shared libraries.  We only need to link
with a library if the executable uses that library directly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-04 22:39:20 -04:00
Theodore Ts'o 55da987650 Improve ELF shared library handling
Pass in -rpath-link option to the linker so that blkid will build
correctly on systems that don't have libcom_err.so.2 installed.

Fix debugfs to only try to link with -ldl when building without shared
libraries; with ELF shared libraries, the library which requires -ldl
(libss.so) can required the library dependency itself.

Fix how we build tune2fs.static so that we use @LDFLAG_STATIC@, via
$(LDFLAGS_STATIC), instead of hard-coding the use of -static.

Addresses-Sourceforge-Bug: #2088537

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-02 23:12:38 -04:00
Theodore Ts'o 3b4a66cfb6 Fix bold font specifer in mke2fs.8 man page
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-02 21:23:35 -04:00
Theodore Ts'o 22301afb01 badblocks: Open the device with O_LARGEFILE
Linux doesn't enforce the Large File Support API requirements on block
devices, but in case someone wants to run badblocks on a normal file,
open the device file with O_LARGEFILE.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-02 08:29:20 -04:00
Theodore Ts'o a8fbdc0950 filefrag: Fix calculation of ideal number of extents
Fix calculation of the ideal number of extents needed for a file to
take into account sparse files.

In addition, suppress the "this file is extent-based" message unless
verbose mode is enabled.

Addresses-Debian-Bug: #458306

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-01 15:58:37 -04:00
Theodore Ts'o f38cf3cb34 Only use the test_io manager if the right environment variables are set
In order to make it possible for the test_io manager to be compiled in
by default, make all of the programs that might try to use it to only
do so if the environment variables TEST_IO_FLAGS and TEST_IO_DEBUG are
set.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-01 11:36:53 -04:00
Theodore Ts'o d5f57d9553 mke2fs: Allow the default hash algorithm in mke2fs.conf
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-29 21:39:36 -04:00
Theodore Ts'o 10ff68d42d tune2fs: Add support for setting the default hash algorithm for htree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-29 21:21:19 -04:00
Theodore Ts'o d1070d91b4 tune2fs, mke2fs: Change default directory hash algorithm to half_md4
The half_md4 algorithm is faster and more collision resistant.  Let's
switch to it as the default.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-29 20:02:50 -04:00
Theodore Ts'o efc6f628e1 Remove trailing whitespace for the entire source tree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27 23:07:54 -04:00
Theodore Ts'o 5dd77dbe5a Add support for with empty directory blocks in 64k blocksize filesystems
The rec_len field in the directory entry is 16 bits, so if the
filesystem is completely empty, rec_len of 0 is used to designate
65536, for the case where the directory entry takes the entire 64k
block.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-25 21:08:19 -04:00
Andreas Dilger a5e14ead2e Document the extent and huge file flags in the chattr.1.in man page
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-24 20:24:23 -04:00
Theodore Ts'o a26ba650a8 Fix mke2fs man page to escape all minus signs
Option specifiers must be escaped so the are printed as minus signs
(U+002D) instead of hyphens (U+2010).  Hence "mke2fs -t ext4" must be
expressed as "mke2fs \-t ext4" instead.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-24 17:29:33 -04:00
Theodore Ts'o bad89b2af3 mke2fs: Issue a warning if the mke2fs.conf file wasn't updated
Many people are forgetting to update their mke2fs.conf file, and this
means that filesystems aren't getting created with the proper features
enabled.  So detect this case and issue a warning.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-23 09:08:15 -04:00
Benno Schulenberg 954bee3414 blkid: On the man page, show option arguments in the descriptions.
Also rephrase two sentences and add a comma or two.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-08-14 13:29:50 -04:00
Benno Schulenberg 98794d0e0a mke2fs: Fix several typos in the man page.
Also add the missing argument of the -M option, replace the mistaken
[libdefaults] section header with [defaults], and slightly rephrase
two or three sentences.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-08-14 13:25:23 -04:00
Theodore Ts'o d887f88d22 tune2fs: Improve the error messages for tune2fs -I
If the current inode size is less than or equal to the requested inode
size, either explain that shrinking the inode size is not supported,
or that the inode is already the requested size.  Also, open the
filesystem provisionally first to do the inode size check and don't
setup up the undo log until we know that we're actually going to
perform the inode resizing operation.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-27 16:00:48 -04:00
Theodore Ts'o 7087bbecce mke2fs/tune2fs: Fix max journal size in message to be consistent/correct
Addresses-Debian-Bug: #491620

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-25 12:41:32 -04:00
Theodore Ts'o fe365fd8ef partinfo: Fix usage message
Thanks to Göran Uddeborg for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-23 16:50:40 -04:00
Benno Schulenberg 7a0516a385 tune2fs: Delete a stray word from a comment.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-07-18 21:15:33 -04:00
Benno Schulenberg cca95a827f partinfo: Print clearer error messages.
Also use complete sentences, instead of separate words filled
into a phrase.  And gettextize the main output message.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-07-18 21:14:54 -04:00
Benno Schulenberg ad39bcd9e3 badblocks: Insert a missing "\n" in the usage string.
Take the opportunity to wrap the string to be more readable,
and sort the options somewhat alphabetically.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-07-18 21:14:21 -04:00
Benno Schulenberg 577b5c436f e2undo, tune2fs: Report the correct name for the undo program.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-07-18 21:13:20 -04:00
Theodore Ts'o 92fb8545b1 mke2fs: Fix enforcement of no features for revision 0 filesystems
Fix typo; instead of checking for s_feature_incompat twice, add check
for s_feature_ro_compat.

Thanks to Benno Schulenberg for noticing this problem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-18 21:08:56 -04:00
Theodore Ts'o df9c01b144 Fix missing space typo's in partinfo and resize2fs
These were caused by multi-line strings missing a space at the line
break.  Thanks to translator Phillipp Thomas for noticing these typo's.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-17 10:50:26 -04:00
Theodore Ts'o 03ce7afaba Add more intelligent handling of the mke2fs.conf installation process
For people who are compiling mke2fs for their own use outside of a
package manager, we need to make sure the system /etc/mke2fs.conf is
sufficiently up-to-date that it won't cause problems, but at the same
time we don't want to blow away any user-specific customizations.

So if /etc/mk2fs.conf exists, but does not mention ext4dev, we will
move it aside to /etc/mke2fs.conf.e2fsprogs-old and then install the
new mke2fs.conf.  If the /etc/mke2fs.conf file exists but does mention
ext4dev, we install the new mke2fs.conf file as
/etc/mke2fs.conf.e2fsprogs-new.  In both cases we print a warning
mesage to the user so they can manually update /etc/mke2fs.conf with
any changes if they so desire.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-16 15:07:56 -04:00
Theodore Ts'o 363289510c Add an tune2fs.static target in misc/Makefile.in
This is added as a convenience for distro's that need a static tune2fs
for whatever reason.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-15 00:03:16 -04:00
Theodore Ts'o 36f4c40802 blkid: Fix portability issue if TIOCGSIZE and TIOCGWINSZ are present
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-14 17:49:38 -04:00
Theodore Ts'o c13ab4fa7a badblocks: If nanosleep() does not exist, try using usleep() instead
For portability on systems that don't have nanosleep().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-13 16:38:56 -04:00
Theodore Ts'o 38dd11f595 e2undo: Don't use __FUNCTION__ for portability reasons
Solaris C99 apparently doesn't support it.  We should report the
program name, not the internal function name, when printing an error
in any case.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-13 16:06:57 -04:00
Theodore Ts'o ebabf2ad6d Define _XOPEN_SOURCE to 600 consistently for Solaris C99 support
Solaris's header files are very picky about which C compiler can be
used for SUSv3 conformance.  Use of C99 is not compatible with SUSv2
(_XOPEN_SOURCE=500), and C89 is not compatible with SUSv3
(_XOPEN_SOURCE=600).  Since we need some SUSv3 functions, consistently
use SUSv3 so that e2fsprogs will build on Solaris using c99.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-13 16:06:57 -04:00
Theodore Ts'o 3d05802f92 blkid: Add new option -L which pretty-prints the device list
Also accessed via -o list, this new output format is much more
user-friendly and lists whether or not a particular device is mounted.

Addresses-Debian-Bug #490527

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-13 16:06:47 -04:00
Theodore Ts'o 2be8fe4397 mke2fs,tune2fs: Enable huge_file, dir_nlink, and extra_isize features
Also change mke2fs.conf to enable huge_file,dir_nlink,extra_isize, and
uninit_bg by default for ext4 filesystems, and enable extra_isize in
the library as well.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-10 12:06:31 -04:00
Theodore Ts'o f56f32b0a5 badblocks: Use standard terminology for first/last block
Use consistent and standard terminology for the starting and ending
blocks for the badblocks test in the man page and in the messages
printed by the program.

Addresses-Debian-Bug: #440983, #440981

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-10 10:11:23 -04:00
Theodore Ts'o 2ac7f06611 Fix incorrect definition of stripe-width in mke2fs man page
Also clarified the definition of the stride-size extended option as
well.

Addresses-Debian-Bug: #487849

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-10 09:40:48 -04:00
Theodore Ts'o 7f5601e5b5 mke2fs: Dumb down filesystems for GNU Hurd
The Hurd only supports filesystems with a blocksize of 4096 bytes, and
128 byte inodes.  It also doesn't understand the journal.  So force
the defaults to be something which the Hurd can handle if "-o hurd" is
specified on the command line.

Addresses-Debian-Bug: #471977

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-10 09:31:34 -04:00
Theodore Ts'o f8df04bcc6 mke2fs: Print a better error msg when ext2fs_get_device_size() returns EFBIG
Print a message when mke2fs uses a default blocksize from an external
journal device, and print a more self-explanatory message so that if
that blocksize is used and ext2fs_get_device_size() returns EFBIG, the
user has a better chance of understanding why mke2fs issued that error
message.

Addresses-Debian-Bug: #488663

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-06 20:57:17 -04:00
Theodore Ts'o b4d5105b25 mke2fs: Use a fs_type of 'journal' when creating an external journal
If creating a an external journal via "mke2fs -O journal_dev",
override the fs_type list (i.e., "ext2", "small"), and replace it with
an fs_type list of "journal".  This will prevent external journals
smaller than 512MB from being created with a block size of 1k, which
is not very useful and leads to much confusion.

Addresses-Debian-Bug: #488663

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-06 20:24:29 -04:00
Theodore Ts'o 69d813520c badblocks: Fix crash when lots of -t patterns given
With more than 8 -t patterns given, badblocks will overwrite the
t_patts array boundary due to realloc not taking into account the size
of an int.  Oops.

Addresses-Debian-Bug: 487298

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-06 18:56:31 -04:00
Eric Sandeen 79e62409b3 Clean up some trivial build warnings
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-06 18:36:56 -04:00
Eric Sandeen 772b89d342 blkid: use list_for_each_safe in garbage collection
We need to use list_for_each_safe in case a device gets removed from
the list during garbage collection.

Also make the manpage slightly more informative about
what the -g garbage collection option does.

Addresses-Debian-Bug: #487758, #487783

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-28 22:17:20 -04:00
Iustin Pop edf261f6f8 badblocks: fix a bug in the read throttling
The previous patch was missing an #include and thus the compiler didn't
catch the (now obvious) error.

Signed-off-by: Iustin Pop <iustin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-21 14:43:25 -04:00
Theodore Ts'o 71ff129e9f Merge branch 'maint'
Conflicts:

	README
	resize/online.c
	version.h
2008-06-17 23:54:51 -04:00
Theodore Ts'o 9ff8ece57d 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>
2008-06-17 21:08:49 -04:00
Iustin Pop 264f64a5a8 badblocks: implement read throttling
Currently, badblocks will read as fast as it can from the drive. While
this is what one wants usually, if badblocks is run in read-only mode on
a drive that is in use, it will greatly degrade the other users of this
disk.

This patch adds a throttling mode for reads where each read will be
delayed by a percentage of the time the previous read took; i.e., an
invocation of '-d 100' will cause the sleep to be the same as the read
took, a value of 200 will cause the sleep to be twice as high, and a
value of 50 will cause it to be half.  This will not be done if the
previous read had errors, since then the hardware will possibly have
timeouts and that would decrease the speed too much.

This algorithm helps when the disk is used by other processes as then,
due to the increased load, the time spent doing the reads will be
higher, and correspondingly badblocks will sleep even more and thus it
will use less of the drive's bandwidth. This is different from using
ionice, as it is a voluntary (and partial) throttling.

Signed-off-by: Iustin Pop <iustin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-17 07:47:25 -04:00
Iustin Pop eb594251b6 badblocks: fix a possible bug in parse_uint
Currently, the parse_uint() function checks errno after the strtoul()
call. But, according to the man page of strtoul():
  Since strtoul() can legitimately return 0 or LONG_MAX (LLONG_MAX for
  strtoull()) on  both  success  and failure,  the  calling program
  should  set errno to 0 before the call, and then determine if an error
  occurred by checking whether errno has a nonzero value after the call.

When using locales, it can happen that looking for the locale files is
not successful, and therefore errno will have a nonzero value from this.
And since the argument parsing is one of the first things done after
startup, parse_uint() will wrongly report errors.

The fix is to simply reset errno to zero before calling strtoul().

Signed-off-by: Iustin Pop <iustin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-17 07:33:44 -04:00
Iustin Pop 931b0289ee badblocks: add a max bad blocks count option
Currently, badblocks will continue scanning the device until it reaches
last_block, even though it might be that the drive is not responding
at all anymore.

This patch introduces a new parameter ('-e') that allows one to specify
the maximum bad block count; if badblocks sees more than this number, it
will abort the test.

While this is not useful for testing a device that will need to be used
as a filesystem (because we don't get an exhaustive list of bad blocks),
it is useful for testing if a device has bad blocks at all: for example,
with a count of 1, it will finish after the first error thus not needing
to test the whole device if the only purpose of the test is to check for
any bad blocks.

Signed-off-by: Iustin Pop <iustin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-17 07:33:29 -04:00
Theodore Ts'o 11d4f30fe1 e2undo: Enable missing pieces to enable I18N for this application
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 22:16:48 -04:00
Theodore Ts'o 365857912e Add "#include <limits.h>" to get PATH_MAX for mke2fs and tune2fs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 22:07:50 -04:00
Theodore Ts'o 97cf43f8aa Merge branch 'maint' 2008-06-07 22:07:25 -04:00
Theodore Ts'o 2a6b60488f fsck: Fix build problem on MacOS X
Addresses-Sourceforge-Bug: #1972473

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 21:32:07 -04:00
Theodore Ts'o 721b367abf Fix gcc -Wall warnings in tune2fs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 11:51:33 -04:00
Theodore Ts'o eda08d45bd Install {mkfs,fsck}.{ext4,ext4dev} binary and man pages
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-14 18:41:01 -04:00
Theodore Ts'o d46e171f3c Add ext4dev stanza to mke2fs.conf
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-14 18:41:01 -04:00
Theodore Ts'o 2d36358d66 mke2fs: Add the ability to configure default extended options in mke2fs.conf
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-14 18:41:01 -04:00
Theodore Ts'o faa08e4c92 Merge branch 'next' into tt/flex-bg 2008-04-27 22:24:36 -04:00
Aneesh Kumar K.V 64d588cfea tune2fs: Support for large inode migration.
Add new option -I <inode_size> to tune2fs.  This is used to change the
inode size. The size need to be multiple of 2 and we don't allow to
decrease the inode size.

As a part of increasing the inode size we increase the inode table
size. We also move the used data blocks around and update the
respective inodes to point to the new block

tune2fs uses the undo I/O manager when migrating to large inode. This
helps in reverting the changes if end results are not correct.  The
environment variable TUNE2FS_UNDO_DIR is used to indicate the
directory within which the tdb file need to be created. The file will
be named tune2fs-<device-name> If TUNE2FS_UNDO_DIR is not set
/var/lib/e2fsprogs is used

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27 20:06:14 -04:00
Aneesh Kumar K.V b626b39a8c mke2fs: Add support for the undo I/O manager.
When running mke2fs, if a file system is detected
on the device, we use Undo I/O manager as the io manager.
This helps in reverting the changes made to the filesystem
in case we wrongly selected the device.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27 19:57:52 -04:00
Aneesh Kumar K.V 5f8a5ae6b8 Add e2undo command
The e2undo command can be used to replay the transaction saved in the
transaction file using undo I/O Manager.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27 19:42:05 -04:00
Theodore Ts'o 43781b9459 mke2fs: Make argument to the extended option lazy_itable_init optional
Also remove some debugging printf's left over from a previous patch.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27 19:38:02 -04:00
Theodore Ts'o da292aa9af Merge branch 'maint'
Conflicts:

	tests/m_raid_opt/expect.1
2008-04-27 07:59:28 -04:00
Theodore Ts'o d94cc2eaa6 mke2fs: Don't allow the combination of the meta_bg and resize_inode features
The combination of meta_bg and resize_inode leads to a corrupt
filesystem, and it's not really clear it makes any logical sense.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27 00:08:14 -04:00
Theodore Ts'o 9ba400027f mke2fs: New bitmap and inode table allocation for FLEX_BG
Change the way we allocate bitmaps and inode tables if the FLEX_BG
feature is used at mke2fs time.  It places calculates a new offset for
bitmaps and inode table base on the number of groups that the user
wishes to pack together using the new "-G" option.  Creating a
filesystem with 64 block groups in a flex group can be done by:

mke2fs -j -I 256 -O flex_bg -G 32 /dev/sdX

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-04-22 23:32:16 -04:00
Theodore Ts'o 0f2794c020 mke2fs/libext2fs: Fix lazy inode table initialization
This fixes some bugs which I introduced recently while revamping the
uninit_bg code.  Since mke2fs is no longer calling
ext2fs_set_gdt_csum(), it's important that ext2fs_initialize()
correctly initialize bg_itable_unused for all block group descriptors.
In addition, mke2fs needs to zero out the the reserved inodes based on
the values of bg_itable_unused set by ext2fs_initialize().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-22 23:18:37 -04:00
Theodore Ts'o 5711ed297b Transfer responsibility of setting the *_UNINIT flags to libext2fs
Mke2fs used to have special case, ugly code in
setup_lazy_bg/setup_uninit_bg flag which set the flags based on all
sorts of special cases.  Change it so that it is done in libext2fs,
and fix mke2fs to use alloc_stats functions which will take care of
clearing the *_UNINIT flags automatically as needed.

This is preparatory work to make the flex_bg allocation patch much
cleaner.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-21 01:39:23 -04:00
Theodore Ts'o 16b851cdae Remove LAZY_BG feature
This simplifies the code, and using the uninit_bg with the inode table
lazily initialized is just as good.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-20 23:33:34 -04:00
Theodore Ts'o a4396e9d5d mke2fs: Disentangle lazy_bg from uninit_bg's lazy inode table initialization
Instead of using -O lazy_bg,uninit_bg as the way of requesting that
the inode table be lazy unitialized, use the parameter
lazy_itable_init, which can either be set via mke2fs's -E option, or
via /etc/mke2fs.conf.

Also fix some random problems in mke2fs's man page, including
documenting the extent feature, which had been missing.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-18 10:19:27 -04:00
Theodore Ts'o 2930dad2b2 Rename the feature uninit_groups to uninit_bg
Allow the old name of uninit_groups when converting feature names for
backwards compatibility for scripts running mke2fs and tune2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 23:31:44 -04:00
Theodore Ts'o 1ca1059fd0 Add support for the HUGE_FILE feature
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 16:38:13 -04:00
Theodore Ts'o 3d43836fda New mke2fs filesystem and usage types support
Provide mke2fs with a much more sophisticated system for controlling
configuration parameters of a newly created filesystem based on a
split filesystem and usage type system.  The -t option to mke2fs was a
deprecated alias to -c; it now specifies a filesystem type (ext2,
ext3, ext4, etc.), while the -T option can now be a comma separated
usage list.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-06 17:15:38 -04:00
Theodore Ts'o b89fc30dd7 dumpe2fs: Print the group checksum and the block options in a nicer way
Also add support for printing the ITABLE_ZERO flag

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-01 14:59:47 -04:00
Andreas Dilger f628acea26 ext2fs_set_gdt_csum(): Return an error code on errors instead of void
Change the function signature so that ext2fs_set_gdt_csum() returns an
error code.

If the inode bitmap hasn't been loaded return EXT2_ET_NO_INODE_BITMAP.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-31 14:28:37 -04:00
Andreas Dilger 4237c73bf5 Improve ext4 feature descriptions in mke2fs and tune2fs man pages
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-30 14:13:03 -04:00
Theodore Ts'o a70f10dbc4 Merge branch 'maint' 2008-03-30 14:03:51 -04:00
Andreas Dilger e28a1bca9e Use -E instead of the deprecated -R option in the mke2fs man page
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-30 14:03:00 -04:00
Theodore Ts'o 62653d99d8 logsave: Pass any SIGTERM or SIGINT signals to child process
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-27 21:00:56 -04:00
Theodore Ts'o bf209ab795 fsck: Treat "ext4" and "ext4dev" as ext* filesystems
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-26 08:58:25 -04:00
Theodore Ts'o a16834335d fsck: Make -Cn work correctly where n != 0
Previously, fsck was only passing in -Cn to the first e2fsck process
to start up, and enabling the progress information by sending a
SIGUSR1 signal.  This didn't work if the progress information was
intended to go to file descriptor, since the information was never
passed to e2fsck.

So we now pass the progress fd in as a negative number if the progress
information is intended to be initially suppressed.

Addresses-Launchpad-Bug: #203323
Addresses-Sourceforge-Bug: #1926023

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-26 08:53:13 -04:00
Theodore Ts'o ab7862049a fsck: Fix -C handling so that subsequent progress bars are enabled
The exiting fsck instance wasn't marked as DONE, so the safety checks
thought a progress bar was still in progress, and so we didn't enable
another filesystem's checking.

Addresses-Debian-Bug: #432865
Addresses-Launchpad-Bug: #203323
Addresses-Sourceforge-Bug: #1926023

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-26 08:11:11 -04:00
Theodore Ts'o 402b95d285 mke2fs: Clarify man page that -T is interpreted using the current timezone
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-21 09:25:23 -04:00
Theodore Ts'o a2ff0f31c1 debugfs, tune2fs: Handle daylight savings time when parsing a time string
We need to set tm_isdst to -1 so that mktime will automatically
determine whether or not daylight savings time (DST) is in effect.
Previously tm_isdst was set to 0, which caused mktime to interpret the
time as if it was always not using DST.

Addresses-Debian-Bug: #471882

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-21 09:10:09 -04:00
Jose R. Santos 777a8c1bf0 Make dumpe2fs 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>
2008-03-20 15:33:12 -04:00
Jose R. Santos 4e988cb4c1 Make tune2fs 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>
2008-03-20 15:33:12 -04:00
Jose R. Santos d2d22a29df Add support for creating filesystems using uninit block group
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>
2008-03-20 15:33:12 -04:00
Theodore Ts'o 2d328bb76d Fix miscellaneous gcc -Wall warnings
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-17 23:17:13 -04:00
Theodore Ts'o 6567e5a684 Merge branch 'maint' 2008-03-15 01:27:08 -04:00
Matthias Koenig 4415b03eaa uuidd: Fix issues identified by SuSE's security team
SuSE's security team audited uuidd and came up with these issues.
None of them are serious given that uuidd runs setuid as a
unprivileged user which has no special access other than libuuid
directory, but it's good to get them fixed.

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-14 14:38:42 -04:00
Theodore Ts'o a040a99b6c Merge branch 'maint'
Conflicts:

	lib/ext2fs/ext2_err.et.in
2008-03-13 10:53:26 -04:00
Theodore Ts'o 9fbec969a2 e2image: Use open64() so that "e2image -I" works on image files > 2GB
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-13 01:03:28 -04:00
Theodore Ts'o e67670c32c Fix mke2fs man page regarding 128-byte default inode size
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-08 19:48:56 -05:00
Theodore Ts'o 399033a6ab Merge branch 'maint' 2008-02-29 00:43:29 -05:00
Theodore Ts'o ff662d5dbf tune2fs: Remove support for clearing the SPARSE_SUPER feature
Clearing SPARSE_SUPER is dangerous; it can result in a filesystem
which e2fsck can't fix easily.  Since there is very few good reasons
for wanting to turn this feature off, disable tune2fs's abiity to do
this.  Users who really want this can use debugfs.

Also, deprecate the tune2fs -s option.  Remove it from the man page
and usage message.

Addresses-Sourceforge-Bug: #1840286

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-28 21:26:01 -05:00
Theodore Ts'o bdd80f28d7 Update mke2fs usage message
Add options supported by mke2fs to its usage message.

Addresses-Sourceforge-Bug: #1751393

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-28 21:12:31 -05:00
Andreas Mohr 0fd2f90067 Add manpage references to debugfs/tune2fs commands
Make debugfs and tune2fs reference each other in the "SEE ALSO"
section.

Addresses-Sourceforge-Patches: #1399325

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-28 20:57:08 -05:00
Theodore Ts'o a49670e64e Merge branch 'maint'
Conflicts:

	lib/blkid/devname.c
	lib/blkid/probe.c
	misc/mke2fs.c
	misc/tune2fs.c
2008-02-27 18:53:34 -05:00
Theodore Ts'o 558df54458 Add support for manipulating large_file feature in mke2fs and tune2fs
Previously we just let the kernel and e2fsck do this automatically,
but e2fsck will no longer automatically clear the large_file feature.
It still isn't really necessary to worry about this feature flag
explicitly, but some users seem to care.

Addresses-Red-Hat-Bugzilla: #258381

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-27 15:01:19 -05:00
Theodore Ts'o 1547265859 fsck: Don't complain about an old-style fstab if the fstab is empty
Addresses-Debian-Bug: 468176

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-27 14:19:18 -05:00
Theodore Ts'o db197a81cc Fix dumpe2fs parsing of explicit superblock/blocksize parameters
The dumpe2fs syntax documented in the man page has been broken for
some time due to getopt() changes.  Change the option syntax in
dumpe2fs to be one which is more extensible and consistent with the
format for extended options in mke2fs and tune2fs.

Addresses-Sourceforge-Bug: #1830994

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-26 19:05:33 -05:00
Theodore Ts'o c149e226a0 Eliminate really obsolete references to Linux 2.0/2.1/2.2 in tune2fs man page
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-26 17:38:48 -05:00
Theodore Ts'o 037914e28f tune2fs: Add support to clear the resize_inode feature
This requires an fsck aftwards.  We don't allow setting the
resize_inode feature because extensive work to tune2fs or e2fsck to
safely relocate blocks is necessary in order to reserve the blocks
needed by the resize inode.

Addresses-Red-Hat-Bugzilla: #167816

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-26 17:31:06 -05:00
Theodore Ts'o 885bf6b832 tune2fs: Cleanup feature handling to avoid merge conflicts
Use a more abstract set of feature tests to avoid merge conflicts as
we add support for new features in the maint, master, next, and pu git
branches.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-26 15:08:14 -05:00
Theodore Ts'o 7c4a2ef594 Teach tune2fs to use e2p_edit_feature2() to provide better error handling
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-26 15:05:47 -05:00
Theodore Ts'o f159ff32e3 mke2fs: Remove warning for inode_size > 128 bytes
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-22 15:40:37 -05:00
Theodore Ts'o 34658361cf mke2fs: Remove 2.4 kernel warning for blocksizes > 4096 bytes
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-22 15:03:49 -05:00
Theodore Ts'o 2ccf62fd8e mke2fs: Remove requirement for -f option for filesystems > 2**31 blocks
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-22 15:01:03 -05:00
Theodore Ts'o 107f291cdc Add ability to set (but not clear) the extents feature to tune2fs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-20 08:20:02 -05:00
Theodore Ts'o bf6b848e12 Allow mke2fs to create filesystems with the EXTENTS feature
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-20 08:13:19 -05:00
Theodore Ts'o 0157e7c635 Merge branch 'maint' into next 2008-02-18 23:01:43 -05:00
Theodore Ts'o 0c17cb25f2 Add support for setting RAID stride and strip-width via mke2fs and tune2fs
This is useful for mballoc to align block allocation on the RAID
stripe boundaries.

Signed-off-by: Rupesh Thakare <rupesh@clusterfs.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 22:56:25 -05:00
Theodore Ts'o 43323be957 Use BLOCK_FLAG_READ_ONLY flag in debugfs, e2image, and tune2fs
Pass BLOCK_FLAG_READ_ONLY to ext2fs_block_iterate2() so that debugfs,
e2image, and tune2fs will work well with filesystems containing
extents.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 20:05:55 -05:00
Theodore Ts'o bbf54adb03 Merge branch 'maint' into next 2008-02-17 17:36:45 -05:00
Theodore Ts'o fe263da923 Make fsck ignore mounted filesystems if given the -M option
Adapted from the SuSE patch, but fixes a number of very serious
problems with the patch in SLES:

1) This changeset uses -M instead of -m; most lowercase options are
reserved for use by the filesystem-specific fsck programs.  All new
fsck options must be upper case.

2)  This changeset will skip the root filesystem in "fsck -AM", which
the SLES patch will not do.

3)  Loading /proc/mounts into the fs_info can cause -t opts matching to
malfuction.  So this changeset uses a simplified version of the
ismounted.c function from the ext2fs library.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-17 17:35:46 -05:00
Theodore Ts'o cfa30fd554 uuidd: Fix pid file so it has the correct pid number
The pid file was getting created before the fork(), so it had the
incorrect pid number.  No one noticed for a while, since "uuidd -k"
will kill the daemon and it has enough automatic convenience functions
that it's usually not necessary to refer to the pid file except as a
convenient place for uuidd to lock against multiple instances of the
daemon starting up.

Addresses-Sourceforge-Bug: #1893244

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-17 17:33:48 -05:00
Theodore Ts'o ef80fdc8ad Merge branch 'maint' into next 2008-02-10 08:03:54 -05:00
Theodore Ts'o ab9f1a84b0 Don't try to create $DESTDIR/etc/init.d as part of make install
This isn't necessary since we don't install the init.d script (and
it's not the recommended way to start uuidd anyway).

Addresses-Sourceforge-Bug: #1885085

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-09 22:34:43 -05:00
Theodore Ts'o 0ddfd9a529 Allow tune2fs to set and clear the test_fs flag on ext4 filesystems
Also allow the label to be set/cleared on ext4 filesystems via e2label
and tune2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-09 22:22:38 -05:00
Theodore Ts'o 428f6b32a9 Merge branch 'maint' into next
Conflicts:

	configure
	lib/ext2fs/ext2_fs.h
	misc/e2image.c
2008-01-27 20:09:05 -05:00
Theodore Ts'o 0d1de232a8 Create filesystems with the ext_attr feature by default
Since recent kernels have a tendency to set this feature willy-nilly,
let's just enable by default.  It's only very old kernels that don't
support it any more.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-27 19:38:46 -05:00
Theodore Ts'o b1631cce64 Create new filesystems with 256-byte inodes by default
This makes it easier to upgrade to ext4 in the future, and it speeds
up extended attributes handling --- important on SELinux systems!

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-27 19:30:27 -05:00
Theodore Ts'o df200fffd5 e2image: Fix potential overflow if the device name is too long
Adapted from SLES's patch: e2fsprogs-strncat.patch

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-27 15:45:30 -05:00
Theodore Ts'o 6cb27404f5 Add support for the test_fs flag
The test_fs flag is an "ok to be used with test kernel code" flag.  It
makes it easier for us to determine whether a filesystem should be
mounted using ext4 or not.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-26 21:47:40 -05:00
Theodore Ts'o 153439222e Define helper functions ext2fs_set_i_{u,g}id_high() for MacOS compatibility
This is needed for all non-Linux/Hurd/Masix systems...

Addresses-Sourceforge-Bug: #1863819

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-21 09:46:05 -05:00
Eric Sandeen ebf5fb2b78 Fix the pathname of /var/lib/uuidd/uuidd.pid in uuidd man page.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-19 18:13:14 -05:00
Andreas Dilger 8c7c6eb167 mke2fs: Make lost+found always have at least 2 blocks
Make sure lost+found has always at least 2 disk blocks. This will provide at
least elementary test that we have not screwed-up support for 64KB blocks since
the second directory block will be empty.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-14 10:49:18 -05:00
Theodore Ts'o fef2b38d8e Merge branch 'maint' into next
Conflicts:

	configure
	debian/rules
	e2fsck/swapfs.c
	lib/ext2fs/ext2_fs.h
2008-01-01 12:41:35 -05:00
Theodore Ts'o c9eaebf6ff e2image: If there is an error while writing a block, call exit(1)
If the disk fills while e2image is writing its output file, it will
spew a large number of error messages instead of exiting with a
non-zero status code after the first failure.

Addresses-Sourceforge-Feature-Request: #606508

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-01 10:42:41 -05:00
Theodore Ts'o e5679a6ca4 uuidd: Add _GNU_SOURCE #define to pick up setres[ug]id() prototypes
Addresses-Sourceforge-Patch: #1861663

Reported-by: Mike Frysinger <vapier@users.sourceforge.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-01 09:30:46 -05:00
Theodore Ts'o 5610f9924b Add --disable-uuidd configure option
Add a configure option which causes the uuidd helper daemon not to be
built or used by the uuid library.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-31 22:34:19 -05:00
Theodore Ts'o 113d636a2b uuidd: Avoid race conditions to that only one uuidd is started
Use an improved locking protocol based on the pid file to assure that
only one uuidd is started.  Apparently the kernel does not prevent
multiple processes from racing to bind to a Unix domain socket.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-25 14:19:15 -05:00
Theodore Ts'o b689b8dd14 Merge branch 'maint' into next
Conflicts:

	lib/ext2fs/closefs.c
2007-12-17 10:28:01 -05:00
Theodore Ts'o 740837def7 Add uuidd daemon to prevent duplicate time-based UUID's
Also store the clock sequence information in a state file in
/var/lib/misc/uuid-clock so that if the time goes backwards the clock
sequence counter can get bumped.  This allows us to completely
correctly generate time-based (version 1) UUID's according to the
algorithm specified RFC 4122.

Addresses-Sourceforge-Bug: #1529672
Addresses-Red-Hat-Bugzilla: #233471

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-16 17:28:46 -05:00