Commit Graph

2654 Commits (365857912e27914afa8857af5adf74ee19ca9e03)

Author SHA1 Message Date
Theodore Ts'o 365857912e Add "#include <limits.h>" to get PATH_MAX for mke2fs and tune2fs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 22:07:50 -04:00
Theodore Ts'o 97cf43f8aa Merge branch 'maint' 2008-06-07 22:07:25 -04:00
Theodore Ts'o 9d99416ea3 Fix dependency for $(LIBSS) when an explicit dlopen() library is needed
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 21:53:35 -04:00
Theodore Ts'o 2a6b60488f fsck: Fix build problem on MacOS X
Addresses-Sourceforge-Bug: #1972473

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 21:32:07 -04:00
Theodore Ts'o 5c4f8d6748 resize2fs: Add support to use the ext4 online resize ioctl's
First try the ext3 ioctl, but if we get an error, try using the ext4
ioctl.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 13:13:16 -04:00
Theodore Ts'o 68eb092dda e2fsck: Add better explanatory message when s_lastcheck is in the future
Addresses-Debian-Bug: #446005

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 12:19:08 -04:00
Theodore Ts'o dabfa68f81 Update Makefile dependencies for lib/ext2fs 2008-06-07 11:56:23 -04:00
Theodore Ts'o 8895f43a60 Fix gcc -Wall warnings in libext2fs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 11:53:56 -04:00
Theodore Ts'o 96f4bb1fbc Fix gcc -Wall warnings in libuuid
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 11:53:20 -04:00
Theodore Ts'o 2c25f7e75a Fix gcc -Wall warnings in resize2fs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 11:52:33 -04:00
Theodore Ts'o 721b367abf Fix gcc -Wall warnings in tune2fs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 11:51:33 -04:00
Theodore Ts'o 2acad6b489 Fix gcc -Wall warnings in e2fsck
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 11:04:10 -04:00
Theodore Ts'o dc9345a0bd Merge branch 'maint'
Conflicts:

	configure
2008-06-07 10:08:48 -04:00
Theodore Ts'o 488c75a6a6 Fix ext2fs_swap{16,32,64} for external applications on big-endian machines
The public header files depend on the the autoconf defines
WORDS_BIGENDIAN and HAVE_SYS_TYPES_H, so we add them to ext2_types.h
so that external programs which try to use ext2fs_swap*() will work
correctly on big-endian systems.  Fortunately, few if any programs
need to use this libext2's byte-swap functions directly.

Addresses-Debian-Bug: #484879

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 08:55:21 -04:00
Theodore Ts'o 185c4aeaf2 e2fsck: Add support to check journal checksums
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-06 23:38:38 -04:00
Theodore Ts'o 51d12cebb6 Add CRC32 (big-endian) routine for use by journal checksums
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-06 23:38:38 -04:00
Theodore Ts'o 69fbde418b Re-enable byte-swapping functions for use by journal checksums
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-06 23:38:38 -04:00
Aneesh Kumar K.V 2ea504bd64 libext2fs: Fix build failure on powerpc in ext2fs_swap_inode_full()
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-06 23:33:28 -04:00
Theodore Ts'o 8aa53bfa69 Merge branch 'maint' into next 2008-06-02 21:40:02 -04:00
Theodore Ts'o 9aa109c95d debian: Improve uuid-runtime package description
Addresses-Debian-Bug: #483962

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-02 21:37:06 -04:00
Theodore Ts'o 9598165565 debian: Improve e2fsprogs package description
Addresses-Debian-Bug: #483023
2008-06-02 21:20:34 -04:00
Benno Schulenberg 0acb53e2fc po: update es.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-02 21:13:36 -04:00
Ricardo M. Correia c9bad3ce1a Add ZFS detection to libblkid
This patch adds ZFS filesystem detection to libblkid.

It probes for VDEV_BOOT_MAGIC in the first 2 ZFS labels in big-endian
and little-endian formats.
Unfortunately the probe table doesn't support probing from the end of
the device, otherwise we could also probe in the 3rd and 4th labels (in
case the first 2 labels were accidentally overwritten)..

Eventually we would set the UUID from the ZFS pool GUID and the LABEL tag
from the pool name, but that requires parsing an XDR encoding of the pool
configuration which is not trivial.

Signed-off-by: Ricardo M. Correia <Ricardo.M.Correia@Sun.COM>
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-02 21:09:08 -04:00
Theodore Ts'o dfb1d42a56 f_extents2: Add new test case testing e2fsck's support for extents
This test case tests blocks claimed by multiple inodes, as well as
other forms of invalid extents.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-02 20:36:52 -04:00
Theodore Ts'o d5a8f9a9f2 e2fsck: Detect unordered extents in an extent node
The logical block numbers must be monotonically increasing, and there
must not be any overlapping extents.  If any are found, report them as
filesystem corruption.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-02 20:33:30 -04:00
Theodore Ts'o 16bd349e1f e2fsck: Wire up callback functions for _alloc_block() and _block_alloc_stats()
Wire up callback functions for ext2fs_alloc_block() and
ext2fs_block_alloc_stats() so that we use the ctx->block_found_map
block bitmap to determine which new block we should allocate, and then
to update the block_found_map bitmap if the extent functions need to
allocate or release blocks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-02 18:52:12 -04:00
Theodore Ts'o f5c562e232 libext2fs: Add callback functions for _alloc_block() and _block_alloc_stats()
Add callback functions for ext2fs_alloc_block() and
ext2fs_block_alloc_stats().  This is needed so e2fsck can be informed
when the extent_set_bmap() function needs to allocate or deallocate
blocks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-02 18:52:12 -04:00
Theodore Ts'o ec9d6dd320 Wire ext2fs_bmap2() to use ext2fs_extent_set_bmap()
This commit enables read/write access via the ext2fs_bmap2() interface
for extent-based inodes.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-02 18:52:12 -04:00
Theodore Ts'o d7b92206ba Wire ext2fs_block_iterate2() to use ext2fs_extent_set_bmap()
This commit enables read/write access via the block iterator for
extent-based inodes.

Also fixed some bugs regarding the handling on non-leaf extent nodes
when iterating over extents in a file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-02 18:52:12 -04:00
Eric Sandeen c802ad9ed6 Teach ext2fs_extent_delete() to remove an empty extent node from the tree
ext2fs_extent_delete() will also update the parent node and decrement
the inode block count.

Passing in the EXT2_EXTENT_DELETE_KEEP_EMPTY flag will allow the empty
node to remain.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-02 18:52:12 -04:00
Eric Sandeen f4e9963c09 libext2fs: add new function ext2fs_extent_set_bmap()
Allows unmapping or remapping single mapped logical blocks,
and mapping currently unmapped blocks.

Also implements ext2fs_extent_fix_parents() to fix parent
index logical starts, if the first index of a node changes
its logical start block.

Currently this can result in unnecessary new single-block extents; I
think perhaps ext2fs_extent_insert should grow a flag to request
merging with a nearby extent?

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-02 18:52:05 -04:00
Eric Sandeen 01229db57e Teach ext2fs_extent_insert() to split the current node if necessary
If ext2fs_extent_insert finds that the requested node
for insertion is full, it will currently fail.

With this patch it will split as necessary to make room, unless an
EXT2_EXTENT_INSERT_NOSPLIT flag is passed to it.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-02 10:14:08 -04:00
Eric Sandeen 9fd6a96d9b libext2fs: Teach extent.c how to split nodes
When called for a given handle, the new function extent_node_split()
will split the current node such that half of the node's entries will
be moved to a new tree block.  The parent will then be updated to
point to the (now smaller) original node as well as the new node.

If the root node is requested to be split, it will move all
entries out to a new node, and leave a single entry in the
root pointing to that new node.

If the reqested split node's parent is full it will recursively
split up to the root to make room for the new node's insertion.

If you ask to split a non-root node with only one entry,
it will refuse (we'd have an empty node otherwise).

It also updates the i_blocks count when a new block has
successfully been connected to the tree.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-02 10:13:59 -04:00
Theodore Ts'o aa8e2f1c31 ext2fs_extent_open: If the inode is empty, initialize the extent tree
If the inode's i_block[] array is completely empty, create an empty
extent tree in the in-core inode and set the EXT4_EXTENT_FL inode
flag.  This makes it easy to create a new inode using extents.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-02 00:14:23 -04:00
Theodore Ts'o 05a32de263 ext2fs_extent_replace: Support uninit extents and check validity of e_len
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-01 22:56:37 -04:00
Theodore Ts'o 11de9261c1 e2fsck: Don't double count an extent after deleting the last extent
ext2fs_extent_delete() will leave the extent handle pointing at the
next extent --- except if the last extent in the node.  To deal with
this last case, call ext2fs_get_extent_info() and stop scanning after
processing info->num_entries extents.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-30 15:23:24 -04:00
Theodore Ts'o 73e5abcfe4 e2fsck: Don't skip an extent after deleting an invalid extent
ext2fs_delete_extent() deletes the current extent and moves to the
next extent (if present).  So we need to skip moving to the next
extent and get the (new) current extent and check it before moving on.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-28 04:54:44 -04:00
Theodore Ts'o 168b6b53be Remove bashism in test script for libblkid
Thanks to Christian Kujau for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-25 19:45:29 -04:00
Theodore Ts'o c7015e491f Add 64-bit support to the test_io manager
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-24 19:17:01 -04:00
Theodore Ts'o 7609f54d7e Fix m_large_file and r_inline_xattr tests to match with recent changes
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-24 19:10:49 -04:00
Theodore Ts'o c0af709e52 Merge branch 'maint'
Conflicts:

	README
	version.h
2008-05-21 16:56:42 -04:00
Theodore Ts'o 491d8bc3e0 Update release notes and debian changelog for 1.40.10 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-21 13:44:44 -04:00
Maciej W. Rozycki b8251a546d Remove default sizeof sizes in configure script when cross-compiling
Since version 2.50 autoconf fully supports checking sizes of types
(with AC_CHECK_SIZEOF) when cross-compiling.  Therefore there is no
need to preset the respective cache variables anymore.  The following
patch removes the special case.  There is no need to adjust AC_PREREQ
as it's set to 2.50 already.

Tested successfully cross-building for the mips64el-linux-gnu host on
an i386-linux-gnu build system, removing the following warning
(because of a mismatch for the "long" type):

Sizeof(__U64__TYPEDEF) is 4 should be 8
Problem detected with asm_types.h

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-21 13:24:37 -04:00
Theodore Ts'o 492ea6556e blkid: If the device mtime is newer that the cache time, force a revalidation
This fixes problems turned up by a test case written by Erez Zadok's
group which constantly reformats filesystems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-20 17:28:54 -04:00
Theodore Ts'o e5ea6b14eb e2fsck: Fix potential data corruptor bug in journal recovery
While synchronizing e2fsck's recovery.c with the latest 2.6 kernel
sources, I discovered a serious bug that apparently had been fixed in
the kernel sometime between Deceber 2003 and April 2005, but which had
not been carried over to e2fsprogs.  Specifically, when blocks whose
first 4 bytes are JFS_MAGIC_NUMBER (0xc03b3998) are written into the
journal, the first 4 bytes zero'ed out.  A one character typo meant
that when the blocks were replayed by e2fsck, the JFS_MAGIC_NUMBER
would not be restored.

Oops.

Fortunately, it is *highly* unlikely that ext4 metadata blocks will
contain that magic number in the first four bytes, and data=journalled
is a relatively rarely used.

This commit fixes this bug, as well as updating e2fsck's recovery.c to
be in sync with 2.6.25.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-20 14:51:14 -04:00
Theodore Ts'o a16031c639 debugfs: Print the nanosecond field and i_version field of an inode
Add support for dumping out the new inode fields added in ext4

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-15 22:17:06 -04:00
Theodore Ts'o bb767b2fc3 ext2fs.h: Add l_i_file_acl_high and l_version_hi to on-disk inode structure
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-15 22:14:52 -04:00
Clytie Siddall ae7ecef50f po: update vi.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-05-14 18:42:45 -04:00
Gran Uddeborg 0320cde09c po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-05-14 18:42:45 -04:00
Benno Schulenberg 3fe745df0b po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-05-14 18:42:45 -04:00