Also make sure the device name has no spaces in it, to avoid confusing
displays, and make ctx->filesystem_name and ctx->device_name allocated
memory to avoid potential problems in the future.
Addresses-Launchpad-Bug: #203323
Addresses-Sourceforge-Bug: #1926023
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Previously, fsck was only passing in -Cn to the first e2fsck process
to start up, and enabling the progress information by sending a
SIGUSR1 signal. This didn't work if the progress information was
intended to go to file descriptor, since the information was never
passed to e2fsck.
So we now pass the progress fd in as a negative number if the progress
information is intended to be initially suppressed.
Addresses-Launchpad-Bug: #203323
Addresses-Sourceforge-Bug: #1926023
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If a negative progress argument is given to -C, initially suppress the
progress information. It can be enabled later by sending the e2fsck
process a SIGUSR1 signal.
Addresses-Launchpad-Bug: #203323
Addresses-Sourceforge-Bug: #1926023
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The exiting fsck instance wasn't marked as DONE, so the safety checks
thought a progress bar was still in progress, and so we didn't enable
another filesystem's checking.
Addresses-Debian-Bug: #432865
Addresses-Launchpad-Bug: #203323
Addresses-Sourceforge-Bug: #1926023
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
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>
If we are redirecting the output of debugfs to a file or to another
process via a pipe, there's no point sending the output to a pager.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
No application will ever use the ORPHAN_FS flag, since it only shows
up in kernel memory, but it's been pointed out it was first used in
ext3, and so it should be renamed for accuracy.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The preinstall script checked for dpkg --asert-support-predepends,
which has been true since 1996. Also it removed configuration files
which haven't been around since well before Debian sarge, more than
two stable releases ago.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
SuSE's security team audited uuidd and came up with these issues.
None of them are serious given that uuidd runs setuid as a
unprivileged user which has no special access other than libuuid
directory, but it's good to get them fixed.
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
After the fix for resize2fs's inode mover losing in-inode
extended attributes, the regression test I wrote caught
that the attrs were still getting lost on powerpc.
Looks like the problem is that ext2fs_swap_inode_full()
isn't paying attention to whether or not the EA magic is
in hostorder, so it's not recognized (and not swapped)
on BE machines. Patch below seems to fix it.
Yay for regression tests. ;)
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
We don't fail the "make all" if the "makeinfo" command isn't there, so
we shouldn't fail the "make install", either.
Addresses-Sourceforge-Bug: #1586610
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Change the prompt so it is clear to the user that e2fsck will be
clearing the htree information, not the directory inode itself, when
the htree information has proven to be corrupt.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If a directory's i_size is bigger than the number of blocks, don't try
to allocate extra empty blocks to the end of the directory; there's no
real point to do that. Also, if a directory's i_size is not a
multiple of the blocksize, flag that as a mistake so it can be fixed.
This more elegantly addresses the problem which was found on Bas van
Schaik's filesystem.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Add two new functions which allows the caller to examine the last
directory block entry added to the list, and to drop if it necessary.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Turns out a "should never happen" error can indeed happen very easily
if a directory with an htree index has an incorrect, and too-large,
i_size field. This patch fixes this so that we handle this situation
gracefully, allowing filesystems with this error to be fixed.
In another patch I will clean up the specific problem which caused the
internal "should never happen" error from happening at all, but patch
will prevent e2fsck from crashing, and prompt the user to remove the
htree index, so it can be rebuilt again after pass 3.
Thanks to Bas van Schaik at Tetra for giving me access to his system
so this problem could be debugged.
Addresses-Launchpad-Bug: #129395
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Use ext2fs_get_next_inode_full() in resize2fs and clean up large inode
handling; previous attempt was not properly handling all cases, and
was incorrectly setting i_extra_isize. This caused some extended
attributes to get removed or randomly assigned to other inodes as a
result of the resize, which can be unfortunate on systems using
SELinux.
The previous commit didn't fix things completely on big-endian systems
like PowerPC.
Addresses-Red-Hat-Bugzilla: #434893
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
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>
Make debugfs and tune2fs reference each other in the "SEE ALSO"
section.
Addresses-Sourceforge-Patches: #1399325
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The image contains an inode past the resize point with an inline xattr
value of "propervalue". It also contains deleted inodes which had the
xattr value "oldvalue".
When resize2fs moves the inode, it should copy the xattr as well, so
that post-resize we see "propervalue" not "oldvalue".
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
inode_scan_and_fix() in resize2fs needs to do read/write of the full
inode to be sure it gets all data from larger (>128 byte) inodes.
Addresses-Red-Hat-Bugzilla: #434893
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
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>
Stop clearing the EXT2_FEATURE_RO_COMPAT_LARGE_FILE flag automatically
if there are no large files in the filesystem. It's been almost a
decade since there have been kernels that don't support this flag, and
e2fsck clears it quietly without telling the user why the filesystem
has been changed.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>