Commit Graph

4503 Commits (0781e038bb6d2f16d975bd8ea298a0893e2a4be8)

Author SHA1 Message Date
Benno Schulenberg 0781e038bb po: describe more precisely the %B expansion
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-06-03 21:59:31 -04:00
Eric Sandeen f2ca701c1c filefrag: fix issues with 29758d2
29758d2 filefrag: exit with error code if an error is hit

introduced a couple errors; in one case it missed returning
a value, and possibly picked up errno from (unchecked) close(),
and in the other used a test where it needed an
assignment.  So capture the error, move perror() directly
after the failed call in both cases, and fix the assignment.

Also fix a precedence problem with:

	if (fe_flags & mask == 0)

which is equivalent to:

	if (fe_flags & (mask == 0))

but we need:

	if ((fe_flags & mask) == 0)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
2014-06-01 21:27:43 -04:00
Benno Schulenberg 1c97e615f3 po: add %It to the list of recognized expansions
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-06-01 21:17:47 -04:00
Benno Schulenberg 38f160d32b e2fsck: fully and properly gettextize two error messages
The phrases "mounted" and "in use" were filled in untranslated into
the messages.  But it is better to gettextize entire sentences, and
not synthesize them from fragments.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-06-01 21:17:13 -04:00
Benno Schulenberg 35a0bdd7e2 mke2fs: fix a typo in an error message
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-06-01 21:12:47 -04:00
Theodore Ts'o 8ae8a211f2 Fix up minor typo in German translation
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: pth@suse.de
2014-05-31 13:37:30 -04:00
Philipp Thomas b93349ad5f po: update de.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-31 13:32:39 -04:00
Andreas Dilger 29758d2fc5 filefrag: exit with error code if an error is hit
If an error is hit during filefrag operation, it will continue to run
(if multiple files are specified on the command-line), but will exit
with a non-zero value, so that callers can determine that some error
was hit.

Clean up the printing of FIEMAP flags and print some newer flags that
were missing.  Also print unknown flags as hex values.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-27 12:56:45 -04:00
Theodore Ts'o 1f15ba0034 lib/ext2fs: clean and build ext2_types.h as necessary
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-27 12:24:33 -04:00
Theodore Ts'o ceff962c67 tst_libext2fs: add new debug program which used for libext2fs unit tests
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-27 12:14:27 -04:00
Vitaliy Filippov 7133644eec misc: use unsigned long long for file block count in filefrag
This patch fixes incorrect reporting of file block count on 32-bit platforms.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-27 12:12:05 -04:00
Eric Sandeen 2eb0ed09d9 e2fsprogs: don't run quota test if quota is not enabled
The default configuration still has quota disabled, but
runs the f_quota test unconditionally, so we fail by
default.

Fix that...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-27 12:12:05 -04:00
Theodore Ts'o 5c15bf5f97 e2fsck: fix Makefile dependency for quota.o
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-22 18:52:27 -04:00
Andreas Dilger 999d38d9b9 debugfs: fix debugfs/quota.c compile warnings
Fix type mismatch and unused variable warnings.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-22 17:57:21 -04:00
Andreas Dilger 9d8cd8c461 debugfs: fix filehandle leak in copy_file()
Fix a file handle leak for the target file in copy_file() when error
handlers return without closing the file.  Instead, clean up at the
end of the function to handle cleanup in normal and error cases.

Minor other code style cleanups.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-22 17:54:36 -04:00
Andreas Dilger 90c5b4c9de debugfs: fix string_to_time for MacOS strptime()
The strptime() function does not update fields in struct tm that are
not specified in the input format.  The glibc implementation sets the
tm_yday field (%j) when any of the year (%Y), month (%m), or day (%d)
fields are changed, but the MacOS strptime() does not set tm_yday in
this case.  This caused string_to_time() to calculate the wrong Unix
epoch on MacOS. If tm_yday is unset, compute it in string_to_time().

This also fixes test regression failures for FreeBSD.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-22 17:52:23 -04:00
Eric Sandeen a7b0f770b0 mke2fs: use ext2fs_open_file() in check_plausibility()
The commit:

802146c mke2fs: create a regular file if necessary

caused a regression on 32-bit machines; the open() fails if
the file size is > 4G.

Using ext2fs_open_file() fixes it.

Addresses-Red-Hat-Bugzilla: #1099892

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-22 13:43:46 -04:00
Theodore Ts'o 9779e29610 Update release notes, etc. for final 1.42.10 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-18 22:55:16 -04:00
Theodore Ts'o ddc0a3b4fb debian: override source-is-missing false positive
See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748421

Once a new version of Lintian is uploaded with this fixed, we can drop
this override.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-18 22:52:55 -04:00
Theodore Ts'o 618dcd2c2e debian: fix debian/rules compatibility with gmake 4.0
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-18 22:29:31 -04:00
Theodore Ts'o 196b59c810 Update translation files for 1.42.10 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-18 21:47:32 -04:00
Theodore Ts'o 6236e47b0b Fix obvious typo in German translation
Addresses-Debian-Bug: #737800

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-18 21:36:52 -04:00
Trần Ngọc Quân 09debaea1e po: update vi.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-18 09:46:34 -04:00
Göran Uddeborg 4e9c3105d5 po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-18 09:46:34 -04:00
Jakub Bogusz df585271a0 po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-18 09:46:34 -04:00
Benno Schulenberg 47d19333c4 po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-18 09:46:34 -04:00
Samuel Thibault 8575675062 po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-18 09:46:34 -04:00
Benno Schulenberg 8dc4704aee po: update es.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-18 09:46:34 -04:00
Petr Pisar b75328136f po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-18 09:46:34 -04:00
Darrick J. Wong 35a7a5769a mke2fs: set gdt csum when creating packed fs
When we're creating a fs with metadata blocks packed at the beginning
(packed_meta_blocks=1 in mke2fs.conf), set the group descriptor
checksum or else we create DOA filesystems with checksum errors.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
2014-05-13 10:13:40 -04:00
Darrick J. Wong 1244cacc70 resize2fs: fix sanity check in reserve_sparse_super2_last_group()
In reserve_sparse_super2_last_group, the old_desc check should only be
performed if ext2fs_super_and_bgd_loc2() gave us a location -- a
return value of 0 means that there is no old-style GDT block.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-13 10:13:40 -04:00
Theodore Ts'o 1c358e6e12 quota: remove mke2fs's and tune2fs's warning messages regarding quota
We no longer need to reference https://ext4.wiki.kernel.org/index.php/Quota
since we've fixed the nasty bugs associated with e2fsck and the quota
feature.  The wiki page will be updated once we've done a release that
includes these fixes indicated the verison which these problems have
been fixed.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
2014-05-13 10:13:33 -04:00
Theodore Ts'o 133d9fbff3 tests: add basic e2fsck regression test for fixing the quota inode
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
2014-05-13 10:13:26 -04:00
Theodore Ts'o 75fc42f1a1 debugfs: add commands to query the quota information
This allows us to verify quota information in an ext4 file systems
with the quota feature.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
2014-05-13 10:13:19 -04:00
Theodore Ts'o cbc1280dc7 quota: support storing the quota file handles in the quota context
This makes memory management easier because when the quota context is
released, all of the quota file handles get released automatically.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
2014-05-13 10:13:12 -04:00
Theodore Ts'o d37178bb87 quota: integrate mkquota.h into quotaio.h
There are interfaces that are used by mke2fs.c and tune2fs.c which are
in quotaio.h, and some future changes will be much simpler if we can
combine the two header files together.  Also the guard #ifdef for
mkquota.h was incorrect, which caused problems when both header files
needed to be included.

Also remove quota.pc and installation rules for libquota, since this
library is never going to be something that we can export externally
anyway.  Eventually we'll want to clean up the interfaces and move the
external publishable interfaces to the libext2fs library, and then
rename what's left from libquota.a to libsupport.a for internal use
only.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
2014-05-13 10:13:04 -04:00
Theodore Ts'o 4af2b156ff quota: fix memory leak in quota_compare_and_update()
The quota_handle wasn't getting closed in quota_compare_and_update().
Fix this, and also make sure that quota_file_close() doesn't
unnecessarily modify the quota inode if it's not necessary.  Otherwise
e2fsck will claim that the file system is modified when it didn't need
to be.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
2014-05-13 10:12:57 -04:00
Theodore Ts'o 68ba77caa7 quota: fix e2fsck to notice missing quota entries
Previously if there was a missing quota entry --- i.e., if there were
files owned by group "eng", but there was no quota record for group
"eng", e2fsck would not notice the missing entry.  This means that the
usage informtion would not be properly repaired.  This is unfortunate.
Fix this by marking each quota record in quota_dict that has a
corresponding record on disk, and then check to see if there are any
records in quota_dict that have not been marked as having been seen.
In that case, we know we need to update the relevant quota inode.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
2014-05-13 10:12:50 -04:00
Theodore Ts'o ac7ea7b081 quota: fix e2fsck so we update the quota file correctly
In scan_dquota_callback() we were copying dqb_off from the on-disk
dquot structure to the dqot structure that we have constructed in
memory.  This is a bad idea, because if we detect that the quota inode
is corrupted and needs to be replaced, when we later write out the
inode, the fact that we have a non-zero dqb_off value means that quota
routines will not bother updating the quota tree index, since
presumably the quota tree index already has an entry for this dqot.

The problem is that e2fsck, the only user of these functions, has
zapped the quota inode so it can be written from scratch.  So this
means the index for the quota records are not written out, so the
kernel can not find any of the records in the quota inodes.  Oops.

The fix is simple; there is no reason to copy the dqb_off field into
the quota_dict copy of struct dquot.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
2014-05-13 10:12:42 -04:00
Theodore Ts'o a0811c1a0e quota: add debugging code to print the dquot structure
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
2014-05-13 10:12:15 -04:00
Niu Yawei 4cf0b0fe44 libquota: fix dict_uint_cmp()
dict_uint_cmp() returns an usigned int value in int type, which
could mess the dict key comparison when the difference of two
keys is greater than INT_MAX.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-09 22:11:25 -04:00
David Michael 4e2d9f7f4e Add a make variable for the pkgconfig install dir
Adding the pkgconfigdir variable allows specifying an installation
location for pkg-config files independent of libdir.

Signed-off-by: David Michael <fedora.dm0@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-07 10:51:50 -04:00
Chen Qi 91f04685bf Fix cross compilation problem in parse-types.sh
The checking of types in parse-types.sh doesn't make much sense in a
cross-compilation environment, because the generated binary is
executed on build machine.

So even if asm_types.h has got correct statements for types, it's
possible that the generated binary will report an error, because these
types are for the target machine.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-07 10:51:50 -04:00
Theodore Ts'o 2de2628b2d mke2fs: check for a partition table and warn if present
This supercedes the "whole disk" check, since it does a better job and
there are times when it is quite legitimate to want to use the whole
disk.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-07 10:51:50 -04:00
Theodore Ts'o 352fbedb21 mke2fs: print extra information about existing ext2/3/4 file systems
The basic idea is to provide a bit more context in this situation:

% ./misc/mke2fs -t ext4 /dev/sdc3
mke2fs 1.42.9 (4-Feb-2014)
/dev/sdc3 contains a ext4 file system
Proceed anyway? (y,n)

... by adding this bit of context:

% ./misc/mke2fs -t ext4 /dev/sdc3
mke2fs 1.42.9 (4-Feb-2014)
/dev/sdc3 contains a ext4 file system
	last mounted on /SOX-backups on Mon May  5 08:59:53 2014
Proceed anyway? (y,n)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-07 10:51:39 -04:00
Theodore Ts'o a11ccebd89 mke2fs: print a message when creating a regular file
We've added the ability to automatically recreate a file if it doesn't
exist prior to creating the file system, since this is often used (for
example) when managing file system images for use in virtual machines.
We should at least notify the user that this is going on to avoid
surprises in the case of misspelled device/file names.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-05 10:29:35 -04:00
Theodore Ts'o cd84e9a337 resize2fs: fix inode table move for the backwards move case
In the case where the new location of the inode table is before the
old inode table, the optimization which tries to optimize zero block
moves breaks.  Fix it.

This fixes a bug that was tickled by the reproduction described in the
previous commit.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-04 23:15:49 -04:00
Theodore Ts'o d51072af0a libext2fs: fix alloc_allocate_group_table() if the flexbg_offset wraps
If the previous block group's inode table ends at the very end of file
system, wrap around to the beginning of the flex_bg.

This fixes a bug was tickled by:

mke2fs.conf:
	frontload = {
		features = extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,^resize_inode,sparse_super2
		hash_alg = half_md4
		num_backup_sb = 0
		packed_meta_blocks = 1
		inode_ratio = 4194304
		flex_bg_size = 262144
	}

mke2fs -T frontload /tmp/foo.img 2T
resize2fs -M /tmp/foo.img
resize2fs -M /tmp/foo.img

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-04 23:15:49 -04:00
Theodore Ts'o 45a78b88db resize2fs: refine minimum required blocks for flex_bg file systems
The previous commit exposed bugs in the calculation for flex_bg file
systems.  The problem is that since (by default) we keep the metadata
blocks for the flex_bg in the first block group of the flex_bg, and
because we don't want to overwrite metadata blocks used by the
original file system with data blocks make life easier in case the
resize is aborted for some reason, we need to treat all of the
metadata blocks in the existing flex_bg has in use for the purposes of
calculate_minimum_resize_size().

Even though this means we need to reserve more data blocks to avoid
running out of space, the net result of these two commits is a net
savings in how much we can shrink a file system.

Using the following test sequence:

	mke2fs -F -t ext4 /tmp/foo.img 2T
	resize2fs -M /tmp/foo.img
	resize2fs -M /tmp/foo.img
	resize2fs -M /tmp/foo.img

Here is the comparison in the resulting file systems between the old
and new resize2fs (units are in 4k blocks):

                resize #1  resize #2   resize #3
old resize2fs    1117186     45679       43536
new resize2fs      48784     37413       37392

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-04 23:15:49 -04:00
Theodore Ts'o b4f30fcfe6 resize2fs: fix overly-pessimistic calculation of minimum size required
For extent-mapped file systems, we need to reserve some extra space in
case we need to grow the extent tree.  Calculate the safety margin
more intelligently, so we don't overestimate the amount of space
required.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reported-by: Dmitry Monakhov <dmonakhov@openvz.org>
2014-05-04 23:15:49 -04:00