The current libblkid code expects that there's magic string in FAT super
block (like "FAT12", "FAT16", ...). It's very often right, but valid FAT
super block may be without magic string too :-(
The patch from attachment fix this problem. It's inspired by HAL and
Linux kernel.
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
There's mistake in blkid ext2 detection code. The libblkid doesn't
check for journal when revalidate the cache information about an ext2
device.
# rm -f /etc/blkid.tab
# mkfs.ext2 /dev/loop0 &> /dev/null
# blkid -s TYPE /dev/loop0
/dev/loop0: TYPE="ext2"
# mkfs.ext3 /dev/loop0 &> /dev/null
# blkid -s TYPE /dev/loop0
/dev/loop0: TYPE="ext2"
That bug doesn't appear when libblkid creates new cache and checks for
all possible filesystems, because it tries ext3 before ext2. BUT when
the library only revalidate the cache it first probes for old cached
filesystem (e.g. ext2).
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Add the --valgrind option to the tests/test_script which allows us to
run the e2fsprogs regression test suite under valgrind.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
There was a off-by-one fencepost error in the logic used to check if
we avoid copying zero-filled blocks when moving an inode table down by
a block or two. Thanks to valgrind for catching it. As far as I know
this fencepost error wasn't causing any actual problems, but it was
definitely a bug.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Don't do a structure copy via an assignment in e2fsck's pass #1 when
it is a no-op in order to avoid false positives from valgrind.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Texi2html's behavior changed recently: if it is invoked with
-split=chapter, old versions place the HTML files in the same
directory as the documentation source, whereas new versions place the
generated files in a subdirectory.
Reported by Matt Kraai.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
In ext2fs_add_journal_inode() check for the case where the filesystem
appears to be unmounted, but the device is still apparently busy.
This can happen when the luser doesn't bother to mount /proc and has a
bogus /etc/mtab, but still wants to mount the filesystem before using
tune2fs(?!?). Add a safety check to save him from his own stupidity,
at least on 2.6 kernels. (Addresses Debian Bug #319002)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Since e2fsprogs is now being managed by Mercurial instead of BK,
remove BitKeeper and add ".hg", ".hgignore", ".pc", and "patches" to
the list of files/directories not included in the tar file.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
target is a regular file, instead of doing binary searching. It also
fixes a couple of cases where a file descriptor is leaked in the
ext2fs_getsize() routine on error.
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Reorder some mke2fs arg parsing to be more alphabetical, and remove
use of atoi() (which doesn't report errors) in favour of strtoul().
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Allow the reserved blocks ratio to be specified in fractional
percentages.
Addresses-Debian-Bug: #80205
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
This file descripts the signed-off-by procedure first used by Linus
for the Linux kernel patch submissions, and which will now be used for
e2fsprogs as well.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This was actually caused by two bugs. The first bug is that if the
inode has been fully fixed up, the code will attempt to remove the
inode from the inode_bad_map without checking to see if this bitmap is
present. Since it is cleared at the end of pass 2, if
e2fsck_process_bad_inode is called in pass 4 (as it is for
disconnected inodes), this would result in a core dump.
The first bug was mostly hidden by a second bug, which caused
e2fsck_process_bad_inode() to consider all inodes without an extended
attribute to be not fixed.
Note: This bug was introduced in e2fsprogs 1.36.
(Addresses Debian Bug: #316736)
The set_inodes_field command was silently failing when setting one of
the following fields: frag, fsize, uid_high, gid_high, and author.
The type size for these fields were set to an incorrect value in the
inode_fields table.
ext2fs_test_bit to take an unsigned int for the bit number. Negative
bit numbers were never allowed (and didn't make any sense), so this should
be a safe change. This is needed to allow safe use of block numbers
greater than or equal to 2**31.
The trouble is that it is modifying pointers in place, but doing so via
"void *" types which alias the pointers passed in (which are typically
pointers to a struct.) The inline ext2fs_resize_mem() code may update
the pointer, but the caller is not required to reload the old value it
may have cached in a register, according to the type aliasing rules.
This is causing the caller to dereference the old pointer when compiled
with -O2, resulting in reproducible SEGV, on at least one ia64
configuration.
The compiler *is* required to reload if it sees an update to a dereferenced
char value, though, as chars are defined to alias anything; and memcpy()
is defined to operate on chars. So using memcpy() to copy the pointer
values is guaranteed to force the caller to reload. This has been
verified to fix the problem in practice.
Fixes Red Hat bug #161183.
via add_error_table() and the other dynamic methods from
the ones allocated via initialize_xxx_error_table() so
that we won't fail even for error tables created using old
versions of compile_et. Thanks to Nalin Dahyabhai for
this suggested patch.
initialize_xxx_error_table(), to prevent segfaults if an
old library calls initialize_xxx_error_table, and another
library/application calls add_error_table() on the same
error table, and then calls remove_error_table().
(Addresses Sourcefroge Bug #1150146)