The current method of adding one block group at a time to a mounted
filesystem means it is impossible to accomodate the flex_bg allocation
method of placing the metadata together in a single block group. For
now we "fix" this issue by using the traditional layout for new block
groups, where each block group is self-contained and contains its own
bitmap blocks and inode tables. This means we don't get the layout
advantages of flex_bg in the new block groups, but at least it allows
on-line resizing to function.
Long term, we will need to create a new ioctl which does much more of
the resizing work in the kernel.
We also fix a bug in the ext3/ext4 ioctl fallback code so we stop
trying the ext3 ioctl for every single block group when resizing an
ext4 filesystem.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If the number of block groups is greater than half the flex_bg size,
the journal we be placed in the flex_bg super-group which is closest
to the mid-point of the filesystem, and in the first free block group
beyond where the metadata for the flex_bg is stored.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Provide a C language wrapper function for io_channel_read_blk64() and
io_channel_write_blk64() instead of using a C preprocessor macro, with
an fallback to the old 32-bit functions if an application-provided I/O
channel manager doesn't supply 64-bit method functions and the block
numbers can fit in 32-bit integer.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This is needed so that extent-based inodes (including a journal inode)
can be created via block_iterate.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This speeds up access to the journal by eliminating worst-case seeks
from one end of the disk to another, which can be quite common in very
fsync-intensive workloads if the file is located near the end of the
disk, and the journal is located the beginning of the disk.
In addition, this can help eliminate journal fragmentation when
flex_bg is enabled, since the first block group has a large amount of
metadata.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Give a boost to dm devices which are not used to build other dm
devices, since "leaf" devices are generally more likely to be
interesting as devices to mount.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
blkid_devdirs was defined in blkidP.h and was never intended to be
used outside of the library. Since it no longer needs to be shared
across object files, rename it and turn it into a static variable.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit works by removing all calls from libdevmapper altogether,
and using the standard support for "normal" non-dm devices.
It depends on dm devices being placed in /dev/mapper (but the previous
code had this dependency anyway), and /proc/partitions containing dm
devices.
We don't actually rip out the libdevmapper code in this commit, but
just disable it via #undef HAVE_DEVMAPPER, just so it's easier to
review and understand the fundamental code changes. A subsequent
commit will remove the libdevmapper code, as well as unexport
the blkid_devdirs string array.
Thanks to Karel Zak for inspiring me to look at the dm code in blkid,
so I could realize how much it deserved to ripped out by its roots. :-)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
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>
Rename crc16 to ext2fs_crc16, and make crc16_table static, since
there's not reason it should be exposed at all.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
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>