Commit Graph

3297 Commits (8c084167ee5ea4ae28359b0d67d583eb1068465c)

Author SHA1 Message Date
Theodore Ts'o 8c084167ee Fix Makefile dependencies for test programs in lib/ext2fs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-06-24 21:11:01 -04:00
Theodore Ts'o f5448c19ac Add support for Next3 snapshot superblock fields to dumpe2fs and debugfs
We also support for byte-swapping the Next3 fields, although the
current Next3 implementation doesn't support big-endian systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-06-24 21:08:37 -04:00
Theodore Ts'o 296b9d696a po: update zh_CN.po (from translationproject.org)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-06-07 12:25:11 -04:00
Theodore Ts'o 75a78ac5b0 po: update vi.po (from translationproject.org)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-06-07 12:24:43 -04:00
Theodore Ts'o 057a15975d po: update de.po (from translationproject.org)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-06-07 12:24:21 -04:00
Gran Uddeborg 4f42008957 po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-06-07 12:21:46 -04:00
Jakub Bogusz 2cb3c4b6df po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-06-07 12:21:46 -04:00
Benno Schulenberg 3c3543489f po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-06-07 12:21:46 -04:00
Arif E. Nugroho f3735806ee po: update id.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-06-07 12:21:46 -04:00
Samuel Thibault 3faeacdc01 po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-06-07 12:21:46 -04:00
Petr Pisar dc86e67855 po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-06-07 12:21:46 -04:00
Theodore Ts'o 0fb2d1d346 Update debian/changelog for v1.41.12-2 release 2010-06-03 13:02:15 -04:00
Theodore Ts'o e54e700051 Fix debian problem: e2fsprogs: bogus dependency on libblkid1 due to shlibs.local
Addresses-Debian-Bug: #583551

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-06-03 13:02:09 -04:00
Theodore Ts'o 6d0ed67802 Reserve feature flags and fields needed for the Next3 snapshot feature
The documentation is not (as of this writing) fully complete, but
there is some documentation here:

http://sourceforge.net/apps/mediawiki/next3/index.php?title=Code_documentation
http://sourceforge.net/apps/mediawiki/next3/index.php?title=On-disk_format
http://sourceforge.net/projects/next3/files/Next3_Snapshots.pdf/download

... which will hopefully be updated soon to be fully up to date with
these assignments and more details about how things work.

For now, the assignments should avoid collisions with other new work
that people might want to do on ext3/4.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-06-02 10:42:16 -04:00
Andreas Dilger 30a7610edf Reserve the EXT4_FEATURE_INCOMPAT_DIRDATA feature flag
Reserve the EXT4_FEATURE_INCOMPAT_DIRDATA feature flag for adding
extra file data in ext2_dir_entry_2 entries.

This changes the on-disk layout in the following way.

Firstly, the ext2_dir_entry_2 file_type field now has a mask: that
limits the "filetype" information to the low 4 bits of this field.
Since these values are sequentially assigned, this allows for up to 7
more filetypes to be assigned.  When reading the "filetype" field, the
high 4 bits should be masked off when converting to DT_* filetypes for
userspace.

The high 4 bits of "filetype" are used as a bitmask to register up to
4 different "extended" directory entry fields.  Extended data fields
are packed without alignment into the directory entry after the "name"
field in order of increasing bitmask value, for each field where bit
is set.  In order to avoid the need to "understand" each of the
extended fields, the first byte of each extended data field holds the
size of that data field (including the size itself), so they can be
skipped if not understood.  For fields that change the semantics of
the filesystem it is expected that a separate ROCOMPAT or INCOMPAT
field is registered.

There is a single dirent data type defined currently, for Lustre:
which holds a 128-bit file identifier.  It is expected that if there
are 64-bit inode values that this will be assigned the 0x20 value.

Should a need ever arise to use all 4 of the extended dirent data
fields, it would be possible to keep the last bit (0x80) for use as a
multiplexor that stores a 1-byte aggregate data size, then a series of
"<u8_size><u8_type><data>" records in the last extended data record.
It is not expected that this will actually be needed in the lifetime
of ext4.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-06-02 10:41:54 -04:00
Andreas Dilger cff9690f4e Reserve the EXT4_INCOMPAT_EA_INODE feature flag
Reserve the EXT4_INCOMPAT_EA_INODE feature flag for use with
large extended attributes that are stored in a separate inode.
This changes the on-disk format in several ways:

First, replace the e_value_block field with e_value_inum, so that
an xattr entry can reference an external inode.  This field is
currently unused, as all of the entries live in the same block.

struct ext2_ext_attr_entry {
 	__u8	e_name_len;	/* length of name */
 	__u8	e_name_index;	/* attribute name index */
 	__le16	e_value_offs;	/* offset in disk block of value */
>	__le32	e_value_inum;	/* inode in which the value is stored */
 	__le32	e_value_size;	/* size of attribute value */
 	__le32	e_hash;		/* hash value of name and value */
 	char	e_name[0];	/* attribute name */
}

Second, add a flag to the inode that indicates it is using a large
(external) extended attribute.  This is needed so that when unlinking
an inode the xattrs will be scanned to unlink the xattr inodes
referenced by the main inode.

Third, for inodes that have a number of xattrs that are larger than
a single block, but not large enough to justify an external inode
(less than 64kB total xattr size, due to e_value_offs limitation)
the ext2_ext_attr_header->h_blocks field can grow beyond a single
block to represent a contiguous allocation of blocks for the xattr.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-06-02 10:41:37 -04:00
Theodore Ts'o effb344241 libext2fs: Remove #include of <linux/types.h> from fiemap.h
The system header file can end up causing type conflicts, and
including kernel header files is always dodgy/dangerous (and this case
not needed).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-31 18:50:50 -04:00
Theodore Ts'o 15fdc40125 Fix minor nit in debian/rules file
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-26 11:01:06 -04:00
Eric Sandeen ae2272f845 e2fsck: correct test for EOFBLOCKS
This test, added to e2fsprogs-1.41.12, is backwards.

If EOFBLOCKS is set, then the size -should- be less than
the last physical block...

xfstests 013 caught this.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-05-19 14:55:29 -04:00
Theodore Ts'o 079ad63d59 tune2fs: Enable uninit_bg to be set without requiring an fsck
Allow the uninit_bg feature to be set without requiring an fsck.  The
first full fsck will require scanning all of the inode table blocks,
but subsequent fsck's will be fast.  This allows flexibility over
requiring a full fsck after setting this feature, which is what
tune2fs previously mandated.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-19 12:14:39 -04:00
Theodore Ts'o 3456728c60 Clean up "last commit" comment in RELEASE-NOTES
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-18 00:14:21 -04:00
Theodore Ts'o b846122a12 Update release notes, version string, etc. for e2fsprogs 1.41.12 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-17 23:54:49 -04:00
Theodore Ts'o 3a0d5d396b Fix dpkg-buildpackage -j2
Add a dependency on subs to all-libs-recursive and all-progs-recursive
to dpkg-buildpackage -j2, since it builds make target 'libs'
explicitly, and we need to make sure the 'subs' target is run first.

Addresses-Debian-Bug: #563487

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-17 23:48:52 -04:00
Theodore Ts'o faec3b1a34 Update e2fsprogs translation template for 1.41.12 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-17 23:06:21 -04:00
Theodore Ts'o 2e6436d459 e2fsck: Don't set the group descriptor checksums if the fsck was cancelled
It's a bad idea to set the checksums if e2fsck is aborted by the user,
and it often causes an error message, "Inode bitmap not loaded while
setting block group checksum info".

Addresses-Launchpad-Bug: #582035

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-17 23:04:40 -04:00
Theodore Ts'o bb1158b92e mke2fs: account for physical as well as logical sector size
Some devices, notably 4k sector drives, may have a 512 logical
sector size, mapped onto a 4k physical sector size.

When mke2fs is ratcheting down the blocksize for small filesystems,
or when a blocksize is specified on the commandline, we should not
willingly go below the physical sector size of the device.

When a blocksize is specified, we -must- not go below
the logical sector size of the device.

Add a new library function, ext2fs_get_device_phys_sectsize()
to get the physical sector size if possible, and adjust the
logic in mke2fs to enforce the above rules.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-17 23:04:40 -04:00
Theodore Ts'o 543547a52a libe2p, libext2fs: Update file copyright permission states to match COPYING
The top-level COPYING file states that the e2p and ext2fs libraries
are available under the LGPLv2.  The files were incorrectly labelled.
Alex Thomas/Luster has been consulted wrt to the ext3_extents.h file;
the rest of the files were primarily authored by Theodore Ts'o.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-17 23:04:39 -04:00
Theodore Ts'o b25df6f817 mke2fs: Fix compile warning message
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-17 23:04:39 -04:00
Theodore Ts'o 517be2d76e Install fsck.ext4 symlink in e2fsprogs-udeb package
Addresses-Debian-Bug: #571247

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-17 19:38:31 -04:00
Theodore Ts'o 4d452afe47 Always build namei.o so that building with "configure --disable-debugfs" works
namei.o is also needed by e2initrd_helper.

Long term, if we care about reduced e2fsprogs builds, we need a more
general solution for deciding what .o files are needed for a
particular build.  Given that install floppies are going (gone?) the
way the dodo bird, we probably don't care, though.

Addresses-Sourceforge-Bug: #2911433

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-17 19:32:19 -04:00
Theodore Ts'o 5aa6c3f61c Add configure options --enable-symlink-build and --enable-symlink-install
These options allow e2fsprogs to be built using symlinks instead of
hard links, and to be installed using symlinks instead of hard links,
respectively.

Addresses-Sourceforge-Bug: #1436294

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-17 19:21:42 -04:00
Theodore Ts'o 822c10e84e libcom_err: Only output ^M when tty is in raw mode
This fixes a long-standing botch in the com_err library, and solves a
regression test problem for libss that gets tickled by source code
management systems (like Perforce) that don't preserve CRLF line
endings with fidelity.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-15 07:48:25 -04:00
Theodore Ts'o edc1894e60 tests: Use our own mke2fs.conf file
Use a standard, fixed mke2fs.conf file so that if downstream
distributions want to change the mke2fs.conf which is distributed in
the RPM or dpkg file, it won't screw up the regression tests.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-14 20:18:11 -04:00
Theodore Ts'o e6238d3708 e2fsck: Explicitly reject extents that begin at physical block 0 as illegal
In the case where s_first_data_block is 1, we need to explictly reject
an extent whose starting physical block is zero.

Thanks to Jiaying Zhang <jiayingz@google.com> for finding this bug.

Addresses-Google-Bug: #2573806

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-14 18:06:40 -04:00
Theodore Ts'o ee74cf16b5 e2fsck: Fix segmentation fault when checking a file system
If a corrupted file system causes us to want to delete an extent, and
that causes us to want to release a block in e2fsck pass #1, it would
be preferable if e2fsck didn't seg fault.  This tends to get users
craky, as users are wont to do.  :-)

Thanks to Dirk Reiners for reporting this bug:

e2fsck crashes fixing a corrupted 3.5 TB filesystem:

0x0000000000432002 in ext2fs_unmark_generic_bitmap (bitmap=0x0, bitno=623386749)
at gen_bitmap.c:183
183             if ((bitno < bitmap->start) || (bitno > bitmap->end)) {
(gdb) bt
bitno=623386749) at gen_bitmap.c:183
block=623386749) at ../../lib/ext2fs/bitops.h:319
inuse=-1) at alloc_stats.c:78
extent.c:1509
pb=0x7fffffffdfe0, start_block=0, ehandle=0x6dcf50) at pass1.c:1709
pb=0x7fffffffdfe0, start_block=0, ehandle=0x6dcf50) at pass1.c:1737
pctx=0x7fffffffe100, pb=0x7fffffffdfe0) at pass1.c:1842
block_buf=0x6c4330 "\373\212#") at pass1.c:1920

The source of the NULL bitmap is fs on stack frame 2:

(gdb) up 2
inuse=-1) at alloc_stats.c:78
78                      ext2fs_unmark_block_bitmap(fs->block_map, blk);

Addresses-SourceForge-Bug: #2971800

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-13 19:00:41 -04:00
Theodore Ts'o 177839e245 e2fsck: Skip time-based checks if the time looks insane or broken_system_clock
There are broken embedded devices that have system clocks that always
reset to January 1, 1970 whenever they boot (even if no power is
lost).  There are also systems that have super cheap clock crystals
that can be very inaccurate.  So if the option broken_system_clock is
given, disable all time based checks.  E2fsck will also try to detect
incorrect system clock times, and automatically mark the system clock
as insane.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-13 17:36:36 -04:00
Eric Sandeen 65d71894c9 e2fsck: make block counting variable in pass1 64 bits
Justin reported that creating a 4T file with posix_fallocate led
to fsck errors:

e2fsck 1.41.10 (10-Feb-2009)
Pass 1: Checking inodes, blocks, and sizes
Inode 12, i_blocks is 8589935432, should be 840.  Fix? yes

This looks like a 32-bit overflow.

commmit 8a8f36540b added handling of
the high i_blocks number, but we accumulate blocks in the num_blocks
field, and that's still just 32 bits.

Note: we don't need to expand max_blocks for now, that's only used
in the non-extents case, and those files have smaller max sizes.

I haven't been able to replicate the problem, oddly, but Justin
reports that this patch fixed his situation.

Reported-by: Justin Maggard <jmaggard10@gmail.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-05-13 13:33:53 -04:00
Eric Sandeen 5750e5f924 e2fsck: mark sparse journal as invalid
For a filesystem that fails with:

journal_bmap: journal block not found at offset 7334 on loop0
JBD: bad block at offset 7334

e2fsck won't actually fix this; it will mark the fs as clean,
so it will mount, but it does not fix that block, and when the
journal reaches this point again it will fail again.

The following simple change to process_journal_block() might be
a little drastic; it will clear & recreate the journal inode if
it's sparse - i.e. if it gets block 0.

I suppose we could be more complicated and try to replay the journal
up to the error, but I'm not sure it's worth it since we're fscking
it anyway.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-05-13 13:14:41 -04:00
Theodore Ts'o a6217f5ae2 e2fsck: Fix a number of problems that were inappropriately using PROMPT_ABORT
There were a number of problems that were prompting the user whether
or not to ABORT, but then would abort regardless of whether the user
answered yes or no.  Change those to be PROMPT_NONE, PR_FATAL.

Also, fix PR_1_RESIZE_INODE_CREATE so that it recovers appropriately
after failing to create the resize inode.  This problem now uses
PROMPT_CONTINUE instead of PROMPT_ABORT, and if the user says, "no",
the code will abort.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-12 18:58:53 -04:00
Eric Sandeen 1bb14a22b5 mke2fs: be explicit if external journal device is not found
This for RH bug #572935 -
RFE: Misleading error message from mke2fs -J option

If the journal device UUID is typo'd or otherwise not found,
the error message looks like it's a usage() type of problem.

It'd be helpful to explicitly say that the device requested
could not be found.

Addresses-Red-Hat-Bug: #572935

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-05-12 12:54:12 -04:00
Eric Sandeen 5fa92bc768 resize2fs: don't print minimum size if fs is not clean
Right now, resize2fs -P on a dirty filesystem will give you a number;
however, it's probably wrong if the fs is not clean:

# resize2fs -P myimage.img
resize2fs 1.41.9 (22-Aug-2009)
Estimated minimum size of the filesystem: 75623

# e2fsck -fy myimage.img
e2fsck 1.41.9 (22-Aug-2009)
myimage.img: recovering journal
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

myimage.img: ***** FILE SYSTEM WAS MODIFIED *****
myimage.img: 9530/53760 files (0.1% non-contiguous), 24737/98304 blocks

# resize2fs -P myimage.img
resize2fs 1.41.9 (22-Aug-2009)
Estimated minimum size of the filesystem: 32165

We should issue the same "Please run e2fsck ..." message for
-P as we do for an actual resize request.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-05-12 12:44:56 -04:00
Theodore Ts'o 53499e86c5 tests: Add new test f_unused_itable
Add test to make sure e2fsck doesn't end up detaching and sending to
lost+found inodes which are in an bg_itable_unused_region (e.g. if
there was a power failure and bg_itable_unused wasn't updated because
journaling wasn't enabled).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-11 21:10:12 -04:00
Theodore Ts'o 0433c1f1b7 e2fsck: Don't clear inodes if we found inodes that are in the unused region
Commit 6267ee4 avoided repeating pass #1 over and over again if
multiple block groups are found with inodes in the bg_itable_unused
region during pass #2.  This caused a regression because the problem
with not restarting pass #1 right away is that e2fsck will offer to
clear directory entries for inodes that are deleted, and e2fsck can't
easily distinguish between deleted inodes and inodes that were skipped
because of an incorrect bg_itable_unused value.  So once an inode is
found in an unused region and we know that we're going to restart the
e2fsck pass, don't offer to clear any deleted inodes --- since those
will be caught in the second round.

Addresses-Google-Bug: #2642165

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-11 15:28:10 -04:00
Theodore Ts'o d531450cdd mke2fs: Allow a flex_bg size of 1
It's unusual, and rarely needed, but it's legal value.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-10 21:49:58 -04:00
Theodore Ts'o 2291fbb035 e2fsck: Check for cases where EOFBLOCKS_FL is unnecessarily set
Some kernels will crash if EOFBLOCKS_FL is set when it is it not
needed, and this if it is left set when it isn't needed, it is a sign
of a kernel bug.

Addresses-Google-Bug: #2604224

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-10 10:29:14 -04:00
Petr Pisar bc11f0dacc po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-05-06 14:49:49 -04:00
Dark Raven 3be22a8197 po: update zh_CN.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-04-19 16:59:03 -04:00
Clytie Siddall f8e76c854b po: update vi.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-04-19 16:59:03 -04:00
Jakub Bogusz 92ec60104c po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-04-19 16:59:03 -04:00
Benno Schulenberg 4544b08a8d po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-04-19 16:59:03 -04:00