Whamcloud - gitweb
Andreas Dilger [Tue, 14 Feb 2012 15:54:59 +0000 (08:54 -0700)]
LU-656 build: update ChangeLog with release date
Update the ChangeLog for the 1.41.90.wc4 release date.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Niu Yawei [Fri, 10 Feb 2012 11:07:09 +0000 (03:07 -0800)]
LU-656 build: update ChangeLog
Update ChangeLog according to the recent commits.
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: Id6f07e9ef5035992400687ff9eb4d6eaa185ee39
Alexander.Boyko [Fri, 20 Jan 2012 08:22:54 +0000 (12:22 +0400)]
LU-968 e2scan: fix directory check
filelist_dblist_iterate_cb() checks whether a scanned inode is
a directory, but it didn't mask of the dir data size before
comparing the file type.
Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Xyratex-bug-id: MRP-309
Change-Id: I6f13f266944aa6967f4d9905a30b83ab8e577b15
Niu Yawei [Mon, 16 Jan 2012 08:20:24 +0000 (00:20 -0800)]
LU-752 lfsck: compare EA name correctly
In e2fsck_lfsck_find_ea(), it compares EA name by calling strncmp on the
EA name pairs directly, without length checking. This is wrong because
the passed in EA entry could be an empty entry with 0 EA name length,
or it's name could be a sub-string of the comparing one.
Singed-off-by: Ken Hornstein <kenh@cmf.nrl.navy.mil>
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: Ib79ea217e67a6702eee2f41155562a775f6c1578
Andreas Dilger [Tue, 17 Jan 2012 09:08:11 +0000 (04:08 -0500)]
Merge "LU-997 libext2fs: enforce a max nested link count" into master-lustre
Niu Yawei [Mon, 16 Jan 2012 09:01:10 +0000 (01:01 -0800)]
LU-997 libext2fs: enforce a max nested link count
Port the 'max nested link count' fix from upstream e2fsprogs:
Define EXT2FS_MAX_NESTED_LINKS as 8, and check the link count to make
sure we don't exceed it in ext2fs_find_block_device() and
follow_link(). This fixes a potential infinite loop in
ext2fs_find_block_device() if there are symbolic loop links in the
device directory.
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I30940cccfbbc8df8f3b31abed5a7038fb08c1ff6
Alexander.Boyko [Fri, 16 Dec 2011 22:11:48 +0000 (02:11 +0400)]
LU-934 e2fsck: copy EA from external inode, fix size check
This patch fixes the following issues:
- pass1.c check_ea_in_inode() compares e_value_size to fit in free
space of inode, but for xattr in external inode this is wrong.
- e2fsck_lfsck_find_ea() have no code to copy EA from external inode.
Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Xyratex-bug-id: MRP-291
Change-Id: I7bc556f0e2c9f300c8bc060b7e18167c93426644
Theodore Ts'o [Wed, 6 Jul 2011 00:35:46 +0000 (20:35 -0400)]
libext2fs: fix 64-bit support in ext2fs_bmap2()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 6 Jul 2011 00:02:27 +0000 (20:02 -0400)]
libext2fs: fix 64-bit support in ext2fs_{read,write}_inode_full()
This fixes a problem where reading or writing inodes located after the
4GB boundary would fail.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Andreas Dilger [Tue, 7 Jun 2011 16:22:29 +0000 (10:22 -0600)]
mke2fs: Don't erase flash device if "-n" is given
If "mke2fs -n" is used, there should be no changes to the underlying
device. Unfortunately, when the "discard" option was added in commit
c7cd908be59f48c66b4f3ac9a631ffe3dde4f1ab, it did not check for the "-n"
flag, and will discard all data on a flash device even if "-n" is given.
Check for the "noaction" flag before discarding any filesystem data.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Change-Id: I8ed6cfa06b6c6dd9ef3e64f1153eb1ec925ac312
Eric Sandeen [Mon, 4 Apr 2011 19:11:52 +0000 (15:11 -0400)]
mke2fs: don't set stripe/stride to 1 block
Block devices may set minimum or optimal IO hints equal to
blocksize; in this case there is really nothing for ext4
to do with this information (i.e. search for a block-aligned
allocation?) so don't set fs geometry with single-block
values.
Zeev also reported that with a block-sized stripe, the
ext4 allocator spends time spinning in ext4_mb_scan_aligned(),
oddly enough.
Reported-by: Zeev Tarantov <zeev.tarantov@gmail.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 8 May 2011 03:14:06 +0000 (23:14 -0400)]
e2fsck: make the "fs is mounted; continue?" prompt more paranoid
A user received the "file system is mounted; do you really want to
continue" prompt, and then instead of typing "n" for no, forgot that
he hadn't declined to continuation question, and typed the up-arrow
key, which in his locale, the 'A' in "^[[A" was interpreted as "yes",
and he lost data.
This was clearly the user's fault, but to make e2fsck a bit safer
against user stupidity/carelessness, we will change the "fs is
mounted; continue?" prompt to default to no, and treat the escape
character (along with the return and space characters, currently) as a
request for the default answer.
Addresses-Debian-Bug: #619859
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Andreas Dilger [Thu, 1 Sep 2011 19:36:45 +0000 (13:36 -0600)]
LU-656 build: update Lustre ChangeLog and version
Update build version to 1.41.90.wc4 for upcoming release.
Update patches/ChangeLog with recent commits for each release.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I1cdc91e4e1a712228125fa7eba1a96ad0d7010b2
Andreas Dilger [Thu, 1 Sep 2011 22:00:23 +0000 (16:00 -0600)]
LU-517 tests: don't fail mkstemp() on Lustre fs
The tst_read_ea test tries to find a filesystem with "user_xattr"
as a mount option (which the MDS mountpoint matches) and then tries
to create a temporary file in /mnt/mds via the VFS and read it back
via libext2fs and verify the value. Unfortunately, it is not
possible to create files in /mnt/mds, so the test fails.
If mkstemp() fails, just continue looking for a suitable ext3/4
filesystem to run the test on.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I4a11b9edd7adf3cc76f364e3a900811aa242b0c1
Andreas Dilger [Thu, 1 Sep 2011 19:33:49 +0000 (13:33 -0600)]
LU-656 tests: Fix miscellaneous compiler warnings
Fix compiler warnings in test programs when building on MacOS.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I759303d4d7eb06a2d8b85ea9cc9c70f3a0307cb8
Niu Yawei [Tue, 30 Aug 2011 09:10:41 +0000 (02:10 -0700)]
LU-647 Adding libcfs include path
- liblustreapi.h includes libcfs/posix/posix-types.h now, the
libcfs include path should be added.
- use e2fsprogs-RHEL-6.spec.in for CentOS-6.
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I4694c2957842918341f0736232ce6aa4ac85c2e0
Andreas Dilger [Wed, 15 Jun 2011 19:41:46 +0000 (13:41 -0600)]
LU-264 Use ext2fs_get_memalign() to align memory
Use the ext2fs_get_memalign() function that is available in newer
versions of e2fsprogs instead of open-coding it for the MMP block
buffer reads that use O_DIRECT.
Change-Id: I18702097fe2967614f9c1d2462a2436786bad70e
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Andreas Dilger [Tue, 14 Jun 2011 18:17:53 +0000 (11:17 -0700)]
Merge "LU-367 Clean up Lustre configure option handling" into master-lustre
Niu Yawei [Thu, 9 Jun 2011 08:58:39 +0000 (01:58 -0700)]
LU-264 Make tune2fs 64bits capable
- Replace io_channel_write_blk() with io_channel_write_blk64() in
ext2fs_mmp_write().
- Add EXT2_FLAG_64BITS for tune2fs
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: Ieee62e099b44d92c3221fba964c66fa904ae5549
Andreas Dilger [Tue, 31 May 2011 10:09:00 +0000 (04:09 -0600)]
LU-367 Clean up Lustre configure option handling
Cleanup up the configure option handling, so that --with-lustre and
--enable-lfsck are not explicitly stored in the instantiated configure
and e2fsprogs.spec files after configure generates them, unless they
were also specified on the configure command-line.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I0ee2f3876db728a3fffbc59134bc42e74ce826ec
Andreas Dilger [Tue, 31 May 2011 10:04:54 +0000 (04:04 -0600)]
LU-367 Handle DB->open errors without crashing
Remove the DB_INIT_LOCK call from the second db->open() call, since
this caused errors on the newer db4. We shouldn't need this anyway
because the databases are never opened concurrently in r/w mode.
If there is an error opening the MDSDB or OSTDB, print out a consistent
error message. In lfsck_run_checks() it didn't have enough function
arguments, so when the MDSDB failed to open (e.g. due to a different
version of db4 installed on the MDS, OSS, or client nodes) it caused
lfsck to crash afterward.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I65f9de6886c401315530d6b9e402ce8b1f84e8ce
Niu Yawei [Thu, 19 May 2011 09:42:05 +0000 (02:42 -0700)]
LU-264 MMP update
Integrate the MMP patch into our e2fsprogs
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: Id8330a9b72ac06427e5a89b3b94585f318306618
Andreas Dilger [Wed, 11 May 2011 08:48:14 +0000 (02:48 -0600)]
LU-193 fix f_messy_inode failure due to ibadness
The EXT4_XTIME_ANCIENT (ctime > s_mkfs_time) check was failing on i686
due to s_mkfs_time being uninitialized on the f_messy_inode test image.
On i686 this caused an underflow due to the 24h error margin for the
timestamp comparison to compensate for time zone errors.
Add -d to e2fsck runtime options for the failing f_messy_inode test
so that it prints when the inode badness is incremented. The debug
test output was generated on an x86_64 system and should pass on all
architectures.
Print failed test output at the time of failure to simplify debugging
when running in an automated test harness.
Change-Id: I9142cfb83e53552b7ded5a4052eeccc5a7efb3d2
Andreas Dilger [Mon, 9 May 2011 21:50:01 +0000 (15:50 -0600)]
LU-XXX: fix filefrag output for 0-block files
Based on a patch for upstream, fix the Lustre filefrag output to not
print "1 extent" for a file that has no data blocks. Also, do not
print the "extent format" header if not running in verbose mode.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Andreas Dilger [Thu, 5 May 2011 23:21:35 +0000 (17:21 -0600)]
LU-254: don't mark long extent symlinks bad
Long symlinks with the EXT4_EXTENTS_FL set should no longer be considered
as corrupt, since these are created by default with new kernels using ext4
as the filesystem type. This has not impacted Lustre in the past because
extents are only enabled on the OST, while symlinks are only created on the
MDT where extents are never enabled.
However, now that distros are using ext4 as the base filesystem type, if
the lustre-patched e2fsprogs RPM is installed it will incorrectly consider
all such long symlinks as bad and remove them.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Andreas Dilger [Thu, 28 Apr 2011 08:07:58 +0000 (02:07 -0600)]
LU-113: add .spec file for RHEL6 split packages
Add .spec file from RHEL6 to handle multiple split RPM packages to
avoid conflicts while installing the resulting e2fsprogs RPMs.
Fix warnings that result from building on a RHEL6 system.
Also resolve LU 44 build problem when --disable-lfsck is given.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ib6b7e6789aed75ab2afd12e216605552498613c7
bruce [Fri, 18 Mar 2011 17:40:00 +0000 (10:40 -0700)]
LU-135 Fixes for builds against Lustre 1.8.1 to 2.x.
This patch set is for e2fsprogs v1.41.14-161-g7d9e316
This patch set includes changes from Andeas Dilger:
Author: Andreas Dilger <adilger@whamcloud.com>
Date: Fri Mar 11 01:54:51 2011 -0700
LU-45 update e2fsprogs for pre-1.42 build
This e2fsprogs release adds support for filesystems > 16TB.
Update the lfsck code to build and run with both 1.8.x and 2.1.
Zero large inode space when expanding inode to avoid leaving garbage.
Validate inode creation time caused by non-zeroed large inode space.
Change-Id: Iebac0d6147cacc386e5c1a0a44df57785ad7c8fd
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I243c2520a99113db31dd499d2d706ca7c6f7f41f
Signed-off-by: B.Cassidy <bruce@whamcloud.com>
Lukas Czerner [Mon, 24 Jan 2011 19:52:00 +0000 (20:52 +0100)]
mke2fs: Display progress report during the device discard
For some time now we are doing initial discard of the device prior to
filesystem creation. However, there is no feedback for the user and
hence on some devices with slow TRIM implementation it may appear that
mke2fs is stuck.
This commit introduce new function mke2fs_discard_device(), which is a
wrapper for io_channel_discard(). The discard is done in chunks of
2GB, which seems reasonably well for both slow and fast devices, and
discard progress is reported back to the user.
I gave up on doing fancy things like align discard according to
discard_alignment, checking for discard granularity and computing
estimate time. First of all, because it would require either new ioctl
to retrieve those information or use of libudev library, none of it
seems to be worth it. Regarding discard_granularity, I doubt there is
any sane device with discard granularity that big it would affect this.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 21 Feb 2011 02:54:43 +0000 (21:54 -0500)]
Merge branch 'maint' into next
Conflicts:
misc/mke2fs.conf.5.in
Lukas Czerner [Tue, 1 Feb 2011 16:56:41 +0000 (17:56 +0100)]
mke2fs: Simple man page nodiscard option correction
It is not true that 'nodiscard' is set as default, so remove this
sentence. The default is 'discard' and it is properly documented in man
page.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Thu, 17 Feb 2011 21:56:17 +0000 (15:56 -0600)]
e2fsprogs: enable user namespace xattrs by default
User namespace xattrs are generally useful, and I think extN
is the only filesystem requiring a special mount option to
enable them, when xattrs are otherwise available. So this
change sets that mount option into the defaults, via a
mke2fs.conf option.
Note that if xattrs are config'd off, this will lead to a
mostly-harmless:
EXT4-fs (sdc1): (no)user_xattr options not supported
message at mount time...
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Thu, 17 Feb 2011 21:55:15 +0000 (15:55 -0600)]
e2fsprogs: turn off enforced fsck intervals by default
The forced fsck often comes at unexpected and inopportune moments,
and even enterprise customers are often caught by surprise when
this happens. Because a filesystem with an error condition will
be marked as requiring fsck anyway, I submit that the time-based
and mount-based checks are not particularly useful, and that
administrators can schedule fscks on their own time, or tune2fs
the enforced intervals if they so choose. This patch disables the
intervals by default, and I've added a new mkfs.conf option to
turn on the old behavior of random, unexpected, time-consuming
fscks at boot time. ;)
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Wed, 16 Feb 2011 18:01:39 +0000 (12:01 -0600)]
e2fsprogs: create com_err.h link in includedir
After debian bug #192277, debian/rules started making a symlink
to com_err.h in /usr/include. Now I have Fedora bug #550889
for the same issue, and perhaps it's time to make this link
by default, rather than fixing it up in packaging steps?
[ Changed by tytso to remove the explicit -s option; this will default
to creating a hard link by default, which slightly faster. If
people want to use symlinks for all links during the install
process, they can use configure option --enable-symlink-install.
The reason for this change is that some file systems, like AFS,
don't support symlinks, and AFS users complain when they can't build
or install into AFS. So I don't want to use symlinks
unconditionally without a way of switching things back and forth,
and it's easier if we just make all links made during the install
process to be hard links or sym links. ]
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 20 Feb 2011 20:29:51 +0000 (15:29 -0500)]
badblocks: Add accounting for different types of errors
When using the -v option, report a breakdown of the number of read,
write, and comparison errors that were found by badblocks.
Thanks to Ragnar Kjørstad for providing this patch.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 20 Feb 2011 20:19:47 +0000 (15:19 -0500)]
badblocks: Fix up recover_block handling in badblocks
If there was a bad block for block #0, badblocks would never switch
back testing blocks more efficiently. In addition, we were
double-incrementing the blocks to be tested in the read/write test due
to failure to remove code.
Thanks to Ragnar Kjørstad for pointing these problems out.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 18 Feb 2011 06:19:05 +0000 (01:19 -0500)]
Merge branch 'maint' into next
Theodore Ts'o [Fri, 18 Feb 2011 03:58:21 +0000 (22:58 -0500)]
badblocks: Only report errors when reading/writing one block at a time
With Direct I/O, the kernel can report 0 bytes read even though the
first block has no errors. So there are any errors, we need try to
read/write blocks one at a time and to get an accurate report.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 17 Feb 2011 04:40:46 +0000 (23:40 -0500)]
badblocks: Add the -B option which forces the use of buffered I/O
If for some reason direct I/O does not work correctly, force the use
of buffered I/O.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 17 Feb 2011 04:35:49 +0000 (23:35 -0500)]
badblocks: Fix bug so that O_DIRECT mode is correctly entered
The check to see if the block number is properly aligned was not done
correctly. Fix this.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 11 Feb 2011 00:04:46 +0000 (19:04 -0500)]
Merge branch 'maint' into next
Samuel Thibault [Fri, 11 Feb 2011 00:03:42 +0000 (19:03 -0500)]
po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jim Meyering [Tue, 1 Feb 2011 18:25:35 +0000 (19:25 +0100)]
filefrag: remove useless assignment
The very next one memset's all bytes of fiemap to 0.
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Dark Raven [Wed, 26 Jan 2011 23:54:25 +0000 (18:54 -0500)]
po: update zh_CN.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Philipp Thomas [Wed, 26 Jan 2011 23:54:24 +0000 (18:54 -0500)]
po: update de.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 24 Jan 2011 20:23:56 +0000 (15:23 -0500)]
po: update id.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Clytie Siddall [Mon, 24 Jan 2011 20:03:44 +0000 (15:03 -0500)]
po: update vi.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Göran Uddeborg [Mon, 24 Jan 2011 20:03:43 +0000 (15:03 -0500)]
po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jakub Bogusz [Mon, 24 Jan 2011 20:03:43 +0000 (15:03 -0500)]
po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Benno Schulenberg [Mon, 24 Jan 2011 20:03:42 +0000 (15:03 -0500)]
po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Samuel Thibault [Mon, 24 Jan 2011 20:03:42 +0000 (15:03 -0500)]
po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Philipp Thomas [Mon, 24 Jan 2011 20:03:41 +0000 (15:03 -0500)]
po: update de.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Petr Pisar [Mon, 24 Jan 2011 20:03:41 +0000 (15:03 -0500)]
po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 7 Jan 2011 21:38:13 +0000 (16:38 -0500)]
resize2fs: fix computation of the real end of the bitmap to be 64-bit
real_end had been previously declared with a bogus type, which is why
this was missed earlier.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Kazuya Mio [Sun, 19 Dec 2010 22:01:24 +0000 (22:01 +0000)]
e4defrag: Use libext2fs to get the correct superblock information
Currently, e4defrag always does byte-swapping when it gets superblock
information, so the calculation of the best extents count is not
correct on little endian machine. This doesn't cause data corruption,
but it may confuse users by showing the wrong extent count. To solve
this problem, we use ext2fs_open() instead of get_superblock_info()
that is the original function.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 24 Dec 2010 20:19:44 +0000 (15:19 -0500)]
configure: control whether e4defrag is built/installed via --disable-defrag
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kazuya Mio [Thu, 18 Nov 2010 21:51:25 +0000 (21:51 +0000)]
e4defrag: fix segfault when e4defrag races with unlink/truncate
If a file gets deleted or truncated while e4defrag is trying to
operate on it, it's possible for it seg fault.
Addresses-Red-Hat-Bugzilla: #641926
Reported-by: Michal Piotrowski <mkkp4x4@gmail.com>
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 23 Dec 2010 00:00:21 +0000 (19:00 -0500)]
Merge branch 'maint' into next
Conflicts:
resize/resize2fs.c
Theodore Ts'o [Wed, 22 Dec 2010 23:55:15 +0000 (18:55 -0500)]
Update Release Notes, Changelogs, version.h, etc. for 1.41.14 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Dec 2010 23:31:36 +0000 (18:31 -0500)]
mke2fs: don't complain if the fs type "default" is not defined in mke2fs.conf
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Dec 2010 23:22:40 +0000 (18:22 -0500)]
mke2fs: take the device size into account when determining the size type
If the file system size was not specified on the command line, we were
always using the usage type "floppy" since we didn't determine the
device size until after calling parse_fs_types(). Doh!
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Tue, 21 Dec 2010 21:32:05 +0000 (15:32 -0600)]
resize2fs: do not clear resize inode for 0 resvd blocks
I ran into odd behavior where mkfs.ext4 of a 16T filesystem would
create a resize inode with 0 reserved blocks, and mark the resize_inode
feature.
A subsequent slight downward resize of the filesystem would remove
the resize inode, making any further offline resizing impossible.
This is especially odd in light of the fact that a large downward
resize (say, to 8T) will actually add blocks to the resize inode -
so a small resize removes it, a large resize expands it ...
commit
8ade268cf2fde8629b51bfd1c044a83db88234cd had added this:
If the filesystem is grown to the point where the resize_inode is no
longer needed, clean it up properly so e2fsck doesn't have to.
but, it seems e2fsck does not care about this situation, either.
So, simply leave the resize_inode intact in this case, and everything
seems to be happy.
Note, this is for the 1.41.xx branch.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Dec 2010 18:53:02 +0000 (13:53 -0500)]
libext2fs: Don't use the extended rec_len encoding for standard file systems
If the file system has a blocksize less than 64k, then don't use the
extended rec_len encoding, to be consistent with what the kernel will
do.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Namhyung Kim [Mon, 29 Nov 2010 08:55:17 +0000 (17:55 +0900)]
mke2fs.8.in: add ENVIRONMENT section
Add ENVIRONMENT section and describe behavior of MKE2FS_SYNC,
MKE2FS_CONFIG, MKE2FS_FIRST_META_BG, MKE2FS_DEVICE_SECTSIZE
and MKE2FS_SKIP_CHECK_MSG.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Namhyung Kim [Mon, 29 Nov 2010 08:55:16 +0000 (17:55 +0900)]
libext2fs: fix possible memory leak in write_journal_inode()
ext2fs_zero_block2() allocates static buffer if needed so it
should be freed at last (call it again with 0 args).
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 22 Dec 2010 02:57:02 +0000 (21:57 -0500)]
mke2fs: clean up error handling in mke2fs_setup_tdb()
Avoid memory leaks on error paths, and make sure we issue the correct
error messages in the case of (highly) unlikely errors.
Original patch submitted by Namhyung Kim <namhyung@gmail.com>, but
highly rewritten since then.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Namhyung Kim [Thu, 16 Dec 2010 09:40:40 +0000 (18:40 +0900)]
mke2fs: add some error checks into PRS()
Check return value of some functions and exit if unhandled error occurred.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Namhyung Kim [Mon, 29 Nov 2010 08:55:13 +0000 (17:55 +0900)]
mke2fs: fix determination of size_type
In original code, 'huge' type could not be selected because it
always be caught for 'big' type. Change the ordering.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Namhyung Kim [Mon, 29 Nov 2010 08:55:12 +0000 (17:55 +0900)]
mke2fs.8.in: add missing "big" and "huge" usage-type description
The commit
493024ea1d74e4cb48aac3a24111f5c8da343e9f ("mke2fs: Fix up the
fs type and feature selection for 64-bit blocks") added 'big' and 'huge'
usage-type but was missing description in man page. Add it.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 21 Dec 2010 23:12:12 +0000 (18:12 -0500)]
mke2fs: Avoid potential NULL dereference
... in the very unlikely case that e2p_os2string fails to allocate
memory.
Reported-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 21 Dec 2010 23:05:07 +0000 (18:05 -0500)]
ext2fs: fix memory leak in an error case in inode_open()
Reported-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 20 Dec 2010 15:57:29 +0000 (10:57 -0500)]
libext2fs: fix potential free() of garbage in ext2fs_update_bb_inode()
There was a potential of freeing an uninitialized pointer in
rec.block_buf, which was pointed out by Namhyung Kim <namhyung@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Namhyung Kim [Mon, 29 Nov 2010 08:55:07 +0000 (17:55 +0900)]
libext2fs: fix dubious code in ext2fs_unmark_generic_bitmap()
Looks like a copy & paste problem to me.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Namhyung Kim [Mon, 29 Nov 2010 08:55:06 +0000 (17:55 +0900)]
libext2fs: remove unnecessary casts to ext2fs_generic_bitmap
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 20 Dec 2010 15:42:57 +0000 (10:42 -0500)]
mke2fs: Use ext2fs_div_ceil to simplify write_inode_tables()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Namhyung Kim [Mon, 20 Dec 2010 15:07:10 +0000 (10:07 -0500)]
libext2fs: fix dubious code in ext2fs_numeric_progress_init()
Looks like a copy & paste problem to me.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Namhyung Kim [Mon, 20 Dec 2010 15:07:10 +0000 (10:07 -0500)]
libext2fs: fix potential build failure with OMIT_COM_ERR
This fixes following build failure when OMIT_COM_ERR is defined:
lib/ext2fs/gen_bitmap.c: In function ‘ext2fs_clear_generic_bitmap’:
lib/ext2fs/gen_bitmap.c:437: error: invalid storage class for function ‘ext2fs_test_clear_generic_bitmap_range’
lib/ext2fs/gen_bitmap.c:559: error: expected declaration or statement at end of input
lib/ext2fs/gen_bitmap.c: In function ‘ext2fs_get_generic_bitmap_end’:
lib/ext2fs/gen_bitmap.c:559: error: expected declaration or statement at end of input
lib/ext2fs/gen_bitmap.c: In function ‘ext2fs_get_generic_bitmap_start’:
lib/ext2fs/gen_bitmap.c:559: error: expected declaration or statement at end of input
lib/ext2fs/gen_bitmap.c: In function ‘ext2fs_unmark_generic_bitmap’:
lib/ext2fs/gen_bitmap.c:559: error: expected declaration or statement at end of input
lib/ext2fs/gen_bitmap.c: In function ‘ext2fs_mark_generic_bitmap’:
lib/ext2fs/gen_bitmap.c:559: error: expected declaration or statement at end of input
lib/ext2fs/gen_bitmap.c: In function ‘ext2fs_test_generic_bitmap’:
lib/ext2fs/gen_bitmap.c:559: error: expected declaration or statement at end of input
make[2]: *** [gen_bitmap.o] Error 1
make[2]: Leaving directory e2fsprogs/lib/ext2fs'
make[1]: *** [all-libs-recursive] Error 1
make[1]: Leaving directory e2fsprogs'
make: *** [all] Error 2
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 20 Dec 2010 15:06:58 +0000 (10:06 -0500)]
Merge branch 'maint' into next
Conflicts:
lib/ext2fs/block.c
lib/ext2fs/csum.c
resize/main.c
Theodore Ts'o [Fri, 17 Dec 2010 04:20:11 +0000 (23:20 -0500)]
Merge branch 'master' into next
Conflicts:
e2fsck/e2fsck.h
e2fsck/unix.c
Theodore Ts'o [Fri, 17 Dec 2010 03:53:34 +0000 (22:53 -0500)]
e4defrag: Fix the overflow in e4defrag with > 2GB files
The fallocate() interface on 32-bit machines is defined to use off_t,
not loff_t (even though the system call interface is 64-bit clean).
This causes e4defrag to fail on files greater than 2GB. Fix this by
trying to use fallocate64(), and using the hard-coded syscall if it
does not exist.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 17 Dec 2010 03:11:43 +0000 (22:11 -0500)]
libext2fs: Fix compile bug on big-endian architectures
Addresses-Sourceforge-Bug: #3138115
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 17 Dec 2010 00:34:24 +0000 (19:34 -0500)]
libext2fs: fix ref_offset callback with sparse files in ext2fs_block_iterate2()
Addresses-Sourceforge-Bug: 3081087
Reported-by: vmo@users.sourceforge.net
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Thu, 16 Dec 2010 04:37:34 +0000 (22:37 -0600)]
resize2fs: handle exactly-16T filesystems in resize2fs
Before we go whole-hog on 64-bit e2fsprogs, I wonder if this
is worth considering as a last-minute addition to the 1.41
stream. Currently, mke2fs will shave a block off an exactly-16T
device to fit*, but resize2fs does not do the same, leading
to some asymmetry. This patch fixes that up, and allows 16T
devices to be handled more gracefully in offline resize.
(in fact resize2fs will not even open a 16T device, today).
*commit
37d17a65ecb4615546b417038190a41bafca7c51
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Tue, 14 Dec 2010 19:00:01 +0000 (13:00 -0600)]
e2fsprogs: fix type-punning warnings
Flags used during RHEL/Fedora builds lead to a couple type-punning
warnings:
recovery.c: In function 'do_one_pass':
recovery.c:539: warning: dereferencing type-punned pointer will break strict-aliasing rules
./csum.c: In function 'print_csum':
./csum.c:170: warning: dereferencing type-punned pointer will break strict-aliasing rules
The two changes below fix this up.
Note that the csum test binary output changes slightly, but this does
not break any tests.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kazuya Mio [Mon, 13 Dec 2010 14:59:07 +0000 (09:59 -0500)]
e4defrag: update man page about -c option
Add the description of the size per one extent and the maximum extent size
in ext4 into e4defrag man page.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kazuya Mio [Mon, 13 Dec 2010 14:59:07 +0000 (09:59 -0500)]
e4defrag: avoid unsuccessful return for an non-privileged user
If non-privileged user runs e4defrag, e4defrag returns an exit status
of 1 despite its success. This patch fixes this problem.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kazuya Mio [Mon, 13 Dec 2010 14:59:06 +0000 (09:59 -0500)]
e4defrag: fix file blocks calculation
e4defrag uses st_blocks (struct stat) to calculate file blocks. However,
st_blocks also has meta data blocks in addition to file blocks. So, we
calculate file blocks by sum of the extent length.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kazuya Mio [Mon, 13 Dec 2010 14:57:26 +0000 (09:57 -0500)]
e4defrag: output size per extent by -c option
e4defrag with -c option outputs "ratio" that means the levels of
fragmentation. However, it's difficult for users to understand, so we will
use size per extent instead of ratio.
Before:
# e4defrag -c /mnt/mp1/file
<File> now/best ratio
/mnt/mp1/file 6/1 0.00%
Total/best extents 6/1
Fragmentation ratio 0.00%
Fragmentation score 0.04
[0-30 no problem: 31-55 a little bit fragmented: 55- needs defrag]
This file(/mnt/mp1/file) does not need defragmentation.
Done.
After:
# e4defrag -c /mnt/mp1/file
<File> now/best size/ext
/mnt/mp1/file 6/1 16666 KB
Total/best extents 6/1
Average size per extent 16666 KB
Fragmentation score 0
[0-30 no problem: 31-55 a little bit fragmented: 56- needs defrag]
This file (/mnt/mp1/file) does not need defragmentation.
Done.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Peng Tao [Mon, 13 Dec 2010 14:44:57 +0000 (09:44 -0500)]
e4defrag: return more specific error message on ioctl failure
Currently e4defrag relies on the EXT4_IOC_MOVE_EXT ioctl to perform online
defragmentation. However, this iotcl kernel patch is not available before
2.6.30-rc1. e4defrag shall fail without obvious reasons on systems running
older kernels. The patch adds more detailed error message addressing this
issue and prompts users with the minimal kernel version that is needed to
run e4defrag.
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Tue, 8 Sep 2009 06:13:50 +0000 (06:13 +0000)]
e4defrag: skip "rootfs" entry when checking for ext4 filesystem
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Darrick J. Wong [Mon, 13 Dec 2010 14:23:45 +0000 (09:23 -0500)]
e4defrag: open the file to be defragged in read/write mode
Akira Fujita merged a patch into 2.6.33 that adds a requirement that a
file being defragged must be opened with read and write access, so
e2fsprogs needs to satisfy that.
Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 13 Dec 2010 14:16:09 +0000 (09:16 -0500)]
Merge branch 'maint' into next
Conflicts:
e2fsck/pass4.c
misc/dumpe2fs.c
resize/online.c
Theodore Ts'o [Mon, 13 Dec 2010 13:57:14 +0000 (08:57 -0500)]
Update Release Notes, Changelogs, version.h, etc. for 1.41.13 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Bernd Schubert [Fri, 12 Nov 2010 23:09:07 +0000 (00:09 +0100)]
e2fsck: add an option which causes it to only do a journal replay
As recently discussed on linux-ext4@vger.kernel.org add an option to e2fsck
to allow to replay the journal only. That will allow scripts, such as
pacemakers 'Filesystem' RA to first replay the journal and if that sets
an error state from the journal replay, further check for that error
(dumpe2fh -h | grep "Filesystem state:") and if that shows and error
to refuse to mount. It also allows automatic e2fsck scripts to first
replay the journal and on a second run after the real pass1 to passX checks
to test for the return code.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 6 Dec 2010 22:07:27 +0000 (17:07 -0500)]
e2fsck: Do blkid interpretation on the external journal specifier
If the user specifies "e2fsck -j UUID=XXX", e2fsck should do blkid
interpretation, since e2fsck does it with the base file system name.
So from the sake of consistency and user convenience, we should do it
here too.
Addresses-Debian-Bug: #559315
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 6 Dec 2010 15:10:33 +0000 (10:10 -0500)]
e2fsck: Add the ability to force a problem to not be fixed
The boolean options "force_no" in the problems stanza of e2fsck.conf
allows a particular problem code be treated as if the user will answer
"no" to the question of whether a particular problem should be fixed
--- even if e2fsck is run with the -y option.
As an example use case, suppose a distribution had widely deployed a
version of the kernel where under some circumstances, the EOFBLOCKS_FL
flag would be left set even though it should not be left set, and a
customer had a workload which exercised the fencepost error all the
time, resulting in many large number of inodes that had EOFBLOCKS_FL
set erroneously. Enough, in fact, the e2fsck runs were taking too
long. (There was such a bug in the kernel, which was fixed by commit
58590b06d in 2.6.36).
Leaving EOFBLOCKS_FL set when it should not be isn't a huge deal, and
is certainly than having high availability timeout alerts going off
left and right. So in this case, the best fix might be to put the
following in /etc/e2fsck.conf:
[problems]
0x010060 = { # PR_1_EOFBLOCKS_FL_SET
force_no = true
no_ok = true
no_nomsg = true
}
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Andreas Dilger [Mon, 6 Dec 2010 03:20:19 +0000 (22:20 -0500)]
dumpe2fs: fix output for flex_bg bitmap offsets
When running dumpe2fs on a filesystem formatted with flex_bg, it
prints out the relative offsets for the bitmaps and inode table
badly on 64-bit systems, because the offset is computed as a
large positive number instead of being a negative numer (which
will not be printed at all):
Group 1: (Blocks 0x8000-0xffff) [INODE_UNINIT, ITABLE_ZEROED]
Block bitmap at 0x0102 (+
4294934786), Inode bitmap at 0x0202 (+
4294935042)
Inode table at 0x037e-0x03fa (+
4294935422)
This commit prints out the relative offsets for flex_bg
groups as the offset within the reported group. This makes it
more clear where the metadata is located, rather than simply
printing some large negative number.
Group 1: (Blocks 0x8000-0xffff) [INODE_UNINIT, ITABLE_ZEROED]
Block bitmap at 0x0102 (bg #0 +258), Inode bitmap at 0x0202 (bg #0 +514)
Inode table at 0x037e-0x03fa (bg #0 +894)
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 1 Dec 2010 23:49:26 +0000 (18:49 -0500)]
mke2fs: Fix (minor) memory leaks
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 1 Dec 2010 23:28:35 +0000 (18:28 -0500)]
mke2fs: Fail if the requested file system type is not defined in mke2fs.conf
If the user passes a file system type which is not defined in
mke2fs.conf (i.e., mke2fs -t xfs ...) change mke2fs so that it prints
a warning and aborts the run. (There is an exception for ext2, since
that file system does not need a special definition in the fs_types
section of the /etc/mke2fs.conf file.)
In addition, print a warning if there are usage types (specified using
the -T option) which are not defined in /etc/mke2fs.conf.
Addresses-Debian-Bug: #594609
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 27 Nov 2010 00:42:15 +0000 (19:42 -0500)]
resize2fs: Clarify error explaining on-line shrinking is not supported at all
Addresses-Debian-Bug: #599786
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 27 Nov 2010 00:35:30 +0000 (19:35 -0500)]
resize2fs.8.in: Document that resize2fs -p only works on offline resizes
Addresses-Launchpad-Bug: #505719
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>