OSDN Git Service
Eric Sandeen [Wed, 17 Jun 2009 02:50:53 +0000 (21:50 -0500)]
libext2fs: initialize large inodes for journal & resize
I noticed that neither the journal nor resize inodes have
i_extra_isize set post-mkfs; while this isn't likely
to be a big problem, I think the below patch tidies
it up.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Wed, 17 Jun 2009 22:49:01 +0000 (18:49 -0400)]
libext2fs: write only core inode in update_path()
The ext2_extent_handle only has a struct ext2_inode allocated on
it, and the same amount copied into it in that same function,
but in update_path() we're possibly writing out more than that -
for example 256 bytes, from that address. This causes uninitialized
memory to get written to disk, overwriting the parts of the
inode past the osd2 member (the end of the smaller structure).
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 15 Jun 2009 07:53:04 +0000 (03:53 -0400)]
dumpe2fs, tune2fs: fix miscellaneous memory leaks
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 15 Jun 2009 07:52:30 +0000 (03:52 -0400)]
debugfs: Fix miscellaneous memory leaks
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 15 Jun 2009 07:51:51 +0000 (03:51 -0400)]
resize2fs: fix miscellaneous memory leaks
Fix various memory leaks which were discovered using valgrind.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 15 Jun 2009 07:50:07 +0000 (03:50 -0400)]
e2fsck: fix miscellaneous memory leaks
Fix various miscellaneous memory leaks which were discovered using valgrind.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 15 Jun 2009 05:34:43 +0000 (01:34 -0400)]
libext2fs: Fix memory leak in the extents handling function
Each time an extent handle is opened and closed, if the inode has an
extent tree which does not fit in the inode's i_block structure, a
filesystem block buffer was not getting released. Since e2fsck opens
an extent handle for every inode using extents, this can translate to
a very large amount of memory getting lost.
Thanks to Henrik 'Mauritz' Johnson for discovering and pointing out
this leak, which he ran into while running the "rdump" command in
debugfs.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 15 Jun 2009 05:33:26 +0000 (01:33 -0400)]
tests: Add --valgrind-leakcheck option to the test_script program
Add an option which runs valgrind with the appropriate options for
finding memory leaks.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 2 Jun 2009 13:31:24 +0000 (09:31 -0400)]
badblocks: Remove 4096 blocksize limit
There is no need to prohibit the use of block sizes larger than 4k in
the badblocks program.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 2 Jun 2009 13:02:39 +0000 (09:02 -0400)]
Fix spelling mistake in the man page for chattr
Addresses-Debian-Bug: #531385
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 2 Jun 2009 12:45:22 +0000 (08:45 -0400)]
filefrag: Fix error checking for the fiemap ioctl
Thanks to Peng Tao for reporting this problem.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 30 May 2009 17:56:31 +0000 (13:56 -0400)]
Update release notes, version string, etc. for E2fsprogs 1.41.6 release
Theodore Ts'o [Sat, 30 May 2009 17:50:07 +0000 (13:50 -0400)]
Update translation file for 1.41.6 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 30 May 2009 17:46:19 +0000 (13:46 -0400)]
Update lib/xt2fs/Makefile.in using "make depend"
Theodore Ts'o [Sat, 30 May 2009 16:34:28 +0000 (12:34 -0400)]
Update man pages to include ext4 in the synposis, instead of just "ext2/ext3"
The e2fsprogs programs have historically just said that they operate
on ext2 and ext3 file system in their man pages. Update them to say
that they also operate on ext4 file systems.
Addresses-Launchpad-bug: #381854
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 30 May 2009 14:23:05 +0000 (10:23 -0400)]
debian: Update control file to remove lintian warnings
* Update debian policy standards 3.8.1
* Expand short and extended descriptions
* Remove duplicated section and priority fields in the binary packages
* Remove empty depends: header
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 30 May 2009 14:22:12 +0000 (10:22 -0400)]
debian: update e2fslibs.symbol file to add ext2fs_extent_open2@Base
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 30 May 2009 13:44:06 +0000 (09:44 -0400)]
debain: Remove unneeded lintian override
Theodore Ts'o [Sat, 30 May 2009 04:40:29 +0000 (00:40 -0400)]
Remove unused legacy .hgtags file from top-level directory
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 30 May 2009 04:15:22 +0000 (00:15 -0400)]
mke2fs.8: Fix man page to use hyphens instead of minus signs for options
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 30 May 2009 02:22:23 +0000 (22:22 -0400)]
Update config.guess and config.sub to the latest (2009-04-17) version
Addresses-Debian-Bug: #528330
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 29 May 2009 15:01:22 +0000 (11:01 -0400)]
libext2fs: Move test code for csum.c inline instead of in a separate file
Move the test code which is used to build the tst_csum progam from
tst_csum into csum.c under an #ifdef DEBUG to simplify things and to
avoid compile problems caused by not having a prototype for
ext2fs_group_desc_csum().
Addresses-Sourceforge-Bug: #
2484331
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 29 May 2009 04:09:57 +0000 (00:09 -0400)]
libext2fs: Add an explicit error code for missing mtab file
To reduce user confusion, if the /etc/mtab file is missing
ext2fs_check_mount_point and ext2fs_check_if_mounted will return a
new, explicit error code to indicate this case.
Addresses-Debian-Bug: #527859
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 29 May 2009 03:40:18 +0000 (23:40 -0400)]
e2fsck: Go back to the original superblock if the backup sb is invalid
In the case where the block group descriptors appear corrupt, e2fsck
will try to use the backup superblock. However, it could be that the
backup superblock itself is completely corrupted, in which e2fsck
should go back to the original superblock instead of refusing to fix
the file system.
Addresses-Debian-Bug: #516820
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 29 May 2009 02:03:33 +0000 (22:03 -0400)]
debugfs: Add -a option to close_filesys command
Add an -a option to the close_filesys command which writes any changes
to the superblock or block group descriptors to all of the backup
superblock locations.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 28 May 2009 21:05:40 +0000 (17:05 -0400)]
e2fsck: if i_file_acl_hi is non-zero, fix it and don't abort e2fsck -p
Ext3 filesystems don't care if i_file_acl_hi is non-zero in some
inode, and newer kernels should ignore this field (although 2.6.29 and
older kernels will not). So e2fsck should fix this without aborting
an e2fsck preen operation.
Addresses-Debian-Bug: #526524
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
number9652 [Tue, 19 May 2009 20:34:12 +0000 (13:34 -0700)]
libext2fs: add ext2fs_extent_open2
The patch below adds a function, ext2fs_extent_open2(), that behaves
as ext2fs_extent_open(), but will use the user-supplied inode
structure when opening an extent instead of reading the inode from
disk. It also changes several of the calls to extent_open() to use
this enhancement.
Signed-off-by: Nic Case <number9652@yahoo.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Ken Chen [Thu, 28 May 2009 13:55:10 +0000 (09:55 -0400)]
Add empty function for init_resource_track() and print_resource_track()
in the case of ! defined RESOURCE_TRACK, so that we can clean up #ifdef
throughout e2fsck source.
Signed-off-by: Ken Chen <kenchen@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Ken Chen [Tue, 5 May 2009 03:12:30 +0000 (20:12 -0700)]
e2fsck: add resource tracking for passes 1[b-d]
On ext2, time tracking for pass1 includes both error detection and
specific type of fs fix-up phase (e.g. block referenced by multiple
inodes). The multi-reference fix-up phase some time take significant
amount of time to complete. We would like to track time spent in sub
component of pass1 by having a finer granularity during pass1b through
pass1d phase.
Signed-off-by: Ken Chen <kenchen@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Thu, 28 May 2009 04:23:43 +0000 (23:23 -0500)]
chattr: manpage tidyups
Tidy up the chattr(1) manpage to completely document all
available options, and differentiate those which are read-only
early in the manpage as well.
* Remove "I" from settable attribute list
* add "e" to 2nd list of settable attributes & descriptions
* Note that h/E/I/X/Z are readonly
* Correct "H" to "h" for huge file attribute description
* fix long_name for indexed directory in flags_array
Addresses-Red-Hat-Bugzilla: BZ#502971
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Aneesh Kumar K.V [Tue, 6 Jan 2009 06:37:14 +0000 (12:07 +0530)]
chattr: Add extent conversion support
This patch adds new option, +e to chattr. The +e option
is used to convert the ext3 format (non extent) file
to ext4 (extent) format. This can be used to migrate
the ext3 file system to ext4 file system.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Andreas Dilger [Thu, 28 May 2009 06:47:37 +0000 (00:47 -0600)]
e2fsck: use unsigned values for memory tracking stats
Use unsigned values for printing memory tracking to avoid overflows.
The mallinfo() data is currently signed ints, but it might change in
the future so we may as well compute/print unsigned longs.
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Andreas Dilger [Thu, 28 May 2009 06:39:49 +0000 (00:39 -0600)]
e2fsck: only restart e2fsck once for inodes in uninit range
Restart e2fsck only once in case of multiple inodes in uninit range.
Display correct inode number during BG_INO_UNINIT and INOREF_IN_USED errors.
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>
Dark Raven [Tue, 26 May 2009 02:45:42 +0000 (22:45 -0400)]
po: update zh_CN.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Mon, 18 May 2009 22:11:28 +0000 (17:11 -0500)]
resize2fs: don't try to resize below calculated minimum
Without a force flag, don't allow resize2fs to even start resizing
below what it thinks the minimum safe value is.
This may stop resizes which could otherwise proceed with a bit
of space still left, but seems like a reasonably safe thing to do.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Mon, 18 May 2009 22:02:32 +0000 (17:02 -0500)]
resize2fs: fix minimum size calculations
The extra padding added to the minimum size calculations:
/*
* We need to reserve a few extra blocks if extents are
* enabled, in case we need to grow the extent tree. The more
* we shrink the file system, the more space we need.
*/
if (fs->super->s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)
blks_needed += (fs->super->s_blocks_count - blks_needed)/500;
can go quite wrong if we've already added up more "blks_needed"
than our current size, and the above subtraction wraps. This can
easily happen for a filesystem which is almost completely full.
In this case, just return the current fs size as the minimum and
be done with it.
With this fix we could probably call calculate_minimum_resize_size()
for each resize2fs invocation and refuse to resize smaller than that?
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Wed, 20 May 2009 21:36:26 +0000 (16:36 -0500)]
resize2fs: fix ENOSPC corruption case
http://people.redhat.com/esandeen/livecd-creator-imagefile.bz2
contains an image (for now) which, when resized to 578639, corrupts
the filesystem.
This is a bit crazy, I guess, because the fs currently has only
1 free block, but still, we should be graceful about the failure.
Perhaps it would make sense to check the requested valuea against
the minimum value resize2fs would compute for "-P" and fail (at
least without a force).
But in any case, this exposed 2 bugs when moving that one block
required an extent split, which is what hit the ENOSPC.
For starters, ext2fs_extent_set_bmap() in the "(re/un)mapping last
block in extent" case was replacing the old extent before the
new one was created; when the new extent creation failed, it
left us in an inconsistent state. Simply changing the order of
the two should fix this problem.
Next, ext2fs_extent_insert was calling ext2fs_extent_delete()
on *any* error, including one caused by failure to allocate a new
block to split the node to hold that extent ... the handle was left
unchanged, and we deleted the -original- extent.
As a quick fix for this, just don't do the delete if we fail the split,
though this may need to be smarter. I don't think we have terribly
consistent behavior about where a handle is left on various errors.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 26 May 2009 00:14:04 +0000 (20:14 -0400)]
e2fsck: Fix journal replay bug which reverts changes to the bg descriptors
Fix a regression in e2fsprogs 1.41.5 which would undo updates to the
block group descriptors after a journal replay, caused by commit
b7c5b403. We now use ext2fs_free() instead of ext2fs_close() to make
sure we the library will never try to write out superblock or block
group descriptors.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Andreas Dilger [Mon, 18 May 2009 03:03:04 +0000 (23:03 -0400)]
e2fsck: initialize error handling before journal replay
One of our customers hit a temporary IO error during an e2fsck run during
the read from the journal. It seems that the read error resulted in
e2fsck automatically discarding the journals and recreating them on several
filesystems on this node without any prompting from the user:
end_request: I/O error, dev sdg, sector 484832
Buffer I/O error on device sdg, logical block 60604
fsck-sdg[8276]: ls2-OST024c: Superblock has an invalid ext3 journal (inode 8).
fsck-sdg[8276]: CLEARED.
fsck-sdg[8276]: *** ext3 journal has been deleted - filesystem is now ext2
only ***
fsck-sdg[8276]: ls2-OST024c was not cleanly unmounted, check forced.
fsck-sdg[8276]: ls2-OST024c: Journal inode is not in use, but contains data.
CLEARED.
fsck-sdg[8276]: ls2-OST024c: Recreate journal to make the filesystem ext3
again?
fsck-sdg[8276]: FIXED.
fsck-sdg[8276]: Creating journal (32768 blocks): Done.
fsck-sdg[8276]:
fsck-sdg[8276]: *** journal has been re-created - filesystem is now ext3 again
***
fsck-sdg[8276]: ls2-OST024c: 39818/
20183248 files (8.2% non-contiguous),
222122257/
779902976 blocks
fsck-sdg[8276]: exit code 1 (file system errors corrected)
The following patch moves the e2fsck error handler initialization earlier
in the e2fsck startup code before the journal is processed, so that the
user will be prompted for an action. This is the first IO that is not
part of ext2fs_open() where fs->io is first initialized.
It doesn't seem possible to initialize the error handlers for the initial
filesystem open without changing the prototype for ext2fs_open2(). If we
are getting a new ext2fs_open3() prototype for 64-bit it might make sense
to add at least "read_error" as a parameter ("write_error" is not strictly
necessary for the open and could be set afterward).
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 18 May 2009 02:19:21 +0000 (22:19 -0400)]
blkid: Don't use a hard-coded path for /bin/rm in test_probe.in
Addresses-Sourceforge-Bug: #
2780205
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 17 May 2009 12:42:52 +0000 (08:42 -0400)]
e2fsck: Don't crash if an inode with a bad extent header is not cleared
If ext2fs_extent_open() fails due to a corrupt extent header, and the
user declines to clear the inode, check_blocks_extents() should bail
out; otherwise, it will cause a core dump due a null pointer
dereference.
Addresses-Sourceforge-Bug: #
2791794
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 4 May 2009 11:39:56 +0000 (07:39 -0400)]
Add missing file: lib/ext2fs/fiemap.h
This file is needed so the updated filefrag program will compile. I
missed a "git add"; oops.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Karel Zak [Mon, 27 Apr 2009 13:00:58 +0000 (15:00 +0200)]
blkid: use /sys/block/dm-<N>/dm/name
The Linux kernel (since 2.6.29, patch
784aae735d9b0bba3f8b9faef4c8b30df3bf0128)
exports the real DM device names in /sys/block/<ptname>/dm/name.
The sysfs based solution is nicer and faster than scan for devno in
/dev/mapper/.
CC: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Karel Zak [Mon, 27 Apr 2009 13:00:57 +0000 (15:00 +0200)]
blkid: use /dev/mapper/<name> rather than /dev/dm-<N>
The libblkid (since v1.41.1) returns private device-mapper names (e.g.
/dev/dm-0). It's because the probe_one() function scans /dev before
/dev/mapper.
brw-rw---- 1 root disk 253, 0 2009-04-27 13:41 /dev/dm-0
brw-rw---- 1 root disk 253, 0 2009-04-27 13:41 /dev/mapper/TestVolGroup-TestLogVolume
Old version:
# blkid -t LABEL="TEST-LABEL" -o device
/dev/dm-0
Fixed version:
# blkid -t LABEL="TEST-LABEL" -o device
/dev/mapper/TestVolGroup-TestLogVolume
Addresses-Red-Hat-Bug: #497259
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Andreas Dilger [Tue, 28 Apr 2009 18:59:07 +0000 (12:59 -0600)]
e2fsck: cleanup whitespace in problem.c and problem.h
Cleanup whitespace in the problem.h and problem.c files. Removes a
bunch of places where tabs follow spaces, whitespace on empty lines, etc.
I didn't reformat the indenting of the entire problem.h error codes,
but there is some room for doing this...
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Andreas Dilger [Mon, 27 Apr 2009 22:59:24 +0000 (16:59 -0600)]
e2fsck: Add test code in problem.c to verify problem codes
We've hit a number of cases where the error codes in problem.h have
been assigned duplicate values compared to problems in our own e2fsck
patches, and this can lead to confusing and difficult to find bugs
in e2fsck (e.g. wrong problem messages, incorrect repair action, etc).
Attached is a test case for the problem.c file to ensure that the
problem table is sorted and does not contain any duplicate values.
Having the problem table sorted allows the correctness checking to be
very simple, and if it ever became important for performance we could
use binary searching of the problem table for the specific problem code.
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kalpak Shah [Sun, 3 May 2009 01:02:29 +0000 (21:02 -0400)]
filefrag: Add support to use the FIEMAP ioctl
The FIEMAP ioctl is more efficient and doesn't require root
privileges. So if it is available, use it in preference to repeated
FIBMAP calls.
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>
Theodore Ts'o [Sun, 3 May 2009 00:59:04 +0000 (20:59 -0400)]
Avoid unneeded updates of block group descriptors in ext2fs_closefs()
If the superblock is clean, and we only need to update
s_kbytes_written, then we only need to update the superblock.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 28 Apr 2009 13:09:44 +0000 (09:09 -0400)]
e2fsck: Skip journal checks if the fs is mounted and doesn't need recovery
If we are checking a mounted filesystem (typically the root
filesystem, mounted read/only) and the NEEDS_RECOVERY flag is not set,
skip all of the checks associated with making sure the journal is
consistent. There is the very slight possibility we could lose if the
NEEDS_RECOVERY flag was somehow cleared even though there was data in
the journal, but this has practically never happend in practice, and
it reduces the number of reads required at boot-time, which is a big
deal when trying to reduce boot times with HDD's.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 25 Apr 2009 17:02:15 +0000 (13:02 -0400)]
debian: Add a build depends indicating we need a dietlibc newer than 0.30
Addresses-Debian-Bug: #506064
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 24 Apr 2009 12:32:07 +0000 (08:32 -0400)]
debian: Fix distribution name in changelog to be unstable
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 24 Apr 2009 02:44:16 +0000 (22:44 -0400)]
Update release notes, version string, etc. for E2fsprogs 1.41.5 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 24 Apr 2009 02:25:18 +0000 (22:25 -0400)]
Update translation template file for 1.41.5 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 24 Apr 2009 02:24:51 +0000 (22:24 -0400)]
Update lib/ext2fs/Makefile.in using "make depend"
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 24 Apr 2009 01:31:16 +0000 (21:31 -0400)]
e2fsck: On a 32-bit filesystem, make sure i_file_acl_high is zero
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 23 Apr 2009 05:57:51 +0000 (01:57 -0400)]
Interim commit for Debian release -- 1.41.4-3
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 23 Apr 2009 05:30:42 +0000 (01:30 -0400)]
libext2fs: read the block group descriptors more efficiently
When opening a filesystem, make ext2fs_open2() much more efficient by
reading the normal block group descriptors all at once, instead of one
block at a time.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 23 Apr 2009 05:27:07 +0000 (01:27 -0400)]
e2fsck: Reduce unnecessary I/O when checking backup superblock
E2fsck needs to check to see if the backup superblock differs from the
primary superblock. Previously it was doing so by calling
ext2fs_open(), which does a lot of unnecessary work, including reading
all of the backup block group descriptors. Avoid this by reading in
the backup superblock directly.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 23 Apr 2009 04:39:06 +0000 (00:39 -0400)]
e2fsck: Don't test the resize_inode if the filesystem is clean
Move check_resize_inode() out of check_super_block(), since we only
need to test the resize_inode for correctness only if the filesystem
requires checking. This change avoids a lot of I/O operations which
slows down a 1 second boot.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Thu, 23 Apr 2009 03:51:51 +0000 (22:51 -0500)]
blkid: remove whole-disk entries from cache when partitions are found
We can get into a situation in blkid where whole disks remain
in the cache, even though partitions are found. For labels
such as sun disklabels which may have the first partition
beginning at sector 0, this is even somewhat likely.
1) create a sun disklabel w/partitions
2) mkfs the first partition (at sector 0)
3) remove the partition table
4) run blkid - this finds the fs on the whole disk, places in cache
5) recreate the partition table
6) run blkid - this finds the partition, places in cache
And now we have both /dev/sda and /dev/sda1 in cache.
There are heuristics in probe_all to avoid putting the whole disk
in cache if it has partitions, but there is nothing to remove the
whole-disk entry in the above case. I think the below patch
suffices, although I haven't quite convinced myself that setting
the lens[which]=0; is the right logic for that bit of state...
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 23 Apr 2009 02:36:36 +0000 (22:36 -0400)]
mke2fs.8: Clarify in the man page that fs defaults come from mke2fs.conf
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 23 Apr 2009 02:20:22 +0000 (22:20 -0400)]
libext2fs: Skip relative pathnames in /etc/mtab in ismounted.c
The functions which test to see if a device is mounted can get
confused by entries in /etc/mtab for virtual filesystems:
rootfs / rootfs rw 0 0
none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
If the device name doesn't start with a slash, ignore the /etc/mtab
entry, so that relative pathnames passed into functions such as
ext2fs_check_mount_point() or ext2fs_check_if_mounted() don't return
false positives.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Apr 2009 19:13:37 +0000 (15:13 -0400)]
tune2fs: Fix format string warnings
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Apr 2009 19:12:40 +0000 (15:12 -0400)]
logsave: Fix warn_unused_result warnings from gcc
Fixed a potential bug where by partial returns from the write(2)
system call could some bytes to be lost when writing to the log file.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Apr 2009 19:10:36 +0000 (15:10 -0400)]
resize2fs: Print a warning message if the ftruncate system call fails
Resize2fs will attempt to truncate an image file of a filesystem down
to size for the convenience of the system administrator. If the
truncate operation fails, print a warning message. This also avoids a
gcc warning message.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Apr 2009 19:09:41 +0000 (15:09 -0400)]
e2fsck: Fix warn_unused_result warnings from gcc
Fixed a potential bug where by partial returns from the write(2)
system call could lost characters to be sent to external progress bar
display program.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Apr 2009 19:08:36 +0000 (15:08 -0400)]
debugfs: Fix format string warnings in htree_dump_leaf_node()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Apr 2009 19:07:00 +0000 (15:07 -0400)]
libext2fs: Fix format string type warnings in alloc_stats.c
Fix gcc warnings caused by wrong types passed com_err() in
ext2fs_inode_alloc_stats2 and in ext2fs_block_alloc_stats().
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Apr 2009 18:48:59 +0000 (14:48 -0400)]
libss: Fix warn_unused_result warnings from gcc
Fixed a potential bug where by partial returns from the write system
call could the fallback pager to drop characters.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Apr 2009 18:46:48 +0000 (14:46 -0400)]
libss: ss_execute_line: reflect any error codes from system() to the caller
This is primarily to silence a gcc warning, but it's better to reflect
the error from system() up to the caller. In this case we don't
actually use it for anything, but that's OK.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Apr 2009 18:41:32 +0000 (14:41 -0400)]
libcom_err: Declare prototypes for et_list_lock/unlock in com_err.h
Define the prototypes for et_list_lock() and et_list_unlock() in
com_err.h. This promotes better error checking and avoids warnings
when compiling the library and programs that call these functions.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Apr 2009 18:35:45 +0000 (14:35 -0400)]
libe2p: Declare prototypes for the journal feature name functions in e2p.h
Define the prototypes for e2p_jrnl_feature2string() and
e2p_jrnl_string2feature() in e2p.h. This promotes better error
checking and avoids warnings when compiling the library and programs
that call these functions.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Apr 2009 13:18:30 +0000 (09:18 -0400)]
configure.in: add --disable-libblkid option
Add an option to switch between the private (in-tree) libblkid and
public (in-system installed) library. The private version is still
enabled by default.
If --disable-libblkid is specified the findfs(8) program, which is a
variant of tune2fs, is also not built or installed.
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Apr 2009 02:18:19 +0000 (22:18 -0400)]
Explain the significance of the 'T' attribute in the chattr.1 man page
Addresses-Debian-Bug: #365619
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Apr 2009 02:09:01 +0000 (22:09 -0400)]
po: Add Chinese (simplified) translation from the Translation Project
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 20 Apr 2009 12:12:15 +0000 (08:12 -0400)]
debian: Update debhelper compat level to 7
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 20 Apr 2009 11:49:26 +0000 (07:49 -0400)]
debian: Update copyright files to point the correct common license files
This fixes the Lintian warning:
The copyright file refers to the versionless symlink in
/usr/share/common-licenses for the full text of the GPL, LGPL, or GFDL
license, but the package does not appear to allow distribution under
later versions of the license. This symlink will change with each
release of a new version of the license and may therefore point to a
different version than the package is released under. debian/copyright
should instead refers to the specific version of the license that the
package references.
For example, if the package says something like "you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; version 2 dated June, 1991,"
the debian/copyright file should refer to
/usr/share/common-licenses/GPL-2, not /GPL.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 20 Apr 2009 11:46:08 +0000 (07:46 -0400)]
debian: Put the *-dbg packages in the debug section as requested by Lintian
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 20 Apr 2009 03:06:45 +0000 (23:06 -0400)]
Interim commit for Debian release -- 1.41.4-2
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 19 Apr 2009 02:42:13 +0000 (22:42 -0400)]
resize2fs: Fix corruption bug impacting ext4 filesystems with uninit_bg
Due to a fencepost bug, when skipping a block group whose block bitmap
was uninitialized (and hence could not contain any blocks eligible for
relaocation), the block immediately following the block group wasn't
checked as well. If it was in use and required relocation, it
wouldn't get properly relocated, with the result that an inode using
such a block would end up, post resize, with a pointer to a block now
outside the bounds of the filesystem.
This commit fixes this fencepost error.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 19 Apr 2009 02:32:03 +0000 (22:32 -0400)]
resize2fs: Fix data corruption bug when shrinking the inode table for ext4
If we need to shrink the inode table, we need to make sure the inodes
contained in the part of the inode table we are vacating don't get
reused as part of the filesystem shrink operation. This wasn't a
problem with ext3 filesystems, since the inode table was located in
the block group that was going away, so that location was not eligible
for reallocation.
However with ext4 filesystems with flex_bg enabled, it's possible for
a portion of the inode table in the last flex_bg group to be
deallocated, but in a part of the filesystem which could be used as
data blocks. So we must mark those blocks as reserved to prevent
their reuse, and adjust the minimum filesystem size calculation to
assure that we don't shrink a filesystem too small for the resize
operation to succeed.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 18 Apr 2009 17:31:54 +0000 (13:31 -0400)]
resize2fs: Fix data corruption bug when growing an ext4 filesystem off-line
When allocating a new set of block group metadata as part of growing
the filesystem, the resize2fs code assumes that the bitmap and inode
table blocks are in their own block group; an assumption which is
changed by the flex_bg feature. This commit works around the problem
by temporarily turning off flex_bg while allocating the new block
group metadata, to avoid potentially overwriting previously allocated
data blocks.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 18 Apr 2009 15:39:22 +0000 (11:39 -0400)]
tune2fs: Clarify manpage regarding how to see the current settings
Addresses-Debian-Bug: #515693
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 18 Apr 2009 15:37:35 +0000 (11:37 -0400)]
debian: Add homepage field to the control file
Addresses-Debian-Bug: #506279
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 18 Apr 2009 14:53:32 +0000 (10:53 -0400)]
e2fsck, tune2fs: Fix Hurd compilation problem due to lack of PATH_MAX
Hurd doesn't define PATH_MAX, so calculate the exact size needed for
the tdb filename, and allocate it dynamically.
Addresses-Debian-Bug: #521602
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 18 Apr 2009 13:41:04 +0000 (09:41 -0400)]
debugfs: Teach the set_inode_fields_command how to set i_file_acl_high
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 18 Apr 2009 13:40:26 +0000 (09:40 -0400)]
debugfs: Print 64-bit file acl
This is necessary so we can debug filesystem corruptions caused by the
i_file_acl bogusly getting set.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 18 Apr 2009 13:14:31 +0000 (09:14 -0400)]
uuidd: Fix warn_unused_result warnings from gcc
Fixed a potential bug caused by partial returns from the write system
call (especially possible for network connections).
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 15 Apr 2009 17:05:09 +0000 (13:05 -0400)]
libuuid: Close all file descriptors before running uuidd
This avoids problems when the calling program has open file
descriptors (especially sockets) open.
Also fix up some warn_unused_result warnings from gcc.
Addresses-Launchpad-bug: #305057
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Andreas Dilger [Tue, 28 Oct 2008 20:44:21 +0000 (14:44 -0600)]
e2fsck: print unsigned RAM usage statistics
Running e2fsck against a 14.5TB filesystem with -tt it reported
-200904kB for RAM usage in pass3 instead of the correct 2300773kB.
The RAM usage statistics were being printed with %d instead of %u.
Also fix a few places using %ld for inode numbers instead of %lu.
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Sat, 22 Nov 2008 15:02:48 +0000 (09:02 -0600)]
e2fsck: ignore differing NEEDS_RECOVERY flag on backup sbs
When we resize online, the primary superblock gets copied to all
the backups, and of course since we're mounted the NEEDS_RECOVERY
flag is set. A subsequent fsck will find the backups have the
NEEDS_RECOVERY flag set while the primary does not, and this
forces a full fsck pass.
I think this flag can be safely ignored in the flag comparisons.
Addresses-Red-Hat-Bugzilla: #471925
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 31 Mar 2009 11:42:24 +0000 (07:42 -0400)]
mke2fs: Don't try to create the journal in super-only mode
Since we aren't initializing the inode table, creating the journal
will just fail.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Petr Pisar [Tue, 17 Mar 2009 02:26:52 +0000 (22:26 -0400)]
po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 17 Mar 2009 02:16:44 +0000 (22:16 -0400)]
libext2fs: external journal devices should not cause ext2fs_open2 to fail
This fixes a regression introduced in commit
79a9ab14 which caused
attempts to open external journals to fail due to overly strict
filesystem consistency checks.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Manish Katiyar [Sun, 8 Mar 2009 18:15:31 +0000 (23:45 +0530)]
debugfs: Fix typos in logdump's error messages
Below patch fixes some trivial typos found during code reading
Signed-off-by : Manish Katiyar <mkatiyar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jim Meyering [Mon, 23 Feb 2009 17:26:05 +0000 (18:26 +0100)]
libss: Avoid leak upon failed realloc in ss_add_request_table()
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jim Meyering [Mon, 23 Feb 2009 16:47:30 +0000 (17:47 +0100)]
libext2fs: don't leak strdup'd dev name in dosio.c upon error
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jim Meyering [Mon, 23 Feb 2009 17:07:50 +0000 (18:07 +0100)]
remove useless if-before-free tests
In case you're wondering about whether this change is safe from a
portability standpoint, fear not. This has been beaten to death
in other forums. Here are a few threads:
http://thread.gmane.org/gmane.comp.version-control.git/74187
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/12712
http://thread.gmane.org/gmane.emacs.devel/98144
http://thread.gmane.org/gmane.comp.lib.glibc.alpha/13092
There has been debate about whether it's a good idea from a
performance standpoint, too, but imho you'll have a hard time
finding an instance where this sort of change induces a
measurable performance penalty. If you do, please let me know.
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Thu, 29 Jan 2009 22:52:13 +0000 (17:52 -0500)]
fix libext2fs info page name
In Red Hat bug #481620 Jerry reported that the libext2fs info page
is not accesable via "info libext2fs" but is via "info libext2fs.info"
and suggested that the following change should fix it.
Additional info from Jerry:
The problem is that makeinfo 4.12 interprets the dot in "libext2fs.info"
to be the end of the description portion of the info entry, even though
it hasn't seen the closing parenthesis yet. Making the reference be to
just "libext2fs" works.
Addresses-Red-Hat-Bugzilla: #481620
Reported-by: Jerry James <loganjerry@gmail.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Thu, 29 Jan 2009 22:46:28 +0000 (17:46 -0500)]
debugfs: fix segfault on "stat" command with no open fs
This is a regression from commit
8fdf29117f922419bd5b3f741e5d554b1d5b8893, which attempts to access
current_fs via a feature check before we check that it's open.
Just moving the feature check below the open check should fix it.
Reported-by: Andrew Hecox <ahecox@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>