Commit Graph

719 Commits (0eeec8ac61bf1eaa31533b2be825cd75580829c9)

Author SHA1 Message Date
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