Whamcloud - gitweb
Theodore Ts'o [Thu, 17 Nov 2011 20:35:00 +0000 (15:35 -0500)]
debugfs: fix gcc -Wall complaints
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 17 Nov 2011 20:15:38 +0000 (15:15 -0500)]
debugfs: add filefrag command
Add the ability to report on the fragmentation of a file on a file
system opened using debugfs.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 15 Nov 2011 04:31:24 +0000 (23:31 -0500)]
debugfs: add the freefrag command
The freefrag command provides the functionality of e2freefrag on the
currently open file system in debugfs.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 15 Nov 2011 03:01:52 +0000 (22:01 -0500)]
debugfs: build read-only variant of debugfs
Create a version of debugfs which only supports read-only examination
of the file system metadata (but not the data blocks). The idea is
that this version of debugfs might be suitable to be setuid root, and
executable only by members of a particular group, or setgid disk, and
globally executable, depending on the security/privacy policies in
force at a particular site.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 14 Nov 2011 18:33:17 +0000 (13:33 -0500)]
libquota: log an error message if ext2fs_file_open() fails
This also fixes a format string type compiler warning.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Niu Yawei [Mon, 14 Nov 2011 16:36:12 +0000 (11:36 -0500)]
libquota: fix get_dq()
The dq_id should be set on newly created dqout.
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Niu [Mon, 14 Nov 2011 15:58:28 +0000 (10:58 -0500)]
libquota: fix quota usage compute
In quota_compute_usage(), the space usage should be in bytes but
not quota block.
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Niu [Mon, 14 Nov 2011 15:58:28 +0000 (10:58 -0500)]
tune2fs: preserve old limits when turn on quota feature
When turn on quota by tune2fs, if the old quota file exist, the quota
usage should be recomputed but the old limits should be preserved.
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Niu [Mon, 14 Nov 2011 15:58:28 +0000 (10:58 -0500)]
libquota: quota file read support
This patch adds read quota file support, which includes:
- Improve scan dquot APIs & fix defects in scan dquot functions;
- Implement quota_file_open();
- Introduce quota_update_inode() to update usage in old quota file,
and keep the limits unchanged.
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Aditya Kali [Mon, 14 Nov 2011 15:55:54 +0000 (10:55 -0500)]
mke2fs: Add extended option to select quota type
mke2fs was creating both user and group quota inodes on enabling
the quota feature. This patch adds the extended option 'quotatype'
that can be used to exclusively specify the quota type that the
user wants to initialize.
# Ex: Default behavior without extended option creates both
# user and group quota inodes:
$ mke2fs -t ext4 -O quota /dev/ram1
# To enable only user quotas:
$ mke2fs -t ext4 -O quota -E quotatype=usr /dev/ram1
# To enable only group quotas:
$ mke2fs -t ext4 -O quota -E quotatype=grp /dev/ram1
Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Aditya Kali [Mon, 14 Nov 2011 15:55:54 +0000 (10:55 -0500)]
tune2fs: Compute quota usage when turning on the 'quota' feature
When turning on the quota feature, tune2fs would create empty quota inodes and
set their inode numbers in superblock. This required e2fsck to be ran before
using the quota feature. This patch adds adds call to compute_quota() and make
sure that we write correct quota information in the quota files at tune2fs time
itself. This gets rid of the necessity for running e2fsck after setting the
quota feature. Also, tune2fs now does not use existing old quota files
(aquota.user and aquota.group) even if they exist.
Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Aditya Kali [Mon, 14 Nov 2011 15:55:54 +0000 (10:55 -0500)]
libquota: cleanup libquota code
This patch cleans up the quota code as suggested in previous reviews. This
includes
* remove BUG_ON()s and 'exit()' calls from library code
* remove calls to malloc/free and instead use ext2fs_get/free_mem functions.
* lib/quota/common.c file in not needed anymore and is removed.
* rename exported functions to start with quota_
(ex: init_quota_context --> quota_init_context)
* better error handling in quota library
Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 14 Nov 2011 15:40:43 +0000 (10:40 -0500)]
Make quota support disabled by support
Quota support can be enabled using --enable-quota. There are still
some buglets that we need to fix up before it can be considered 100%
supported, so let's disable it for the 1.42 release.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Robin Dong [Sat, 12 Nov 2011 02:15:55 +0000 (21:15 -0500)]
e2freefrag: fix "Illegal block number" errors with bigalloc file systems
After:
# mke2fs -O ^has_journal,^resize_inode,^uninit_bg,extent,meta_bg,flex_bg,bigalloc /dev/sda
# e2freefrag /dev/sda
It will report error message like:
Illegal block number passed to ext2fs_test_block_bitmap #1732133 for block bitmap for /dev/sda
Illegal block number passed to ext2fs_test_block_bitmap #1732134 for block bitmap for /dev/sda
Illegal block number passed to ext2fs_test_block_bitmap #1732135 for block bitmap for /dev/sda
One bit in bitmap of bigalloc-ext4 means a cluster not a block,
therefore ext2fs_fast_test_block_bitmap2 should check cluster.
Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Sat, 12 Nov 2011 02:11:43 +0000 (21:11 -0500)]
tests: fix mmp tests on hard 4k devices
Several of the mmp tests were failing on an s390 guest because
direct IO cannot be done on sub-sector sizes, and they were
doing 1k IOs to files on a 4k logical/physical device.
A few tests could just be changed to 4k, but others
needed fixed up output as well.
With this I have all tests passing on s390 again.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Sat, 12 Nov 2011 02:06:04 +0000 (21:06 -0500)]
libext2fs: fix write size in ext2fs_mmp_write
Without this change, we will write data past the end of the
mmp buf. Valgrind catches this:
==6373== Syscall param write(buf) points to unaddressable byte(s)
==6373== at 0x362260E470: __write_nocancel (in /lib64/libpthread-2.12.2.so)
==6373== by 0x41CF83: raw_write_blk (unix_io.c:255)
==6373== by 0x41D2BC: unix_write_blk64 (unix_io.c:757)
==6373== by 0x41A05D: ext2fs_mmp_write (mmp.c:130)
==6373== by 0x40B0C9: do_set_mmp_value (set_fields.c:806)
==6373== by 0x421B61: really_execute_command (execute_cmd.c:108)
==6373== by 0x421C54: ss_execute_line (execute_cmd.c:234)
==6373== by 0x403743: main (debugfs.c:2339)
==6373== Address 0x63f000 is not stack'd, malloc'd or (recently) free'd
and in my testing it led to silent failures while writing the mmp
block in debugfs:
write(3, "xV4\22PMM\342\325V\274N\0\0\0\0host.name."..., 4096) = -1 EFAULT (Bad address)
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Sat, 12 Nov 2011 02:06:04 +0000 (21:06 -0500)]
debugfs: tidy up mmp handling
Several small fixes:
* Gracefully fail mmp commands if fs is not open
* Show magic number in dump_mmp command
* Fix header in output for set_mmp_value -l
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Sat, 12 Nov 2011 02:06:04 +0000 (21:06 -0500)]
debugfs.8: add documentation of the mmp commands
Document the dump_mmp and set_mmp_value commands in
the debugfs manpage.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 10 Nov 2011 12:33:02 +0000 (07:33 -0500)]
libext2fs: use HAVE_FSTAT64 instead of HAVE_STAT64 for ext2fs_stat()
Commit
6b56f3d92d introduced the use of HAVE_STAT64 without arranging
that it be defined in configure.in. Previously ext4.h used
HAVE_OPEN64, but apparently there are (broken) platforms that have
open64() but not stat64(). Go figure.
We do need to consistently use a single test for ext2fs_stat(),
ext2fs_fstat(), and struct ext2fs_struct_stat, or we could end up
passing a struct stat64 to a fstat() system call, or some such. I've
elected to use HAVE_FSTAT64 because: (a) it's already defined in the
configure script, and (b) if we ever come across a really broken
platform that defines fstat64() but not stat64(), we can always
emulate stat64() using open64() followed by a fstat64().
This commit fixed a bug whose symptoms were that mke2fs would not work
if given a file > 2GB on 32-bit platforms.
Addresses-Debian-Bug: #647245
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Thu, 10 Nov 2011 12:02:04 +0000 (07:02 -0500)]
libext2: advance group in ext2fs_open2 during swapping
Without this change, we go back to getting group descriptor
"0" each time we go around the "for i" loop. It must properly
advance through the filesystem.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 7 Nov 2011 01:27:04 +0000 (20:27 -0500)]
po: rebuild the .gmo files in the debian/rules file
This commit reverts commit
aff534958b0 and transfers the
responsibility of rebuilding the .gmo files to the debian/rules file,
as updating the gmo files can cause problems for other distribution's
building systems. (We do this because we don't update the .gmo files
when doing a mid-release snapshot, since binary files can't be
represented in diff files. So we only update the .po files, and let
the package build process take care of the .gmo files.)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 5 Nov 2011 18:51:51 +0000 (14:51 -0400)]
libext2fs: don't leak tdb_null out of the shared library namespace
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 17 Oct 2011 02:12:07 +0000 (22:12 -0400)]
Update for e2fsprogs 1.42-WIP-1016 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Göran Uddeborg [Mon, 17 Oct 2011 01:53:39 +0000 (21:53 -0400)]
po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jakub Bogusz [Mon, 17 Oct 2011 01:53:39 +0000 (21:53 -0400)]
po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Benno Schulenberg [Mon, 17 Oct 2011 01:53:39 +0000 (21:53 -0400)]
po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Samuel Thibault [Mon, 17 Oct 2011 01:53:39 +0000 (21:53 -0400)]
po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Philipp Thomas [Mon, 17 Oct 2011 01:53:39 +0000 (21:53 -0400)]
po: update de.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Petr Pisar [Mon, 17 Oct 2011 01:53:39 +0000 (21:53 -0400)]
po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 17 Oct 2011 01:50:26 +0000 (21:50 -0400)]
libext2fs: allow ext2fs_get_memalign() to compile w/o posix_memalign()
Addresses-Sourceforge-Bug: #3219173
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 17 Oct 2011 00:29:00 +0000 (20:29 -0400)]
libext2fs: ext2fs_[set_]file_acl_block needs to check for 64-bit feature flag
The ext2fs_file_acl_block() and ext2fs_set_file_acl_block() needs to
only check i_file_acl_high if the 64-bit flag is set. This is needed
because otherwise we will run into problems on Hurd systems which
actually use that field for h_i_mode_high.
This involves an ABI change since we need to pass ext2_filsys to these
functions. Fortunately these functions were first included in the
1.42-WIP series, so it's OK for us to change them now. (This is why
we have 1.42-WIP releases. :-)
Addresses-Sourceforge-Bug: #3379227
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 16 Oct 2011 23:29:40 +0000 (19:29 -0400)]
resize2fs: don't fail when shrinking an empty file system
This commit fixes a failure when running the commands:
dd if=/dev/zero of=fs bs=1k count=100k; mke2fs fs; resize2fs -Mp fs
We should not try truncating the file system if there is only a single
block group in the file system.
Addresses-Sourceforge-Bug: #3404051
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Lukas Czerner [Sun, 16 Oct 2011 22:18:51 +0000 (18:18 -0400)]
resize2fs: Do not fail if EXT4_IOC_RESIZE_FS ioctl doesn't exist
Commit
9f6ba888f027ba added support for new online resize ioctl
EXT4_IOC_RESIZE_FS. It is also trying to avoid failure when this
ioctl() is not supported by the kernel however it is checking wrong
error code (EINVAL).
When the ioctl does not exist, errno is set to ENOTTY, so we should
check for that, rather than EINVAL which means that ioctl arguments
are not valid. So change the code to check for ENOTTY and allow
resize2fs to try to use the old approach. Also add some comments.
Addresses-Red-Hat-Bugzilla: #746284
Addresses-Debian-Bug: #644989
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 10 Oct 2011 00:49:36 +0000 (20:49 -0400)]
Update for e2fsprogs 1.42-WIP-1009 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 10 Oct 2011 01:08:47 +0000 (21:08 -0400)]
debian: Add explicit source format to specify 3.0 (quilt)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Göran Uddeborg [Mon, 10 Oct 2011 01:11:55 +0000 (21:11 -0400)]
po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Samuel Thibault [Mon, 10 Oct 2011 01:11:55 +0000 (21:11 -0400)]
po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Petr Pisar [Mon, 10 Oct 2011 01:11:55 +0000 (21:11 -0400)]
po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 9 Oct 2011 22:18:01 +0000 (18:18 -0400)]
filefrag: fix infinite loop in filefrag
Commit
a00be17e4768 was missing a patch hunk needed to prevent
filefrag from looping forever when it is run without the -v option.
Addresses-Debian-Bug: #644792
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 9 Oct 2011 21:08:47 +0000 (17:08 -0400)]
Fix more spelling errors found by translators and add pluralization
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 9 Oct 2011 20:13:50 +0000 (16:13 -0400)]
po: add @-expansion for @q to the at-expand.pl script
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 9 Oct 2011 19:13:34 +0000 (15:13 -0400)]
e2fsck: fix problem message for PR_1_QUOTA_BAD_MODE
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 8 Oct 2011 17:50:10 +0000 (13:50 -0400)]
dumpe2fs.8.in: add man page warning about mounted file systems
This should be obvious, but apparently not to all users...
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Darrick J. Wong [Sat, 8 Oct 2011 17:36:52 +0000 (13:36 -0400)]
e2fsck: recover revoke blocks on 64bit filesystems correctly
Since the advent of 64bit filesystems, revoke blocks store 64-bit
block numbers instead of 32-bit block numbers. Therefore we need to
be able to handle that case.
Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 8 Oct 2011 17:32:00 +0000 (13:32 -0400)]
Fix spelling errors pointed out by translators
Also remove the _("<foo>") marker from a string that was all numbers
and hence didn't need punctuation.
Thanks to Philipp Thomas and Goeran Uddeborg for reporting these
buglets.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 8 Oct 2011 17:28:53 +0000 (13:28 -0400)]
debian: fix gcc-multilib dependency for mipsel as well as mips
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 7 Oct 2011 22:43:50 +0000 (18:43 -0400)]
debian: update the changelog for the e2fsprogs 1.42~WIP-2011-10-05-2 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 7 Oct 2011 22:01:31 +0000 (18:01 -0400)]
debian: add a mips-specific dependency on gcc-multilib
The debian mips package has to do some wierd things to include a
64-bit library in the 32-bit binary package.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 6 Oct 2011 17:28:07 +0000 (13:28 -0400)]
libext2fs: make ext2fs_open_file() always use 3 arguments instead of varargs
Some architectures have narrow mode_t's which can cause some
portability warnings with varargs.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 5 Oct 2011 19:32:36 +0000 (15:32 -0400)]
debian: Add a dependency on the 1.42~WIP-2011-1005-1 version of libcom_err
Addresses-Debian-Bug: #644425
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 5 Oct 2011 19:03:59 +0000 (15:03 -0400)]
uuidgen: don't use set_com_err_gettext()
The uuidgen program doesn't use libcom_err.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 5 Oct 2011 18:47:09 +0000 (14:47 -0400)]
e2fsck: make e2fsck sigcatcher use SIGCHLD rather than SIGCLD
SIGCHLD is more portable than SIGCLD, which is a Linux specific thing
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 5 Oct 2011 17:26:59 +0000 (13:26 -0400)]
libquota: remove flag argument to commit_dquot()
The flag parameter wasn't being used, and using it meant that we had
to define the COMMIT_* flags, which relied on the QIF_* flags being
present. Removing this allows for increased portability.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 5 Oct 2011 07:04:41 +0000 (03:04 -0400)]
debian: update libcomerr2.symbols
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 5 Oct 2011 07:03:44 +0000 (03:03 -0400)]
libcom_err: declare com_err_gettext to be static
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 5 Oct 2011 06:40:11 +0000 (02:40 -0400)]
Update for e2fsprogs 1.42-WIP-1005 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 5 Oct 2011 06:08:10 +0000 (02:08 -0400)]
Update e2fsprogs.pot file for translators
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Philipp Thomas [Wed, 5 Oct 2011 06:04:08 +0000 (02:04 -0400)]
po: update de.po (from translationproject.org)
Addresses-Debian-Bug: #520985
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Tue, 4 Oct 2011 22:12:11 +0000 (17:12 -0500)]
mke2fs: Fix up usage & error text for cluster size specification
Commit
c6ed60cd removed "f" (fragment size) from the getopt string,
and re-used its spot in the getopt switch, but didn't update the
usage message or the error message during parsing.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 5 Oct 2011 05:00:30 +0000 (01:00 -0400)]
Pass the gettext() function to libcom_err
For those e2fsprogs programs which use libcom_err and are
internationalized, pass the gettext() function to libcom_err during
program initialization.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 5 Oct 2011 04:58:40 +0000 (00:58 -0400)]
libcom_err: add set_com_err_gettext()
This function allows programs to pass in a pointer to the gettext
function so that error table strings will can be internationalized.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 5 Oct 2011 04:46:29 +0000 (00:46 -0400)]
po: add prof_err.c, ext2_err.c and uuidd.c to POTFILES.in
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 5 Oct 2011 04:39:40 +0000 (00:39 -0400)]
compile_et: generate *_err.c files that have strings marked for xgettext
This allows error code strings to be internationalized.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Oct 2011 15:57:53 +0000 (11:57 -0400)]
libquota: remove NLS support
In general libraries should never (a) call exit() or (b) print output
directly to the stdout (they might be used by GUI programs. From (b)
follows (c), should never call internationalization functions
directly.
Also, since po/POTFILES.in wasn't edited, these strings weren't
getting included in e2fsprogs.pot for translation, so the _()
indirection didn't actually buy us anything.
We eventually need to nuke all of the log_fatal() and log_err() from
libquota, so best thing to do for now is remove NLS support
completely; no point whipsawing the translators with strings to
translate that will be disappearing soon anyway!
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Oct 2011 15:46:21 +0000 (11:46 -0400)]
libquota: use ext2_loff_t instead of loff_t
The type loff_t is not portable. Use ext2_loff_t which handles this
for us.
Cc: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Oct 2011 15:38:47 +0000 (11:38 -0400)]
libquota: remove get_qf_name()
The get_qf_name() function used PATH_MAX, which is non-portable.
Worse, it blindly assumed that PATH_MAX was the size of the buffer
passed to it --- which in the one and only place where it was used in
libquota, was a buffer declared to a fixed size 256 bytes.
Fix this by simply getting rid of the function altogether.
Cc: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Oct 2011 15:20:50 +0000 (11:20 -0400)]
libquota: clean up some gcc -Wall warnings
Remove unused variables, places where 'return' was used with no value
in a non-void function, missing function declarations, etc. Don't
assume that all systems have quotactl(), and use <sys/quota.h> if it
exists to define the quotactl interfaces.
One of the unused variables also got rid of a non-portable use of
PATH_MAX.
Cc: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Oct 2011 14:42:56 +0000 (10:42 -0400)]
libquota: remove get_qf_path()
This function isn't used anywhere, so remove it. It also uses
PATH_MAX which is not portable.
Cc: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Oct 2011 14:36:47 +0000 (10:36 -0400)]
e2fsck: make the signal catcher more portable, take 2
One table got missed when adding #ifdef's so that e2fsck/sigcatcher.c
would compile on non-Linux systems.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Oct 2011 04:28:28 +0000 (00:28 -0400)]
Update debian/changelog for an interim release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Oct 2011 03:47:19 +0000 (23:47 -0400)]
libext2fs: fix bad cast which causes problems for file systems > 512EB
If the number of block groups exceeds 2**32, a bad cast would lead to
a bogus "Not enough space to build proposed filesystem while setting
up superblock" failure.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Oct 2011 03:46:17 +0000 (23:46 -0400)]
Add "big" and "huge" types to mke2fs.conf
mke2fs attempts to use the "big" and "huge" types, and now that mke2fs
will complain if there are file system types which are undefined,
let's add definitions for them.
Thanks to Richard Jones for reporting this problem.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Oct 2011 03:18:10 +0000 (23:18 -0400)]
po: rebuild the .gmo files if they are missing or out of date
This makes life easier to support patch updates for Debian when we are
getting lots of updates of .po files, since the .gmo files are binary
files that we don't really need to worry about.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Tue, 4 Oct 2011 03:11:25 +0000 (23:11 -0400)]
e2fsprogs: Fix thinko in ext2fs_initialize bigalloc case
Surely we should be setting s_clusters_per_group, not
s_blocks_per_group, to EXT2_MAX_CLUSTERS_PER_GROUP here.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Oct 2011 02:49:45 +0000 (22:49 -0400)]
libext2fs: move #include "ext2fs.h" from crc32c_defs.h to crc32c.c
The byte swap functions which are defined in ext2fs.h are only needed
by crc32.c, and not by gen_crc32ctable.c. The gen_crc32ctable program
needs to be compiled on the host OS, where ext2fs.h may not be
present. So move the use of the header function to crc32c.c, to avoid
compilation problems.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Oct 2011 00:35:19 +0000 (20:35 -0400)]
resize2fs: fix on-line resizing
On-line resizing has been broken in the 1.42 series for two reasons:
(a) the call to the new EXT4_IOC_RESIZE_FS ioctl checked for ENOTTY to
indicate that the ioctl does not exist, when in fact EINVAL is what is
returned if the ioctl doesn't exist. (b) resize2fs was passing in a
pointer to a 64-bit value, when the ioctl expected a 32-bit value.
This was OK on little-endian systems, but it wouldn't work at all on
big-endian systems.
Fix both problems.
Addresses-Debian-Bug: #451388
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 3 Oct 2011 18:57:51 +0000 (14:57 -0400)]
libext2fs, libquota: fix some makefile dependency issues
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Mon, 3 Oct 2011 17:16:48 +0000 (13:16 -0400)]
e2fsprogs: include headers for open() in ext2fs.h
ext2fs.h now calls open() so it should include the headers needed
for this system call as well.
Addresses-Red-Hat-Bugzilla: #742147
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Samuel Thibault [Mon, 3 Oct 2011 02:50:38 +0000 (22:50 -0400)]
po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Philipp Thomas [Mon, 3 Oct 2011 02:50:38 +0000 (22:50 -0400)]
po: update de.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sat, 1 Oct 2011 04:10:24 +0000 (00:10 -0400)]
Update for e2fsprogs 1.42-WIP-1001 release
Theodore Ts'o [Sat, 1 Oct 2011 04:08:12 +0000 (00:08 -0400)]
debian: avoid installing source.lintian-overrides
This avoids lintian errors if we try to rebuild the package since
source.lintian-overrides ends up getting installed in
debian/source/usr/src/lintian/overrides/source, which then gets
dropped in the diff file.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 1 Oct 2011 02:12:02 +0000 (22:12 -0400)]
Update e2fsprogs.pot file for translators
Theodore Ts'o [Sat, 1 Oct 2011 00:59:17 +0000 (20:59 -0400)]
e2fsck: avoid unnecessary reboots in some cases when checking the root fs
If e2fsck modifies certain superblock fields which the kernel doesn't
look at, mark the superblock as dirty without marking the file system
as changed. This will avoid e2fsck signalling the init scripts that a
reboot is necessary. This is safe, because the kernel doesn't
actually look at these superblock fields.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 30 Sep 2011 23:18:09 +0000 (19:18 -0400)]
filefrag: fix an off by one error in when printing the next expected block
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 30 Sep 2011 22:43:39 +0000 (18:43 -0400)]
filefrag: Display the number of contiguous, not physical, extents
From a bug report filed by Ibragimov Rinat:
When filefrag uses FIEMAP ioctl its logic differs for ordinary and
verbose (-v) modes. ext4 returns extent on every 32768 block so on
large files it is possible that `filefrag large-file' tells about 4
extents while `filefrag -v large-file' finds only one.
Also when I tried to use generic_block_fiemap function to add
FIEMAP for reiserfs, every block was reported as a new extent
resulting in thousands "extents" for continuous files.
I think filefrag should merge adjacent extents even when -v is not
specified.
Addresses-Debian-Bug: #631498
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 30 Sep 2011 22:32:44 +0000 (18:32 -0400)]
mke2fs.conf.5: clarify the man page regarding boolean relations
Explain more clearly how boolean relations in the mke2fs.conf file are
parsed, and which config parameters are in fact boolean relations.
Addresses-Debian-Bug: #634883
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Darrick J. Wong [Fri, 30 Sep 2011 19:41:26 +0000 (12:41 -0700)]
libext2fs: Always swab the MMP block on big-endian systems machines
The MMP code in libext2fs tries to gate MMP block swab'ing with this
test:
if (fs->super->s_magic == ext2fs_swab16(EXT2_SUPER_MAGIC))
However, EXT2FS_ENABLE_SWAPFS never seems to be defined anywhere (all
possible existed, the field fs->super->s_magic is always in host
byteorder, so the test always fails. So, we can change the #ifdef to
WORDS_BIGENDIAN (which is conditionally defined on BE platforms) and
get rid of the broken if test.
Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Darrick J. Wong [Fri, 30 Sep 2011 19:40:05 +0000 (12:40 -0700)]
e2fsck: zero ctx->fs after freeing fs when restarting due to MMP
If MMP is enabled and e2fsck determines that it needs to restart
itself on account of various MMP conditions, it will close the current
fs and jump back to the start of fs checking. However, closing fs
also frees it, which means that we need to set ctx->fs to NULL to
prevent subsequent open code from accessing the old deleted pointer.
Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Darrick J. Wong [Fri, 30 Sep 2011 19:38:43 +0000 (12:38 -0700)]
libext2fs: Fix various bugs from the metadata checksum integration
Fix several minor errors in structure definitions, the byteswap code,
and Makefiles that result from merging the crc32c and initial parts of
the metadata checksumming patchset.
Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 30 Sep 2011 20:38:26 +0000 (16:38 -0400)]
e2fsck: simplify binary search in ea_refcount.c
Remove the interpolation search in ea_refcount. The added complexity
isn't worth the speed up.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 29 Sep 2011 03:12:45 +0000 (23:12 -0400)]
debian: add hurd-specific mke2fs.conf file
Addresses-Debian-Bug: #629355
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 29 Sep 2011 02:45:12 +0000 (22:45 -0400)]
mke2fs: set s_max_mnt_count to -1 by default
If the enable_periodic_fsck option is false in /etc/mke2fs.conf (which
is also the default), s_max_mnt_count needs to be set to -1, instead
of 0. Kernels newer than 3.0 will interpret 0 to disable periodic
checks, but older kernels will print a warning message on each mount,
which will annoy users.
Addresses-Debian-Bug: #632637
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 29 Sep 2011 02:09:14 +0000 (22:09 -0400)]
e2fsck: make the signal catcher more portable
All of the signals which the signal catcher tries to interpret aren't
necessarily defined on all systems. So add #ifdef's to protect
various signals to avoid compilation failures on non-x86 platforms.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 29 Sep 2011 00:27:03 +0000 (20:27 -0400)]
libext2fs: use ext2fs byte swap functions for portability
The functions htole32(), le32toh(), be32toh(), htobe32() aren't
defined in all environments. Use the ext2fs byte swap functions for
portability.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 29 Sep 2011 00:08:37 +0000 (20:08 -0400)]
libquota: use ext2fs byte swapping functions for portability
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 28 Sep 2011 19:12:55 +0000 (15:12 -0400)]
e2fsck: check for invalid bad block inode
In some cases the bad block inode gets corrupted. If it looks insane,
offer to clear it before trying to interpret it does more harm than
good.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 25 Sep 2011 19:40:24 +0000 (15:40 -0400)]
debian: don't bomb out if DEB_BUILD_OPTIONS contains nostrip
The debugging packages will contain no debugging symbols (since they
are in the unstripped executables and libraries) but at least the
build won't crash.
Addresses-Debian-Bug: #627535
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 25 Sep 2011 05:52:03 +0000 (01:52 -0400)]
Update for e2fsprogs 1.42-WIP-0925 release
Theodore Ts'o [Sun, 25 Sep 2011 06:10:28 +0000 (02:10 -0400)]
Add spd_readdir.c to the contrib directory
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>