Commit Graph

2997 Commits (7f8da8022e2484054bd2f23c82d7c98bb735516a)

Author SHA1 Message Date
Theodore Ts'o 7f8da8022e 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>
2009-04-20 07:49:26 -04:00
Theodore Ts'o 2de03c18a6 debian: Put the *-dbg packages in the debug section as requested by Lintian
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-20 07:46:08 -04:00
Theodore Ts'o daf3c82dd0 Interim commit for Debian release -- 1.41.4-2
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-19 23:06:45 -04:00
Theodore Ts'o 2d7361ebfa 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>
2009-04-18 22:42:13 -04:00
Theodore Ts'o c09043f1ab 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>
2009-04-18 22:32:03 -04:00
Theodore Ts'o 1ac84a948d 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>
2009-04-18 13:31:54 -04:00
Theodore Ts'o c927bec16f tune2fs: Clarify manpage regarding how to see the current settings
Addresses-Debian-Bug: #515693

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-18 11:39:22 -04:00
Theodore Ts'o afa7874214 debian: Add homepage field to the control file
Addresses-Debian-Bug: #506279

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-18 11:37:35 -04:00
Theodore Ts'o f203bbdbec 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>
2009-04-18 10:53:32 -04:00
Theodore Ts'o fa15820f4c debugfs: Teach the set_inode_fields_command how to set i_file_acl_high
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-18 09:41:04 -04:00
Theodore Ts'o 81624c3c7b 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>
2009-04-18 09:40:26 -04:00
Theodore Ts'o 38e7385e74 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>
2009-04-18 09:14:31 -04:00
Theodore Ts'o 1207e36d0a 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>
2009-04-15 13:12:56 -04:00
Andreas Dilger 611378fe20 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>
2009-04-07 13:39:24 -04:00
Eric Sandeen d9ff474b74 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>
2009-04-07 13:20:53 -04:00
Theodore Ts'o a620baddee 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>
2009-03-31 07:42:24 -04:00
Petr Pisar e7c76ba80a po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-03-16 22:26:52 -04:00
Theodore Ts'o 341b52dfa8 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>
2009-03-16 22:16:44 -04:00
Manish Katiyar a5bde7959b 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>
2009-03-08 20:48:36 -04:00
Jim Meyering 671326f625 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>
2009-03-08 20:38:47 -04:00
Jim Meyering 4e711be8d0 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>
2009-03-08 20:38:20 -04:00
Jim Meyering 45e338f533 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>
2009-03-08 20:37:12 -04:00
Eric Sandeen a6d4aa1474 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>
2009-03-08 19:29:28 -04:00
Eric Sandeen eefa4d950c debugfs: fix segfault on "stat" command with no open fs
This is a regression from commit
8fdf29117f, 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>
2009-03-08 19:29:28 -04:00
Theodore Ts'o 9af62fde65 tests: Filter out "Lifetime writes" from the dumpe2fs display
The Lifetime writes field will probably not be stable as we add new
features to e2fsprogs, so filter it out to avoid spurious test failures.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-03-08 19:01:03 -04:00
Theodore Ts'o 1361821e7e blkid: Add fallback to ext4 for 2.6.29+ kernels if ext2 is not present
Starting in 2.6.29, ext4 can be used to support filesystems without a
journal.  So if ext2 is not present, and the kernel version is greater
than 2.6.29, and ext4 is present, return a filesystme type of ext4.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-03-08 18:56:41 -04:00
Eric Sandeen a90f5391dd blkid: recognize ext4(dev) without journal
ext4/ext4dev no longer require a journal.

w/o this blkid doesn't recognize after:

# mkfs.ext4 /dev/blah
# tune2fs -O ^has_journal
# blkid /dev/blah

We still must have one ext3-incompat-feature to flag
as ext4(dev) so we shouldn't ever mis-recognize it.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-03-06 02:44:07 -05:00
Eric Sandeen eb630fd870 e2fsprogs: blkid.static make target
Nice for testing w/o needing to swizzle around system
libraries...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-03-06 02:41:46 -05:00
Eric Sandeen f2fe5da31d e2fsprogs: fix potential null ptr defef in check_for_modules()
The coverity scanner found this one.

If a line in modules.dep has a ":" but no "/" then:

                if ((cp = strchr(buf, ':')) != NULL)
                        *cp = 0;
                else
                        continue;
                if ((cp = strrchr(buf, '/')) != NULL)
                        cp++;
                /* XXX else cp is still null */
                i = strlen(cp);

... we will deref a null pointer (cp).  This can be
demonstrated by putting a line like:

foo.ko:

into modules.dep.  The below change just says that if no "/" is
found, treat the whole string as the module name.

Addresses-Red-Hat-Bugzilla: #486997

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-03-06 02:37:33 -05:00
Theodore Ts'o 8d8224550c mke2fs, tune2fs: Do not allow the reserved_ratio to be negative
Add a check to make sure the argument to the -m option (which
specifies the reserved ratio) is greater than zero.

Addresses-Debian-Bug: #517015

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-03-06 02:25:06 -05:00
Theodore Ts'o b7c5b40308 Add support for a new superblock field: s_kbytes_written
This field tracks the lifetime amount of writes to the filesystem.  It
will be updated by the kernel as well as by e2fsprogs programs which
write to the filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-03-06 01:59:23 -05:00
Theodore Ts'o b2ca48f40e Update release notes, changelog, etc., for e2fsprogs 1.41.4 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-27 19:51:00 -05:00
Theodore Ts'o 945ffb9ec9 Update e2fsprogs translation template. 2009-01-26 20:45:46 -05:00
Theodore Ts'o cf9fbcccbc e2fsck: Add missing newlines when reporting errors in pass 3A
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-26 16:41:46 -05:00
Theodore Ts'o 206d2ade6e e2fsck: Change PR_3_CREATE_LPF_ERROR to be a non-fatal problem
The other problem codes associated with failing to create the
lost+found directory are non-fatal, and this one should be non-fatal
as well.  The two places which call e2fsck_get_lost_and_found()
already deal with a failure to create the directory, so there's no
point making this be a fatal error.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-22 16:05:29 -05:00
Theodore Ts'o cf4e06d665 libext2fs: Add sanity checks to ext2fs_{block,inode}_alloc_stats
If ext2fs_inode_alloc_stats2() or ext2fs_block_alloc_stats() is passed
an insanely large inode or block number, it's possible for these
functions to overrun an array boundary and cause the calling program
to crash with a memory error.

Detect this case, and since these functions don't return an error
code, print a warning message, much like we do in ext2fs_warn_bitmap2().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-22 16:01:38 -05:00
Theodore Ts'o a93d406960 ext2fs_new_inode(): Add sanity check to assure a valid inode number
Add a sanity check to makesure that even if the superblock field
s_first_inode is insane, that we won't return an invalid inode number.
(The function will return the error EXT2_ET_INODE_ALLOC_FAIL in that
case.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-22 15:55:49 -05:00
Theodore Ts'o 1f790a7cc1 e2fsck: Add superblock check to make sure s_first_ino is valid
An deliberately corrupted filesystem with an insanely large
s_first_ino field could cause e2fsck to crash with a seg fault.

Thanks to Eric Sesterhenn for supplying test cases which demonstrated
this issue.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-22 15:52:50 -05:00
Theodore Ts'o 37d17a65ec mke2fs: If the device size is exactly 16TB treat it as if it had 16TB - 1 block
This allows users who create a 16TB LVM to have mke2fs do (mostly) the
right thing automatcally.
2009-01-20 14:03:03 -05:00
Theodore Ts'o 9f7a1fc936 ext2fs_get_device_size: Fix error handling
The previous patch would return EFBIG for any failure called from
ext2fs_get_device_size2().  (I didn't merge this fix with the
preceeding commit to allow merges to happen more easily.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 13:37:47 -05:00
Jose R. Santos beab8de477 Add 64-bit getsize interface.
Added interface capable of opening 64-bit block device.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 13:35:15 -05:00
Theodore Ts'o b0afdda1bc mke2fs: Add -U option to specify the UUID for the new filesystem
Patch integrated from Mandriva

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 13:20:31 -05:00
Theodore Ts'o 5299580c1c Use format strings directly to prevent -Werror=format-security failures
Gcc is too stupid to realize that:

    const char *usage="String which has no percent signs";

    com_err(progname, 0, usage);

is OK.  I refuse to bow to stupidity with:

   com_err(progname, 0, "%s", usage);

but I will use the string directly for the sake of people who like to
build with -Werror=format-security.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 13:05:25 -05:00
Theodore Ts'o 31e2a75484 blkid: Add support for detecting user-level suspend as a swsuspend signature
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 12:08:07 -05:00
Theodore Ts'o 1a71bd4200 mke2fs: Treat an argv[0] of "mke3fs" the same as "mkfs.ext3"
Mandriva apparently uses "mke3fs" as an alias for mkfs.ext3.  I'm not
particularly fond of that practice, but we'll include it as legacy
support.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 12:02:40 -05:00
Theodore Ts'o 31f1815fa9 tune2fs: Fix tune2fs -I so it won't corrupt RAID filesystems
If a filesystem is built with the stride extended-option (which is
often used in RAID filesystems to make sure the block and inode
allocation bitmaps don't end up hitting one disk platter harder than
the rest), this can cause tune2fs -I to corrupt the filesystem because
it fails to handle the case where the allocation bitmaps are located
after the inode table, where the inode table needs to grow.  Handle
this case correctly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 11:49:17 -05:00
Theodore Ts'o ec43da2f35 tune2fs: General (whitespace) cleanup
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 02:34:39 -05:00
Theodore Ts'o 5bf81baea0 tune2fs: Don't allow the -I option if the flex_bg feature is enabled
With flex_bg usually the inode table for most block groups are packed
right against each other, so expanding the inode table size needs
special handling that's not currently in tune2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 01:50:07 -05:00
Eric Sandeen 801b005333 blkid: recognize btrfs
Add btrfs detection to libblkid, now that the disk format should be
recognizable in the future.

# misc/blkid /tmp/fsfile
/tmp/fsfile: LABEL="mylabel" UUID="102b07f0-0e79-4b42-8a4e-1dde418bbe6d" TYPE="btrfs"

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-01-20 00:57:59 -05:00
Theodore Ts'o c66130f186 debian: Add "set -e" to uuid-runtime's prerm script
This addresses a Lintian warning.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 00:55:32 -05:00