Commit Graph

279 Commits (master)

Author SHA1 Message Date
Akira Fujita fab0d286ec 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>
2013-04-21 23:14:28 -04:00
Andreas Dilger 1b8c4c1b45 build: quiet build warnings for "gcc -Wall"
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-01-27 22:31:03 -05:00
Theodore Ts'o fca8b1b241 Merge branch 'maint' into next
Conflicts:
	RELEASE-NOTES
	version.h
2013-01-21 22:06:16 -05:00
Theodore Ts'o a713a7fe5a 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>
2013-01-21 19:07:38 -05:00
Theodore Ts'o b9b5e43ea8 Merge branch 'maint' into next
Conflicts:
	RELEASE-NOTES
	debian/changelog
	lib/ext2fs/crc32c.c
	lib/ext2fs/rw_bitmaps.c
	resize/resize2fs.c
	version.h
2013-01-01 18:50:26 -05:00
Theodore Ts'o e3507739e4 Fix gcc -Wall nits
This fixes the last set of gcc -Wall complaints.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-01-01 13:28:27 -05:00
Theodore Ts'o ccea20f62d Merge branch 'maint' into next
Conflicts:
	misc/tune2fs.c
2012-11-29 19:54:46 -05:00
Theodore Ts'o 0f8186598c tune2fs: fix a compile-time bug if quota is not enabled
Commit 44a2cca35e introduced a compile-time failure if --enable-quota
is not passed to the configure script.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-11-29 14:58:29 -05:00
Eric Sandeen 44a2cca35e tune2fs: respect quota config option
If we haven't turned --enable-quota on at config time,
I don't think tune2fs should know about the feature either.

Today we can actually tune2fs -O quota even if not
configured on, and then the rest of the tools will
refuse to touch it:

# tune2fs -O quota /dev/sda1
# tune2fs -O ^quota /dev/whatever complains
tune2fs 1.42.3 (14-May-2012)
tune2fs: Filesystem has unsupported read-only feature(s) while trying to open /dev/sda1
# fsck /dev/sda1
fsck from util-linux 2.21.2
e2fsck 1.42.3 (14-May-2012)
/dev/sda1 has unsupported feature(s): quota
e2fsck: Get a newer version of e2fsck!

Ok, so turn it off?
# tune2fs -O ^quota /dev/whatever complains
tune2fs 1.42.3 (14-May-2012)
tune2fs: Filesystem has unsupported read-only feature(s) while trying to open /dev/sda1

Nope.  Debugfs?  Nope.

# debugfs -w /dev/sda1
debugfs 1.42.3 (14-May-2012)
/dev/sda1: Filesystem has unsupported read-only feature(s) while opening filesystem

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reported-by: Bert DeKnuydt <Bert.Deknuydt@esat.kuleuven.be>
Addresses-Red-Hat-Bugzilla: #880596
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-11-28 22:52:52 -05:00
Darrick J. Wong ef1232b42a tune2fs: force MMP update when changing metadata_csum flag
When changing the metadata_csum flag, always force out a new MMP block.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-08-02 20:47:45 -04:00
Darrick J. Wong 9d25f643ef tune2fs: rewrite block group checksums when changing checksumming feature flags
When toggling the metadata_csum and uninit_bg feature flags, we should
rewrite the block groups with the desired checksum.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-08-02 20:47:45 -04:00
Darrick J. Wong 022c81aa19 tune2fs: store checksum algorithm type in superblock
Actually records the checksum algorithm type in the superblock when
enabling checksumming.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-08-02 20:47:44 -04:00
Darrick J. Wong fa0ecf18f5 tune2fs: rewrite extended attribute block checksums
When enabling metadata checksums, rewrite separate extended attribute
blocks.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-08-02 20:47:44 -04:00
Darrick J. Wong 761b76a4c7 tune2fs: rebuild and checksum directories when necessary
Since all the metadata checksums depend on the fs UUID, tune2fs must
be able to rewrite the checksums of _all_ metadata.  It's not that
hard to add in the bits to resize the directory block structures at
the same time.

[ Merged in fix from Zheng Liu where ctx.errcode wasn't getting
  cleared in rewrite_directory(). ]

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-08-02 20:47:35 -04:00
Darrick J. Wong 7cf0485d5d tune2fs: enable extent tree checksums
Add to tune2fs the ability to recalculate extent tree checksums when
altering the metadata checksum feature flag.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-07-30 19:16:04 -04:00
Darrick J. Wong 544058f261 tune2fs: rewrite block bitmap checksums
When toggling metadata_csum, mark the block bitmap dirty so that it
gets written with new checksums.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-07-30 19:12:04 -04:00
Darrick J. Wong 9038bdb359 tune2fs: rewrite inode bitmap checksums
When toggling metadata_csum, mark the inode bitmap dirty so that they
are written out with new checksums.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-07-30 18:58:04 -04:00
Darrick J. Wong 7178b57115 tune2fs: add inode checksum support
This patch adds to tune2fs the ability to toggle the metadata checksum
rocompat feature flag, which will rewrite the inode table with
checksums.  Disallow changing the UUID while the fs is mounted,
because rewriting the metadata objects is racy.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-07-30 18:50:04 -04:00
Aditya Kali 89dd15db9f tune2fs: fix quota feature removal
When the last quota inode is removed, the 'quota' feature
flag was not removed from superblock in some cases.
Ex:
 $ mke2fs -t ext4 -O quota <dev>  # creates both usr & grp
                                  # quota inodes
 $ tune2fs -Q ^usrquota <dev>  # removes usr quota inode
 $ tune2fs -Q ^grpquota <dev>  # removes grp quota inode,
                               # but the 'quota' feature flag
                               # was not removed from superblock
This patch removes the 'quota' feature flag from superblock
if none of the quota inodes are set.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-07-15 21:12:04 -04:00
Aditya Kali 5027751530 tune2fs/quota: always create hidden quota files
Currently 'tune2fs -O quota <dev>' will try to use existing
quota files and write their inode numbers in the superblock.
Next e2fsck run then converts these into hidden quota inodes
(ino #3 & #4). But this approach has problems:
1) Before e2fsck run, the inodes are visible to the user and
   might get corrupted or removed or replaced by the user.
2) Since these are user visible, we have to include
   their block usage in the quota accounting. But once
   these inodes are hidden, e2fsck will have to decrement
   their usage from the quota accounting (which e2fsck
   currently doesn't do and instead reports error).
   (the following used to give e2fsck error previously:
    # assume <dev> has aquota.user & aquota.group files
    $ tune2fs -O quota <dev> # stores ino# of quota files in
                             # ext4 superblock
    $ e2fsck -f <dev>  # hides quota files, but now quota
                       # usage is incorrect.
     << quota errors >>
Instead of making e2fsck complicated, this patch creates the
hidden quota inodes at 'tune2fs -O quota' time iteself. The
usage is computed freshly and limits are copied from the
aquota.user and aquota.group files as earlier.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-07-15 21:12:04 -04:00
Theodore Ts'o e64e6761aa Fix gcc -Wall nitpicks
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-05 12:13:05 -07:00
Theodore Ts'o 24dea55494 Use rbtree bitmaps for dumpe2fs, debugfs, and tune2fs
For large file systems, using the rbtree bitmap can save a lot of
memory.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-03-15 16:39:56 -04:00
Niu cdfaa75901 tune2fs: preserve old limits when turn on quota feature
When turn on quota by tune2fs, if the old quota file exist, the quota
usage should be recomputed but the old limits should be preserved.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-11-14 10:58:28 -05:00
Aditya Kali d7c6f4e6d0 tune2fs: Compute quota usage when turning on the 'quota' feature
When turning on the quota feature, tune2fs would create empty quota inodes and
set their inode numbers in superblock. This required e2fsck to be ran before
using the quota feature. This patch adds adds call to compute_quota() and make
sure that we write correct quota information in the quota files at tune2fs time
itself. This gets rid of the necessity for running e2fsck after setting the
quota feature. Also, tune2fs now does not use existing old quota files
(aquota.user and aquota.group) even if they exist.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-11-14 10:55:54 -05:00
Aditya Kali a86d55da8b libquota: cleanup libquota code
This patch cleans up the quota code as suggested in previous reviews. This
includes
* remove BUG_ON()s and 'exit()' calls from library code
* remove calls to malloc/free and instead use ext2fs_get/free_mem functions.
* lib/quota/common.c file in not needed anymore and is removed.
* rename exported functions to start with quota_
  (ex: init_quota_context --> quota_init_context)
* better error handling in quota library

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-11-14 10:55:54 -05:00
Theodore Ts'o 0c80c44bd0 libext2fs: ext2fs_[set_]file_acl_block needs to check for 64-bit feature flag
The ext2fs_file_acl_block() and ext2fs_set_file_acl_block() needs to
only check i_file_acl_high if the 64-bit flag is set.  This is needed
because otherwise we will run into problems on Hurd systems which
actually use that field for h_i_mode_high.

This involves an ABI change since we need to pass ext2_filsys to these
functions.  Fortunately these functions were first included in the
1.42-WIP series, so it's OK for us to change them now.  (This is why
we have 1.42-WIP releases.  :-)

Addresses-Sourceforge-Bug: #3379227

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-10-16 20:46:49 -04:00
Theodore Ts'o 3fcd8fe8ac Fix more spelling errors found by translators and add pluralization
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-10-09 17:54:23 -04:00
Theodore Ts'o 9d4507c5b6 Pass the gettext() function to libcom_err
For those e2fsprogs programs which use libcom_err and are
internationalized, pass the gettext() function to libcom_err during
program initialization.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-10-05 01:00:30 -04:00
Theodore Ts'o 36e4e21f51 libquota: remove get_qf_name()
The get_qf_name() function used PATH_MAX, which is non-portable.
Worse, it blindly assumed that PATH_MAX was the size of the buffer
passed to it --- which in the one and only place where it was used in
libquota, was a buffer declared to a fixed size 256 bytes.

Fix this by simply getting rid of the function altogether.

Cc: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-10-04 18:51:43 -04:00
Andreas Dilger 0f5eba7501 ext2fs: add multi-mount protection (INCOMPAT_MMP)
Multi-mount protection is feature that allows mke2fs, e2fsck, and
others to detect if the filesystem is mounted on a remote node (on
SAN disks) and avoid corrupting the filesystem.  For e2fsprogs this
means that it checks the MMP block to see if the filesystem is in use,
and marks the filesystem busy while e2fsck is running on the system.

This is useful on SAN disks that are shared between high-availability
servers, or accessible by multiple nodes that aren't in HA pairs.  MMP
isn't intended to serve as a primary HA exclusion mechanism, but as a
failsafe to protect against user, software, or hardware errors.

There is no requirement that e2fsck updates the MMP block at regular
intervals, but e2fsck does this occasionally to provide useful
information to the sysadmin in case of a detected conflict.

For the kernel (since Linux 3.0) MMP adds a "heartbeat" mechanism to
periodically write to disk (every few seconds by default) to notify
other nodes that the filesystem is still in use and unsafe to modify.

Originally-by: Kalpak Shah <kalpak@clusterfs.com>

Signed-off-by: Johann Lombardi <johann@whamcloud.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-25 01:55:23 -04:00
Andreas Dilger 6747ac86b9 tune2fs: miscellaneous whitespace fixups
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-24 14:34:56 -04:00
Andreas Dilger d90d6a7146 tune2fs: kill external journal if device not found
Continue to remove the external journal device even if the device
cannot be found.

Add a test to verify that the journal device/UUID are actually removed
from the superblock.  It isn't possible to use a real journal device
for testing without loopback devices and such (it must be a block device)
and this would invite complexity and failures in the regression test.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-24 14:34:47 -04:00
Andreas Dilger 6b56f3d92d misc: quiet minor compiler errors
Several compiler errors are quieted:
- zero-length gnu_printf format string
- unused variable
- uninitalized variable (though it isn't actually used for anything)
- fixed a bug in ext2fs_stat() if stat64() does not exist

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-24 13:00:24 -04:00
Theodore Ts'o d1154eb460 Shorten compile commands run by the build system
The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and
this was starting to cause some tools heartburn.  It also made "make
V=1" almost useless, since trying to following the individual commands
run by make was lost in the noise of all of the defines.

So fix this by putting the configure-generated defines in lib/config.h
and the directory pathnames to lib/dirpaths.h.

In addition, clean up some vestigal defines in configure.in and in the
Makefiles to further shorten the cc command lines.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-18 17:34:37 -04:00
Eric Sandeen c3ecabe61d tune2fs: handle inode and/or block bitmap read failures in resize_inode()
Handle these failures in resize_inode, and handle the propagated
error in the caller.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-16 19:55:55 -04:00
Lukas Czerner faa2dcdad0 mke2fs: Use ext2fs_flush() only once
We are doing ext2fs_flush() twice right now at the end of the mke2fs.
First by directly calling ext2fs_flush() which is intended to write
superblock and fs accounting information. And then it is invoked again
when we are calling ext2fs_close(), only this time, because the fs is
not dirty, we are writing out only superblock.

I think it is bad to call it twice because even when writing only super
block it takes some time on bigger file systems and moreover
ext2fs_close() can fail without any reasonable explanation for the user.
Also ext2fs_flush() is printing out progress and it is confusing for the
users.

Fix all this by removing the ext2fs_flush() and leaving it all to
ext2fs_close(). However we need to introduce new variables to store
check interval and max mount count, because fs structure is freed on
ext2fs_close() and we really want to print those information as the last
info for the user.

[ Fixed type mismatch in a printf format statement -tytso]

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-13 22:42:19 -04:00
Aditya Kali 771e8db9f0 tune2fs: Add support for turning on quota feature
This patch adds support for setting the quota feature in superblock
and allows selectively creating quota inodes (user or group or both)
in the superblock. Currently, modifying the quota feature is only
supported when the filesystem is unmounted.
Also, when setting the quota feature, tune2fs will use aquota.user or
aquota.group file inode number in superblock if these files exist.
Otherwise it will initialize empty quota inodes #3 and #4 and use them.

Here is how it works:
 # Set quota feature and initialize both (user and group) quota inodes
 $ tune2fs -O quota /dev/ram1

 # Enable only one type of quota
 $ tune2fs -Q usrquota /dev/ram1

 # Enable grpquota, disable usrquota
 $ tune2fs -Q ^usrquota,grpquota /dev/ram1

 # Clear quota feature and remove quota inodes
 $ tune2fs -O ^quota /dev/ram1

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-08-31 18:08:42 -04:00
Theodore Ts'o f37901a22d Merge branch 'maint' into next
Conflicts:
	misc/tune2fs.c
2011-07-04 20:51:19 -04:00
Theodore Ts'o 9a976ac732 tune2fs: Fix mount_opts handling
The extended options parsing for mount_opts was horribly buggy.
Invalid mount options that had an argument would get interpreted as an
extended mount options.  Fix this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-07-04 20:14:35 -04:00
Theodore Ts'o 035f32ab17 tune2fs: allow setting the stride and stripe width to zero
Tune2fs previously would give an error if the user tried setting the
stride and stripe-width parameters to zero; but this is necessary to
disable the stride and stripe-width settings.  So allow setting these
superblock fields to zero.

Addresses-Google-Bug: #4988557

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-07-04 19:37:11 -04:00
Theodore Ts'o fe75afbf33 Fix superblock field s_blocks_count for bigalloc file systems
Treat the s_blocks_count field in the superblock as a free block count
(instead of the number of free clusters) for bigalloc file systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-16 01:38:43 -04:00
Andreas Dilger cf5301d7f2 misc: clean up compiler warnings
Fix several types of compiler warnings (unused variables/labels),
uninitialized variables, etc that are hit with gcc -Wall.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-06-11 10:58:25 -04:00
Theodore Ts'o 3977a4ff5b Merge branch 'maint' into next
Conflicts:
	misc/tune2fs.c
2011-05-31 20:08:58 -04:00
Kazuya Mio 2972b16376 tune2fs: Fix overflow of interval check
Add the check of maximum check interval.
s_checkinterval is 32bit variable, so it cannot be set more than 2^32.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-05-31 20:07:38 -04:00
Kazuya Mio b1503c446a e2fsprogs: Unify the upper limit of reserved blocks count
In e2fsprogs, the upper limit of reserved blocks count is a half of
filesystem's blocks count. This patch fixes the incorrect checks of
reserved blocks count.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-05-31 20:07:38 -04:00
Theodore Ts'o 9d92a201de Merge branch 'maint' into next
Conflicts:
	configure
	configure.in
	lib/ext2fs/ext2fs.h
	misc/mke2fs.c
2010-09-24 22:40:21 -04:00
Theodore Ts'o 9345f02671 tune2fs, debugfs, libext2fs: Add support for ext4 default mount options
Add support for 2.6.35's new default mount options which can be
specified in the superblock.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-18 19:38:22 -04:00
Valerie Aurora Henson 7117f8d6c5 tune2fs: Fix up to be 64-bit block number safe
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-06-13 16:00:00 -04:00
Theodore Ts'o 97d26ce9e3 Merge branch 'maint' into next
Conflicts:
	e2fsck/journal.c
	e2fsck/pass1.c
	e2fsck/pass2.c
	misc/mke2fs.c
2010-06-07 12:42:40 -04:00
Theodore Ts'o 079ad63d59 tune2fs: Enable uninit_bg to be set without requiring an fsck
Allow the uninit_bg feature to be set without requiring an fsck.  The
first full fsck will require scanning all of the inode table blocks,
but subsequent fsck's will be fast.  This allows flexibility over
requiring a full fsck after setting this feature, which is what
tune2fs previously mandated.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-19 12:14:39 -04: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
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
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
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
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 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 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 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 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
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
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 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 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 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 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 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
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 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 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 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 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
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 721b367abf Fix gcc -Wall warnings in tune2fs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 11:51:33 -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
Theodore Ts'o a70f10dbc4 Merge branch 'maint' 2008-03-30 14:03:51 -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 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
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 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 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 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 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 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 ef80fdc8ad Merge branch 'maint' into next 2008-02-10 08:03:54 -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 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
Jose R. Santos c2d4300b8a Enable FLEX_BG feature support
Add FLEX_BG as a supported feature bit.

Add support to mke2fs to create filesystems with FLEX_BG.

Add support to tune2fs to add (and remove, if it won't break
filesystem consistency) the FLEX_BG feature.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
--

 lib/e2p/feature.c   |    2 ++
 lib/ext2fs/ext2fs.h |    6 ++++--
 misc/mke2fs.c       |    7 ++++++-
 3 files changed, 12 insertions(+), 3 deletions(-)
2007-11-03 20:40:56 -04:00
Theodore Ts'o 058ad1c70c Don't write changes to the backup superblocks by default
This patch changes ext2fs_open() to set EXT2_FLAG_MASTER_SB_ONLY by
default.  This avoids some problems in e2fsck (reported by Jim Garlick)
where a corrupt journal can end up writing the bad superblock to the
backups.  In general, only e2fsck (after the filesystem is clean),
tune2fs, and resize2fs should change the backup superblocks by default.
Most callers of ext2fs_open() should not be touching anything where the
backups should be touched.  So let's change the defaults to avoid
potential problems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-18 18:26:50 -04:00
Theodore Ts'o a6d8302b48 Use the newer add/remove_error_table com_err interfaces
Change all of the e2fsprogs programs to use the newer add_error_table()
and remove_error_table() interfaces instead of the much older
initialize_*_error_table() function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-12-26 03:38:07 -05:00
Theodore Ts'o a8862d9e90 Fix potential 2**32-1 overflow by using e2p_percent()
Add a new functiom, e2p_percent(), which correct calculates the percentage
of a number based on a given percentage, without worrying about overflow
issues.  This is used where we calculate the number of reserved blocks using
a percentage of the total number of blocks in a filesystem.

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

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2006-08-30 03:08:13 -04:00
Theodore Ts'o f51d0eff90 Remove needless sanity check in tune2fs's -i option.
We were complaining with a confusing error message if the user tried to specify
a check interval larger than a 365 days.  It's probably a bad idea if the user wants to
do this, but it's not worth it to complain.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-05-14 17:30:51 -04:00
Andreas Dilger ce911145ed Allow fractional percentages to the -m option in mke2fs and tune2fs
Allow the reserved blocks ratio to be specified in fractional
percentages.  

Addresses-Debian-Bug: #80205
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2005-07-06 11:50:08 -05:00
Theodore Ts'o bb145b01cf Fix e2fsprogs messages for grammar and consistency, based on suggestions
from Benno Schulenberg.

Add missing _() so all strings can be internationalized.
2005-06-20 08:35:27 -04:00
Theodore Ts'o f35fd3d5ee Fix some minor typo's and grammar's strings, and remove debugging strings
from needing to be translated.  Patch is from Benno Schulenberg.
2005-05-09 16:22:17 -04:00
Theodore Ts'o 07f031fd1d Define _XOPEN_SOURCE to be 500 to fix compilation problems on Solaris. 2005-02-03 20:38:52 -05:00
Theodore Ts'o 32237014a1 Various portability fixes for Solaris systems. 2005-01-17 19:13:39 -05:00
Theodore Ts'o 22ba4c1ded Make tune2fs and e2fsck consistent about allowing at most 50% of the blocks
in a filesystem to be reserved for allocation by the root user.
2005-01-06 14:05:17 -05:00
Theodore Ts'o 690e693caf tune2fs.c (parse_time): Fix minor buglet; the parse_time routine
should use the passed-in argument, not optarg, even though
	the two are the same in the case of the current caller of
	said function.  (i.e., no user-visible problems were caused
	by this, even though the code was wrong).
2004-12-21 20:40:08 -05:00
Theodore Ts'o 2e8ca9a26b Add support for passing options to the io layer using the URL syntax. For
example, /tmp/test.img?offset=1024.  Multiple options can separated using
the & character, although at the moment the only option implemented is
the offset option in the unix_io layer.
2004-11-30 14:07:11 -05:00
Theodore Ts'o d06863f0e5 Remove TUNE2FS_SKIP_MOUNT_CHECK environment variable support; it is
not needed in the initrd script, and wasn't completely supported 
anyway.
2004-04-12 12:37:55 -04:00
Theodore Ts'o 2eb3b20e80 tune2fs.c (main): If the environment variable
TUNE2FS_SKIP_MOUNT_CHECK is set, do not try 
	to check if the filesystem is mounted.
(update_feature_set): If the compatibility bitmasks were
	not modified, don't set the superblock dirty bit.
2004-04-07 09:27:36 -04:00
Matthias Andree b969b1b8a5 Fix more compiler warnings. 2003-12-28 13:04:35 +01:00
Theodore Ts'o 544349270e Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
Theodore Ts'o 817e49e3ce Check the returned name from blkid_get_devname in tune2fs and
e2fsck, and print an error if the requested LABEL/UUID does 
not exist (previously, we core dumped!)
2003-11-21 09:10:29 -05:00
Theodore Ts'o 2a29f1354f Add --enable-test-io-debug configure option which causes e2fsck and
tune2fs to use the test I/O manager.

The test I/O manager has been changed to not do anything extra by 
default, unless the TEST_IO_FLAGS and/or TEST_IO_BLOCK environment
variables are set, which controls what I/O operations are logged and
a block number to watch, respectively.  The log messages are sent to
stderr by default, unless a filename is specified via the 
TEST_IO_LOGFILE environment variable.
2003-05-05 12:08:47 -04:00
Theodore Ts'o bc7c14e040 tune2fs.c (parse_time): Add portability code to work around lack
of strptime().
2003-05-03 16:40:09 -04:00
Theodore Ts'o 332f2c2382 tune2fs.c (parse_tune2fs_options, parse_e2label_options): Allow
the device name to be specified using LABEL=xxx or
	UUID=xxx, since we're including the blkid library anyway.
	(Addresses Debian bugs #166048, #179671)
2003-03-06 12:58:33 -05:00
Theodore Ts'o ed1b33e8fb Minor bug fixes in the blkid library.
Convert mke2fs, fsck, and tune2fs to use the blkid library.
2003-03-01 19:29:01 -05:00
Theodore Ts'o a0c3fd5e4c Add support for new feature in ext2/3 filesystems; a default mount options field
in the superblock.  Added the tune2fs '-o' option to set this field.
2002-10-15 17:43:43 -04:00
Theodore Ts'o 3e69906495 Fix gcc -Wall nits.
Fix format bug if NLS is in use.

Add extra so that the info directory looks OK on OpenWall.
2002-10-13 23:56:28 -04:00
Theodore Ts'o 843049c4db mke2fs.c (main): Enable directory indexing by default.
tune2fs.c (update_feature_set): Allow directory indexing flag to
	be set.  If so, set the default hash to be TEA, and
	initialize the hash seed to a random value.
2002-09-22 15:37:40 -04:00
Theodore Ts'o 118d7dacc5 Add support for searching /proc/evms/volumes when interpreting
LABEL=xxx or UUID=xxx.  

Add new utility program /sbin/findfs, which interprets LABEL=xxx or
UUID=xxx, and returns the device name.  (Part of tune2fs).
2002-08-17 23:01:22 -04:00
Theodore Ts'o 14308a5398 Newer libintl needs LC_CTYPE to be set in addition to LC_MESSAGES. 2002-03-05 03:26:52 -05:00
Andreas Dilger 0072f8de52 Add check for mkfs.ext3 and create a journal in this case. 2002-02-25 23:11:26 -07:00
Andreas Dilger c007bc06d9 Return a non-zero exit code on error. 2001-12-25 23:10:40 -07:00
Theodore Ts'o d4de4aa938 tune2fs.8.in, tune2fs.c (parse_tune2fs_options, main): Add
support for new option, -T, which allows the user to set
	the last checked time on the filesystem.
2001-12-26 08:58:01 -05:00
Theodore Ts'o 4ea7bd0439 Fix various gcc -Wall nits. Fixed a bug in mke2fs where a bogus
error message could be printed on an malloc() failure, and e2image
was optimized to avoid needless system calls by using the stashed
inode functions.
2001-12-16 23:23:37 -05:00
Theodore Ts'o f6a6afcef4 Remove dead code that wasn't in use from tune2fs. 2001-09-19 18:27:39 -04:00
Theodore Ts'o 0f8973fb09 Remove EXT2FS_VERSION from the version display, since it
only confuses people.

Make fsck's version display be consistent with the other e2fsprogs
programs.
2001-08-27 12:44:23 -04:00
Theodore Ts'o e843c76016 Minor fixups to Andreas' changeset. Removed unused variable
from tune2fs and added missing function prototype.
2001-08-18 14:22:25 -04:00
Andreas Dilger 2d15576dfe get_device_by_label.[ch], fsck.c, util.c: New interpret_spec()
function in get_device_by_label.c to allow the use of
        UUID= or LABEL= when creating filesystems which use external
        journal dev (e.g.  mke2fs -J device=LABEL=<journal_label>).

tune2fs.c: Use superblock s_journal_uuid to locate an external
        journal device instead of s_journal_dev when removing it.
        Allow opening journal devices to set the label and UUID
        in the ext2 superblock.

mke2fs.c, tune2fs.c: Free journal_device after use, as it is
        malloc'd in interpret spec.
2001-08-17 03:48:11 -06:00
Theodore Ts'o 7141b54b1a * tune2fs.c: Make sure that error messages are sent to stderr, and
normal messages are sent to stdout.  (Addresses Debian bug
	#108555.)
2001-08-15 19:17:37 -04:00
Theodore Ts'o d258668d58 Give an error if -O is specified more than once to tune2fs. 2001-08-15 11:03:58 -04:00
Theodore Ts'o 194686bbae tune2fs.c (update_feature_set, remove_journal_inode): If
removing an in-filesystem journal, clear out the journal
	inode and update the filesystem accounting structures so
	we don't have to run e2fsck to clean up after ourselves
2001-07-31 12:03:23 -04:00
Theodore Ts'o de49f015a4 tune2fs.c (update_feature_set): Don't require a forced fsck if
we're removing an external journal from a filesystem.
2001-07-30 16:31:30 -04:00
Theodore Ts'o 66cf2f6035 ChangeLog, mke2fs.c, tune2fs.8.in, tune2fs.c, util.c, util.h:
tune2fs.c, mke2fs.c, util.c, util.h (print_check_message): Move the
  	message which displays how often the filesystem will be checked from
  	mke2fs into a utility subroutine.  Then cause tune2fs to call that
  	function to display the message after adding a journal to a
  	filesystem.
  mke2fs.8.in: Add manual page fixups and explanation for why it's good
  	to check filesystems periodically from Andreas Dilger.
2001-06-14 06:42:44 +00:00
Theodore Ts'o e549d0a6a8 ChangeLog, tune2fs.c:
tune2fs.c (update_feature_set): Fix capitalization typo.
2001-05-25 16:38:48 +00:00
Theodore Ts'o 54c637d4d2 Many files:
badblocks.c, chattr.c, dumpe2fs.c, e2image.c, findsuper.c, lsattr.c,
  	mke2fs.c, mklost+found.c, tune2fs.c, util.c: Change location of
  	ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, resize2fs.h:
  resize2fs.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, debugfs.h:
  debugfs.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, e2fsck.h, scantest.c:
  e2fsck.h, scantest.c: Change location of ext2_fs.h to be
  	ext2fs/ext2_fs.h
ChangeLog, Makefile.in, tst_uuid.c, uuid_time.c:
  tst_uuid.c, uuid_time.c: Remove unneeded #include of ext2_fs.h
ChangeLog, Makefile.in, e2p.h:
  e2p.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, test_icount.c, test_rel.c:
  test_icount.c, test_rel.c: Change location of ext2_fs.h to be
  	ext2fs/ext2_fs.h
2001-05-14 11:45:38 +00:00
Theodore Ts'o 8d6417498c ChangeLog:
Clarify some of the Changelog entries.
ChangeLog, fsck.8.in, mke2fs.8.in, tune2fs.8.in:
  fsck.8.in, mke2fs.8.in, tune2fs.8.in: Fix typo's and make other
  	clarifications suggested by Andreas Dilger.
ChangeLog, tune2fs.c:
  tune2fs.c (update_feature_set): Clean up some printf messages.
2001-05-14 04:12:27 +00:00
Theodore Ts'o ce57f14f40 ChangeLog, tune2fs.c:
tune2fs.c (parse_tune2fs_options): Interpret -c 0 as -c -1 (for
  	backwards compatibility with older kernels).  -c 0 makes more sense to
  	users.
tune2fs.8.in:
  Update tune2fs manual papge so that it is up to date.
2001-04-26 04:25:39 +00:00
Theodore Ts'o 4d0f22832c ChangeLog, tune2fs.c:
tune2fs.c (remove_journal_device): If the force flag is given, tune2fs
  	will remove the journal device information from the superblock even if
  	tune2fs failed to open the journal device or otherwise other failed to
  	remove the filesystem from journal device.
  	(parse_tune2fs_options): Fix -j option so that it works (it was
  	missing the open_flag being set to EXT2_FLAG_RW).
  	(main): Accept "-U clear" to set a null UID.
2001-04-23 20:58:03 +00:00