Fix error message to print the depth of a corrupt htree directory.
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Kalpak Shah <kalpak.shah@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Print out the currently supported features of e2fsprogs/libext2fs
via a new "debugfs supported_features" command. This helps scripts
to know whether it is possible to try and enable specific features
in the filesystem.
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>
Allow "make rpm" to take some extra configure options from the build
environment without having to patch the code.
Build the tarball in a temporary directory instead of the e2fsprogs
source directory.
Signed-off-by: Michael MacDonald <Michael.Macdonald@Sun.COM>
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Make the dblist grow more quickly when many directory blocks are added,
otherwise the array has to get copied too often, which is slow when it
is large.
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This makes it easier to locate the problem code in question.
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This patch changes the e2fsck_write_bitmaps() function to write out the
block and inode bitmaps together, instead of writing them in two passes.
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
I want to make sure the uuidd daemon is shutdown before removing
the package. Since the uuidd daemon is provided by the uuid-runtime
package, and I *know* exactly where it is, and I ***don't*** want the
script to be confused by some other pathname being used by the local
administrator, I specify an explicit pathname. In addition, given the
explicit test to make sure /usr/sbin/uuidd exists, it seems non-sensical
to remove the prepended path.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The libuuid1.postinst script doesn't really call adduser; it just
checks the adduser config file, if it exists. The lintain maintainers
agree this is a spurious warning, and it will be fixed eventually.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This override is no longer necessary since lintian excludes foo.static
binaries from the static binary test.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
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>
Trivial fix to print the progname instead of argv[0] in error message.
Signed-off-by: "Manish Katiyar" <mkatiyar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Close the filehandle and return in case if we are unable to expand the
directory during write.
Signed-off-by: "Manish Katiyar" <mkatiyar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Check to make sure a JFS filesystem is really correct by checking the
relationship between the following fields in the JFS superblock:
s_bsize, s_l2bsize, s_pbsize, s_l2pbsize, and s_l2bfactor. Thanks to
Lesh Bogdanow for this suggestion.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
OS/2 and DFSee creates a pseudo FAT-12/16 header in the first 512
bytes of a filesystem which looks enough like a FAT-12/16 to fool
blkid. Part of this is because we don't require ms_magic or vs_magic
to be the strings "FAT12 ", "FAT16 ", or "FAT32 ", since some FAT
filesystem formatters don't set ms_magic or vs_magic. To address
this, we explicitly test for "JFS " and "HPFS " in ms_magic,
and if they are found, we assume the filesystem is definitely not
a FAT filesystem.
Addresses-Launchpad-Bug: #255255
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Below patch ensures that cleanup is done properly in ext2fs_initialize
from all return paths in case of errors.
Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
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>
__LITTLE_ENDIAN is set by the glibc headers, and isn't portable. We
should be using WORDS_BIGENDIAN, which is set by autoconf.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If the --with-ldopts option is not passed on the command line, respect
the LDFLAGS environment variable instead of forcing LDFLAGS to be
unset. "configure --help" documents LDFLAGS as part of the standard
configure script calling convention.
Addresses-Sourceforge-Feature-Request: #1937287
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This gives us standard behavior when using flags such as --quiet, and
gives us standard warning output when showing warnings and errors.
Addresses-Sourceforge-Patches: #2058794
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Some bootloaders, like SILO, don't provide sprintf in their limited
bootloader environment. Since the uses in rw_bitmaps.c is only doing
sprintf("foo %s"), it's easy to replace that usage with strcpy/strcat.
Addresses-Sourceforge-Bug: #2049120
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This fixes a cosemtic issue where we don't complete the progress bar
and issue a newline before printing the final resize successful
message.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
In the rare case where new blocks are needed while mutating an extent
tree, supply a specialized block allocator so that extent_node_split()
allocates valid blocks for the interior nodes of the extent tree.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If the filesystem has the uninit_bg feature, then parts of the block
and inode bitmap may not be initialized. Teach resize2fs how to deal
with these case appropriately. (Most of these fixes were fortunately
not necessary for the common case where the resize_inode is present to
reserve space, and where the filesystem is being expanded instead of
being shrunk.)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If the allocation functions need to allocate out of a block group
where the inode and/or block bitmaps have not yet been initialized,
initialize them so ext2fs_new_block() and ext2fs_new_inode() work
correctly.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Resize2fs needs to be able to relocate the interior nodes of an extent
tree. Add support for this feature via ext2fs_extent_replace().
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
When resize2fs moves blocks belonging to an inode, it will call
ext2fs_extent_set_bmap() for logical blocks 0, 1, 2, 3, ...
Optimize for this calling pattern so we don't end up creating a
separate extent for each block.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
When replacing a single block extent, make sure we set or clear the
uninitialized extent flag as requested by the caller.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
When setting a logical block which is before the first extent in the
extent tree, make sure the new extent goes in front, at the very
beginning of the extent tree. This fixes a bug where previously the
new extent would be inserted out of order in this case.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Fix a signed vs. unsigned bug that was accidentally introduced in
commit f1f115a7, which was introduced in e2fsprogs 1.41.0
Addresses-Debian-Bug: #495830
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
When moving directories into new block groups (which would only happen
when shrinking a filesystem), resize2fs would increase the directory
in-use count by 2 times the necessary value, due to a change in
ext2fs_inode_alloc_stats() made in e2fsprogs 1.26. This is largely
harmless, but it does result in a filesystem corruption for e2fsck to
fix.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
For inodes with blocks preallocated with FALLOC_FL_KEEP_SIZE, e2fsck
complained about i_size being too small. Fix this.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
A misunderstanding C's precedence rules and the meaning of
s_log_block_size meant that we were capping the maximum size of
extent-based files at 8GB instead of the 64TB that it should be for
filesystems with 4k block sizes.
Addresses-Kernel-Bugzilla: #11341
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Memory allocated for the ext2_extent_handle is not getting freed from
all the return paths in case of error. Below patch fixes it.
Signed-off-by: "Manish Katiyar" <mkatiyar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
As Li Zefan <lizf@cn.fujitsu.com> reported, the creation timestamp was
not getting set on the lost+found inode. This patch makes sure all of
the timestamps are appropriately set.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
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>
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>