Commit Graph

3202 Commits (3346084beaa450528dcb7180068f7b2366c800c5)

Author SHA1 Message Date
Valerie Aurora Henson 3346084bea resize2fs: Move everything to new bitmap interface
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22 21:13:37 -04:00
Valerie Aurora Henson 3c041a514c Convert tune2fs, dumpe2fs, and e2image to the new bitmap interface
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22 21:15:30 -04:00
Valerie Aurora Henson 6d879a999b debugfs: Move everything to new bitmap interface
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22 20:22:42 -04:00
Valerie Aurora Henson c5d2f50dee e2fsck: Convert e2fsck to new bitmap interface
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22 22:29:02 -04:00
Valerie Aurora Henson 463e732777 Convert mke2fs to new bitmap interface
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-05 00:17:56 -04:00
Valerie Aurora Henson 8f82ef9860 Convert libext2fs to 64-bit bitmap interface
(Includes fixes from Nick Dokos)

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>
2009-08-05 00:27:10 -04:00
Theodore Ts'o 69365c689b Add support for 64-bit bitmaps
Initial design was done by Theodore Ts'o; implementation was fleshed
out by Valerie Aurora Henson.  Also includes some fixes from Nick Dokos.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
2009-08-22 13:27:40 -04:00
Valerie Aurora Henson bee24f364c e2fsck: Allow cancellation during group descriptor checks.
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-04 22:48:15 -04:00
Theodore Ts'o 1d72214658 Merge branch 'maint' into next 2009-08-22 13:18:29 -04:00
Theodore Ts'o 88fca201ac Move declaration of FS_IOC_FIEMAP ioctl to fiemap.h
This helps e4defrag compile on systems where the system header files
don't yet define FS_IOC_FIEMAP.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22 13:16:14 -04:00
Aneesh Kumar K.V 154a5d7537 tune2fs: handle bad blocks when resizing inodes
When increasing inode size if we find that the new block
that we needed to increase the inode table size is a bad
block we fail. This make sure we don't end up with a corrupt
file system when doing inode resize on a file system having
bad blocks.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-20 13:13:20 -04:00
Aneesh Kumar K.V 91fac97938 tune2fs: Handle fs meta-data blocks during inode resize
With file system formated for RAID arrays we can have inode bitmap
and block bitmap after inode table. Make sure we move them around
properly when doing inode resize.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-20 13:12:49 -04:00
Aneesh Kumar K.V a9e5177be9 tune2fs: Make e2fsprogs handle ENOSPC better with inode resize
This removes the metadata block bitmap and makes the error handling
simpler. It also check for the enospc with the correct number needed
blocks. Also added specific error messages. We need to run e2undo
only if we start modiyfing inode, group desc and inode table.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-20 13:12:49 -04:00
Theodore Ts'o edc9e25634 f_illitable_flexbg: Add new test
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-19 01:16:47 -04:00
Theodore Ts'o 6013915487 e2fsck: Add a global latch question for bad group descriptor checksums
Very often all the block group descriptors will have bad checksums, so
don't force the user answer 'yes' many, many times.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-19 01:06:50 -04:00
Theodore Ts'o 9a7fe4bdc9 e2fsck: Only ask to relocate a block group's inode table once
If multiple blocks of a block group's inode table overlaps with other
file system blocks, only ask once for each block group.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-18 23:14:03 -04:00
Theodore Ts'o 617446e4aa e2fsck: Teach new_table_block() to allocate new itables/bitmaps with FLEX_BG
If the filesystem feature FLEX_BG is enabled, the inode table and
bitmap blocks can be located anywhere in the inode table.  So for
FLEX_BG filesystems, new_table_block() now tries allocate in the block
group's flex_bg first, and if there is no space in the local flex_bg,
then try to allocate from the whole filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-18 23:06:30 -04:00
Eric Sandeen 334cfccbca filefrag: don't print extent header on bmap fallback
The extent list header gets printed before we fall back to bmap:

# filefrag -v /mnt/test/bar
Filesystem type is: 58465342
File size of /mnt/test/bar is 12288 (3 blocks, blocksize 4096)
 ext logical physical expected length flags <---- HERE
Discontinuity: Block 2 is at 17 (was 16)
/mnt/test/bar: 2 extents found

so delay printing it until we know fiemap is working.

(though ideally it'd be nice to have the same verbose output
regardless of the interface we used, I think).

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-15 23:52:27 -04:00
Eric Sandeen 1f3d16deaa filefrag: fix frag count in bmap case
The fragmentation count in the bmap case seems to be
off by one:

/mnt/test/bar: 0 extents found

Addresses-Debian-Bug: #540376

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-15 23:52:00 -04:00
Theodore Ts'o 5d5e01d7e0 filefrag: Add option to force use of the FIBMAP ioctl
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-15 23:15:44 -04:00
Theodore Ts'o f4240c8d56 libext2fs: Treat uninitialized parts of bitmaps as unallocated
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 23:22:32 -04:00
Theodore Ts'o 0d990d0af7 Add V=1 support when linking e2freefrag in misc/Makefile.in
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 23:22:32 -04:00
Theodore Ts'o 1e48a456b6 e2freefrag: Take into account the last free extent in the file system
Fix a bug in e2freefrag where if the last free extent is at the very
end of the filesystem, it would be disregarded.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 23:22:24 -04:00
Theodore Ts'o 3e343b8d9a e2freefrag: Fix to work correctly for file systems with 1kb block sizes
If the file system has a non-zero s_first_data_block, as is the case
when the block size is 1kb, e2freefrag would incorrectly try to
reference invalid data blocks in the block allocation bitmap.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 23:21:23 -04:00
Theodore Ts'o cba91c4b52 e2freefrag: Do not print chunk-related information by default
Only print information related to chunk sizes if a chunksize is
printed.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 23:21:23 -04:00
Theodore Ts'o aff2cf8ed2 e2freefrag: Clarify e2freefrag's messages
"Free chunks" is confusing since it has nothing to do with the
chunksize; use "free extents" instead.

Also add a missing newline in an error message.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 23:21:17 -04:00
Theodore Ts'o 137a7dc05c e2freefrag: Initialize the ext2 error table
... so error messages are printed correctly

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 19:15:45 -04:00
Theodore Ts'o fe26a55ac9 e2fsck: Fix and enhance superblock dates in future problem reports
Fixed a bug where e2fsck would report that last mount time was in the
future when it was really the last write time that was in the future.

Also, since people can't seem to believe that (a) their distribution
has buggy init scripts, or (b) their CMOS/RTC clock or backup battery
is dead, print the incorrect time and the current system time.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-08 10:14:48 -04:00
Theodore Ts'o baa8dbeb4e Merge branch 'maint' into next
Conflicts:
	misc/Makefile.in
2009-08-01 20:43:00 -04:00
Gran Uddeborg bf3941aac3 po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-29 19:22:06 -04:00
Samuel Thibault bc46edf074 po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-28 12:23:22 -04:00
Jakub Bogusz c1695ebc32 po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-28 11:44:42 -04:00
Petr Pisar 39c7d13dc4 po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-28 11:44:42 -04:00
Eric Sandeen 4f1d0e8608 e4defrag: remove a lot of cruft
e4defrag.c had a lot of stuff copied into it from other
places, redefinitions of existing interfaces, etc.

We should be able to remove most of this, as the tool only
works on recent kernels anyway, we should just pick up
definitions from recent kernel headers whenever possible.

I've left the local definitions of fallocate, fadvise
(changed to posix_fadvise) and sync_file_range, and
wrapped them in #ifdef configure-time tests - though
really it seems like only fallocate should be necessary
by now, and perhaps the others can be dropped.

We still need some Makefile work so that it won't try to
build e4defrag if the right pieces aren't there (and
if the local definitions won't work...)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-27 10:53:46 -04:00
Theodore Ts'o 187cb623dc debugfs: Add the new command dump_extents and extent the stat command
Extend the stat command to display more detailed extent information if
the file uses extent mapping instead of displaying the block map using
the block_iterate funtion.

Add the command dump_extents which displays even more detailed
information about an inode's extent tree.

This commit is an extension of a patch from Curt Wohlgemuth.

Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-27 10:37:20 -04:00
Andreas Dilger ad751f11ec e2freefrag: Improve output to include be more like xfs_db's freesp -s
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-24 18:33:46 -04:00
Gran Uddeborg f668c2cfe8 po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-24 10:28:43 -04:00
Theodore Ts'o 0b2681f45b e2freefrag: New program which displays how fragmented the free space is
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-22 03:40:58 -04:00
Theodore Ts'o 1451c20109 libext2fs: Use blk_t instead of int in ext2fs_allocate_group_table
We are using a signed int to store a block number in
ext2fs_allocate_group_table.  We don't actually do any computation or
comparisons using it, so it shouldn't cause any bugs, but it's
technically incorrect, and it's possible an overly clever compiler
might do something wrong with it.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-22 02:38:16 -04:00
Theodore Ts'o 776a374a57 Update debian changelog and RELEASE-NOTES for interim release 2009-07-20 09:43:50 -04:00
Theodore Ts'o 8b5ed492de libext2fs: Avoid creating unneeded new extents in ext2fs_extent_set_bmap()
Avoiding inserting a new extent if it is possible to merge the new
block to the beginning or the end of the previous or next extent.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-19 23:37:44 -04:00
Theodore Ts'o 64cb68b3ea libext2fs: Improve debugging printf's in extent.c
Comment out less common debugging printf's, and fix some type
warnings.  Add high-level debugging printf's for ext2fs_extent_goto(),
ext2fs_extent_insert(), ext2fs_extent_delete(), ext2fs_extent_replace()

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-19 23:32:09 -04:00
Theodore Ts'o 16e470e650 libext2fs: Fix regression in ext2fs_extent_set_bmap()
Commit 0dc291611 introduced a regression when unmapping the first
block in an extent.  This caused e2fsck -fD to corrupt large
directories if the directory has to shrink by more than one block.
The problem was set_bmap should only go to a next leaf when setting a
first block in an extent, and not when it is unmapping the first block
in an extent.

Addresses-Debian-Bug: #537510

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-19 22:43:33 -04:00
Theodore Ts'o 95f65c3d70 debian: Allow building with util-linux-ng
If building with util-linux-ng, we will use the external libblkid and
libuuid, as well as disabling the internal fsck.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-19 07:15:43 -04:00
Theodore Ts'o d0c537748d mke2fs: Add strings.h include for strcasecmp() declaration
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-18 18:41:51 -04:00
Scott James Remnant 1e69a24005 debian/control: fix incorrect use of apostrophe's
Signed-off-by: Scott James Remnant <scott@ubuntu.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-18 18:21:56 -04:00
Matthias Andree bb3875e106 Fix release date, to silence configure complaints
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-18 18:21:56 -04:00
Matthias Andree 98a5ad6147 Fix intl/ build: add E/Q/V macros, process intl/libgnuintl.h
These were found necessary to build on FreeBSD 6.4.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-18 18:21:46 -04:00
Theodore Ts'o 9922c53a4d libext2fs: fix memory leak in error path in ext2fs_block_iterate2()
Reported-by: Nic Case <number9652@yahoo.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-18 10:02:41 -04:00
Eric Sandeen bbbb81c1d9 filefrag: fix it so it works in the bmap fallback case.
It looks like some debugging crept in?

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-18 09:56:10 -04:00