OSDN Git Service
Jose R. Santos [Mon, 1 Jun 2009 20:15:40 +0000 (16:15 -0400)]
Add 64-bit ext_attr interface
Add ext2fs_read_ext_attr2(), ext2fs_write_ext_attr2() and
ext2fs_adjust_ea_refcount2() that take blk64_t as an input.
Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Jose R. Santos [Mon, 1 Jun 2009 20:15:40 +0000 (16:15 -0400)]
Add 64-bit alloc interface
Add new ext2fs_new_block2(), ext2fs_get_free_blocks2() and
ext2fs_alloc_block2() that take and return blk64_t.
Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Jose R. Santos [Mon, 1 Jun 2009 20:15:40 +0000 (16:15 -0400)]
Add 64-bit alloc_stats interface
Add new ext2fs_block_alloc_stats2() routine that takes blk64_t as an
input.
Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Jose R. Santos [Mon, 1 Jun 2009 20:15:40 +0000 (16:15 -0400)]
Add 64-bit dirblock interface
Add new ext2fs_(read|write)_dir_block3() routines that take blk64_t as
an input.
Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Jose R. Santos [Mon, 1 Jun 2009 20:15:40 +0000 (16:15 -0400)]
Use blk64_t for blocks in struct ext2_file
The ext2_file structure is never exposed through the libext2fs API so
it is safe to use 64-bit blocks for blockno and physclock without
breaking the ABI.
Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Jose R. Santos [Sat, 6 Jun 2009 19:22:43 +0000 (15:22 -0400)]
Add new blk64_t handling functions
Add new blknum.c file which contains funtions to handle blk64_t and
low/high values in super blocks and inodes.
(Includes fixes from Nick Dokos, and additions from Valerie Aurora Henson)
Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Jose R. Santos [Mon, 1 Jun 2009 20:15:40 +0000 (16:15 -0400)]
libext2fs: Add ext2_off64_t type
The ext2_off_t type is u32. Create a new 64-bit ext2_off64_t for
64bit offsets.
Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 12 Jul 2009 04:53:57 +0000 (00:53 -0400)]
libext2fs: Add 64-bit support to the undo manager
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Valerie Aurora Henson [Sat, 6 Jun 2009 19:08:44 +0000 (15:08 -0400)]
libext2fs: Define bg_itable_unused_hi in the ext4_group_desc structure
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 11 Jul 2009 22:30:58 +0000 (18:30 -0400)]
Merge branch 'maint' into next
Theodore Ts'o [Sat, 11 Jul 2009 22:29:56 +0000 (18:29 -0400)]
Update release notes, version string, etc. for E2fsprogs 1.41.8 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 11 Jul 2009 21:41:07 +0000 (17:41 -0400)]
Remove tst_csum.c from lib/ext2fs/Makefile.in's SRCS list
The tst_csum test is now part of csum.c, so there isn't a separate
tst_csum.c file that should be listed as one of the source files in
lib/ext2fs.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 11 Jul 2009 21:22:16 +0000 (17:22 -0400)]
debian: Update standards version to 3.8.2
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 11 Jul 2009 20:22:51 +0000 (16:22 -0400)]
Update the sample e2fsprogs.spec.in RPM spec file to mention ext3/ext4
Update the description to indicate the e2fsprogs packages are also
used for ext3 and ext4 filesystems.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 11 Jul 2009 20:05:39 +0000 (16:05 -0400)]
debian: Update package descriptions to mention ext3/ext4 filesystems
E2fsprogs is used for ext2, ext3, and ext4 filesystems. Update the
package descriptions accordingly:
Addresses-Debian-Bug: #535530
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Kazuya Mio [Fri, 10 Jul 2009 07:45:16 +0000 (16:45 +0900)]
e4defrag: Fix compile warnings
When compile e2fsprogs git tree with gcc-wall option, we get some warnings about
e4defrag. This patch fixes them.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Arif E. Nugroho [Sat, 11 Jul 2009 18:36:16 +0000 (14:36 -0400)]
po: update id.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 10 Jul 2009 17:14:00 +0000 (13:14 -0400)]
resize2fs: If resize2fs fails, tell the user to run e2fsck
If the resize operation fails in the middle of the operation, mark the
filesystem as needing to be checked, and tell the user that they
should run e2fsck -fy on the device.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 10 Jul 2009 04:19:28 +0000 (00:19 -0400)]
libext2fs: Make ext2fs_extent_set_bmap() more robust against ENOSPC
In the case where we ext2fs_extent_set_bmap() is replacing the block
mapping at the beginning of an already-existing extent, insert a new
extent if necessary before shrinking an existing extent, to avoid data
loss if the disk is full.
This mostly addresses the problem described in Red Hat Bugzilla's
statistics are still wrong, but at least the files on the filesystem
are not corrupted. If there is a failure during the
inode_scan_and_fix pass, the simplest thing to do may be to tell the
user to run e2fsck -fy.
Addresses-Red-Hat-Bug: #510379
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 9 Jul 2009 19:03:39 +0000 (15:03 -0400)]
e4defrag: Fix a core dump when trying to defrag a file with no blocks
Signed-off-by Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 9 Jul 2009 18:29:12 +0000 (14:29 -0400)]
Add e4defrag to the misc directory
To make it easier to maintain changes and fixes to the e4defrag
program, check it into the e2fsprogs source tree.
Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: Takashi Sato <t-sato@yk.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Kazuya Mio [Thu, 9 Jul 2009 17:46:59 +0000 (13:46 -0400)]
e2fsck: Speed up pass 5 processing for ext4 filesystems
e2fsck_pass5() checks whether the inode and block allocation bitmaps
are consistent. However, if EXT2_BG_[INODE/BLOCK]_BITMAP is set to a
ext4's block group, most of its bitmap is uninitialized (0). In that
case, we can optimize e2fsck's pass 5 by checking the entire range of
an uninitalized block group instead of checking bit by bit.
This can speed up e2fsck pass 5 by up to 80%:
+-----+--------------------+--------------------+
| | old e2fsck | new e2fsck |
|Pass | time(s) | time(s) |
| | real | user |system| real | user |system|
+-----+------+------+------+------+------+------+
| 1 | 5.70| 3.29| 0.50| 5.66| 3.21| 0.54|
| 2 | 3.33| 0.80| 0.19| 3.40| 0.82| 0.23|
| 3 | 0.01| 0.00| 0.00| 0.01| 0.00| 0.00|
| 4 | 1.04| 1.04| 0.00| 1.05| 1.04| 0.00|
| 5 | 19.60| 17.27| 0.06| 3.53| 1.21| 0.05|
+-----+------+------+------+------+------+------+
|Total| 29.94| 22.57| 0.80| 13.90| 6.47| 0.86|
+-----+------+------+------+------+------+------+
Comparison of e2fsck time on an ext4 500GB partition (20% blocks used)
Machine environment:
CPU: Intel(R) Xeon(TM) CPU 3.00GHz
Memory: 1GB
Kernel: linux-2.6.29-git2
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 9 Jul 2009 18:32:52 +0000 (14:32 -0400)]
libext2fs: Add new function ext2fs_test_inode_bitmap_range()
Optimize ext2fs_test_block_bitmap_range() and add a new function,
ext2fs_test_inode_bitmap_range(), which works the same way as
ext2fs_block_bitmap_range() but for inode bitmaps. It's needed for
some code in the development branch, so let's drop it into the maint
branch to make life easier in the future.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 9 Jul 2009 12:09:58 +0000 (08:09 -0400)]
Interim in-progress update of the release notes and debian/changelog
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Göran Uddeborg [Thu, 9 Jul 2009 12:05:12 +0000 (08:05 -0400)]
po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Tue, 7 Jul 2009 19:30:32 +0000 (14:30 -0500)]
libext2fs: reset handle after inserting new extent
Commit 53422e moved the new extent insertion in
ext2fs_extent_set_bmap() prior to the modification of the original
extent, but the insert function left the handle pointing to the new
extent. This left us modifying the -new- extent, instead of the
original one, and winding up with a corrupt extent tree something
like:
BLOCKS:
(0-1):588791-588792, (0):588791
We need to move back to the previous extent prior
to modification, if we inserted a new one.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kazuya Mio [Mon, 6 Jul 2009 08:16:32 +0000 (17:16 +0900)]
e2fsck: remove unused variable in check_block_bitmap()
check_block_bitmap() calculates the block number of superblock in the current
block group but it's not used.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kazuya Mio [Mon, 6 Jul 2009 08:15:24 +0000 (17:15 +0900)]
e2fsck: optimize loop counter when fixing bitmap padding
If unused range of the bitmap has an unmarked bit, check_[inode/block]_end()
marks all bits in the range. However, we know that the checked bits are marked.
So this patch fixes loop counter to mark from the unmarked bit.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kazuya Mio [Mon, 6 Jul 2009 08:14:13 +0000 (17:14 +0900)]
e2fsck: remove unnecessary continue statement
Remove the continue statement because it calls at the end of the loop.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 2 Jul 2009 22:19:10 +0000 (18:19 -0400)]
Enhance build system so that "make V=1" works like the Linux Kernel
If gmake is available, the developer can use "make V=1" instead of
using a configure-time switch, --enable-verbose-makecmds, to see all
of the commands executed by the Makefile.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 2 Jul 2009 17:54:22 +0000 (13:54 -0400)]
resize2fs: Fix error message so the mountpoint is printed correctly
The resize2fs program was freeing the mountpoint information too
early, so garbage was getting printed instead of the correct
information in an error message.
Addresses-Debian-Bug: #535452
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 2 Jul 2009 15:39:23 +0000 (11:39 -0400)]
Add e2croncheck script to the contrib directory
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Samuel Thibault [Thu, 2 Jul 2009 15:04:52 +0000 (11:04 -0400)]
po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Petr Pisar [Thu, 2 Jul 2009 15:04:51 +0000 (11:04 -0400)]
po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Peng Tao [Thu, 2 Jul 2009 04:24:15 +0000 (00:24 -0400)]
filefrag: fix fm_start in filefrag_fiemap loop
When used with -v and the targeted file has more than 144
extents(double of the length of fm_extents array provided by buf),
filefrag_fiemap loops and calls fiemap ioctl() multiple times to
calculate the actual number of extents in a file. Each call to fiemap
ioctl() uses fm_start as the starting logical offset. The patch fixes
fm_start in each loop( except for the first one) and makes the extent
calculation correct for files with more that 144 extents.
To produce the problem, first run filefrag -v on a highly fragmented
file. Then change the buf size in filefrag_fiemap to make it large
enough to have all the extent mapped in a single loop and run filefrag
-v after recompiling. The former will produce a much smaller extent
count because of the false fm_start used in the loop. And the two will
produce different extent output since the 145th extent.
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Peng Tao [Fri, 5 Jun 2009 10:13:28 +0000 (18:13 +0800)]
remove bogus "-e" option from filefrag manpage
filefrag doesn't support "-e" option, so clean it up in the manpage.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 2 Jul 2009 04:11:17 +0000 (00:11 -0400)]
Add support for configure --enable-verbose-makecmds
Some people don't want to see the concise "kernel-style" make output.
This configure option allows build engines that want to see the full
set of commands executed by the makefile to get what they want. Most
people will find this more distracting than useful, unless they need
to debug the Makefiles.
(It is not necessary to rerun configure to enable this verbose make
output temprarily; if a developer wants to do a quick debug of a
directory's makefile, he or she can simply edit the definition of the
$(E) and $(Q) variables in the Makefile; instructions can be found in
the MCONFIG file which is included in at the beginning of every
Makefile.)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 2 Jul 2009 02:06:51 +0000 (22:06 -0400)]
Fix Makefile dependencies for libcom_err
The e2fsprogs makefiles were using the same Makefile variable
LIBCOM_ERR for the link-line arguments as well as the dependencies.
Since LIBCOM_ERR can now include non-file arguments such as
"-lpthread", we need to use a separate DEPLIBCOM_ERR variable that
only has build file dependencies.
Do the same thing for STATIC_LIBCOM_ERR and PROFILED_LIBCOM_ERR.
Addresses-Sourceforge-Patches: #
2813809
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Jakub Bogusz [Thu, 2 Jul 2009 01:32:26 +0000 (21:32 -0400)]
po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 1 Jul 2009 21:20:24 +0000 (17:20 -0400)]
Fix compilation problem when building with --disable-uuid
The MCONFIG.in file used $(LIBUUID) in the definition of DEPLIBBLKID,
when it should have used $(DEPLIBUUID) instead.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 1 Jul 2009 15:02:08 +0000 (11:02 -0400)]
Update Czech translation of e2fsprogs
Theodore Ts'o [Wed, 1 Jul 2009 02:36:28 +0000 (22:36 -0400)]
libuuid: Don't run uuidd if it would fail due to permission problems
Some distributions don't like installing uuidd setuid or setgid. So
if the setuid or setigid bit is not set with uuidd, and the current
process does not have write access to the UUIDD work directory, don't
try running uuidd, since it won't work properly.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 1 Jul 2009 01:34:08 +0000 (21:34 -0400)]
Do not build and install uuidgen from if the uuid library was disabled.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 30 Jun 2009 00:03:20 +0000 (20:03 -0400)]
libuuid, uuidd: Avoid infinite loop while reading from the socket fd
If for some reason the uuidd daemon or the process calling uuidd
exited unexpectely, the read_all() function would end up looping
forever, either in uuidd or in libuuid. Fix this terminating the loop
if no data can be read after five tries to read from the file
descriptor.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 29 Jun 2009 23:32:50 +0000 (19:32 -0400)]
uuidd: Avoid closing the server socket when calling create_daemon()
In the event that file descriptors 0-2 are closed when uuidd is
started, the server socket could be created as a file descriptor that
will get closed when create_daemon() tries detaching the uuidd daemon
from its controlling tty. Avoid this case by using dup(2).
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 29 Jun 2009 23:06:45 +0000 (19:06 -0400)]
libuuid: Make sure fd's 0, 1, and 2 are valid before exec'ing uuidd
When closing all of the file descriptors before starting uuidd, make
sure file descriptors 0, 1, and 2 are reserved by opening /dev/null.
This prevents strange bugs caused by assumptions regarding file
descriptors <= 2 as being special.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 29 Jun 2009 16:56:04 +0000 (12:56 -0400)]
Update release notes, version string, etc. for E2fsprogs 1.41.7 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 29 Jun 2009 19:08:12 +0000 (15:08 -0400)]
Update Czech and Chinese translations from the Translation Project.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 29 Jun 2009 18:58:07 +0000 (14:58 -0400)]
logsave: Don't send the ^A and ^B delimiters to the console
Some terminal programs may print wierd characters when they see the
\001 or \002 characters. So filter them out if the -s option
(skip_mode) is enabled.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 29 Jun 2009 05:30:30 +0000 (01:30 -0400)]
Update e2fsprogs.pot file for 1.41.7 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Nic Case [Mon, 29 Jun 2009 05:24:40 +0000 (01:24 -0400)]
libext2fs: ensure validate_entry doesn't read beyond blocksize
ext2fs_validate_entry would read beyond the end of the block to get
dirent->rec_len for certain arguments (like if blocksize ==
final_offset). This patch adds a check so that doesn't happen, and
changes the types of the arguments to avoid a compiler warning.
Signed-off-by: Nic Case <number9652@yahoo.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Fri, 26 Jun 2009 18:57:39 +0000 (13:57 -0500)]
debugfs: don't try to fclose NULL
do_logdump may jump to errout if fopen(out_file) fails,
but in that case out_file is NULL, and fclose will segfault.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 29 Jun 2009 05:04:02 +0000 (01:04 -0400)]
badblocks: Make sure the list of bad blocks found is flushed on interrupt
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 29 Jun 2009 05:03:27 +0000 (01:03 -0400)]
badblocks.8: Alphabetize options in badblocks man page
... to make it easier to find a specific option in the man page.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 29 Jun 2009 04:59:35 +0000 (00:59 -0400)]
badblocks.8: Update description of the -s option in badblocks man page
Addresses-Debian-Bug: #523063
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 29 Jun 2009 04:52:27 +0000 (00:52 -0400)]
badblocks: Print the currently tested block number when interrupted with ^C
This can be useful for the user who wishes to restart the badblocks
program after interrupting it.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Scott James Remnant [Thu, 14 May 2009 12:03:25 +0000 (13:03 +0100)]
configure.in: add --disable-libuuid option
Add an option to switch between the private (in-tree) libuuid and
public (in-system installed) library. The private version is still
enabled by default.
Signed-off-by: Scott James Remnant <scott@netsplit.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Thu, 18 Jun 2009 22:51:07 +0000 (17:51 -0500)]
lsattr: exit with a non-zero status on errors
lsattr doesn't return an error if you point it at a file that
doesn't exist.
This is slightly trickier because it can take more than one
file as an arg, but ls seems to report an error if any occurred,
so this does the same, it'll report the last error that was
encountered.
Addresses-RedHat-Bugzilla: #489841
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 22 Jun 2009 01:07:38 +0000 (21:07 -0400)]
Fix encoding for rec_len in directories for >= 64k blocksize file systems
Previously e2fsprogs interpreted 0 for a rec_len of 65536 (which could
occur if the directory block is completely empty in 64k blocksize
filesystems), while the kernel interpreted 65535 to mean 65536. The
kernel will accept both to mean 65536, and encodes 65535 to be 65536.
This commit changes e2fsprogs to match.
We add the encoding agreed upon for 128k and 256k filesystems, but we
don't enable support for these larger block sizes, since they haven't
been fully tested.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Thu, 18 Jun 2009 01:55:39 +0000 (20:55 -0500)]
resize2fs: update sb journal backup if journal was moved
This was reported in Fedora, since the livecd creator does
a lot of resizing.
If we've moved the journal blocks during resize (more likely now,
due to the journal being in the middle) the backup blocks in the
superblock don't get updated, and a subsequent e2fsck will find
issues:
e2fsck 1.41.6 (30-May-2009)
Backing up journal inode block information.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/mnt/test/img: ***** FILE SYSTEM WAS MODIFIED *****
/mnt/test/img: 11/16000 files (0.0% non-contiguous), 17789/38400 blocks
This can be shown in a simple test:
# dd if=/dev/zero of=img bs=1 count=0 seek=3000M
# mke2fs -t ext4 -F img
# resize2fs img 150M
# e2fsck -f img
(thanks to the Fedora reporter Mads Kiilerich for the testcase!
https://bugzilla.redhat.com/show_bug.cgi?id=506105#c2)
So, update the backup journal in the superblock before resize2fs exits.
Addresses-RedHat-Bugzilla: #505339
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
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>