Whamcloud - gitweb
Eric Biggers [Sat, 3 Mar 2018 00:59:15 +0000 (16:59 -0800)]
libext2fs: make sure the system.data xattr gets created
Both the kernel and e2fsck expect that if an inode has inline data, then
it contains a "system.data" xattr -- even if i_size <= 60 so the data
fits entirely in i_block.
But if a symlink of exactly 60 bytes (not counting a NUL terminator) was
created using ext2fs_symlink() and the inline data feature was enabled,
then the symlink inode ended up with inline data but without a
system.data xattr. This is possible because "fast" symlinks store a NUL
terminator but inline data symlinks do not. So 60 bytes is too long for
a real fast symlink, but still short enough to fit the entire target in
i_block as a "slow" symlink using inline data.
Some places use ext2fs_inline_data_init() to ensure the system.data
xattr is created, but the symlink path does not.
Fix this by making ext2fs_inline_data_set() set system.data to an empty
string when i_size <= 60.
Fixes:
54e880b870f7 ("libext2fs: handle inline data in read/write function")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Biggers [Sat, 3 Mar 2018 00:59:14 +0000 (16:59 -0800)]
libext2fs: forbid creating symlinks using entire block
ext2fs_symlink() didn't count the NUL terminator when limiting the
symlink target length to fs->blocksize, so it could create symlinks
using the entire block. Such symlinks are problematic because if
block_size == PAGE_SIZE (as is usually the case), then when following
such a symlink the kernel will truncate the last byte because it needs
to ensure the symlink page is NUL-terminated (see page_get_link()).
Perhaps for that reason, e2fsck considers such symlinks to be invalid
(although only if they use the traditional block list rather than an
extent tree, which seems to be another bug).
Fix this by counting the NUL terminator, thereby decreasing the maximum
accepted symlink target length by 1. Note that this matches the
kernel's behavior in ext4_symlink().
This breaks the test 'f_create_symlinks' which was using debugfs to
create a 1024-byte symlink (not counting the NUL terminator) on a
1024-byte block filesystem. Fix it by removing the leading '/' from the
test's symlink targets so that their lengths are decreased by 1.
Fixes:
f01c1a6bce5e ("libext2fs: add the ext2fs_symlink() function")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Biggers [Fri, 2 Mar 2018 05:21:35 +0000 (21:21 -0800)]
blkid: fix building e2fsprogs with internal libblkid
Building e2fsprogs with the internal libblkid fails for me with the
following compiler error:
In file included from blkidP.h:27:0,
from dev.c:17:
dev.c: In function ‘blkid_free_dev’:
../../lib/blkid/list.h:149:42: error: ‘intptr_t’ undeclared (first use in this function); did you mean ‘__intptr_t’?
((type *)((char *)(ptr)-(unsigned long)(intptr_t)(&((type *)0)->member)))
The problem is that lib/blkid/list.h is now using 'intptr_t', but
stdint.h is not guaranteed to have been included yet. Include it.
[ Changed to use inttypes.h if it is available and fall back to stdint.h
if it is not available - tytso ]
Fixes:
0a3d8041892c ("AOSP: build mke2fs for windows using android mingw library")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Biggers [Fri, 2 Mar 2018 03:52:57 +0000 (19:52 -0800)]
e2fsck: remove get_filename_hash() prototype
get_filename_hash() is not defined anywhere, so remove its prototype.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Biggers [Fri, 2 Mar 2018 03:52:36 +0000 (19:52 -0800)]
.gitignore: add cscope files
The .gitignore file for e2fsprogs was ignoring the index files for ctags
but not for cscope. Add cscope to the list.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Biggers [Fri, 2 Mar 2018 03:51:22 +0000 (19:51 -0800)]
.gitignore: add misc/e4crypt and misc/e4crypt.8
It was forgotten to add these to .gitignore when e4crypt was added.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 2 Mar 2018 19:26:52 +0000 (14:26 -0500)]
config: update config.{guess,sub}
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 2 Mar 2018 19:14:57 +0000 (14:14 -0500)]
e2freefrag: fix portability problem for Hurd
Hurd doesn't define PATH_MAX, so define a fallback definition.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 25 Feb 2018 04:01:51 +0000 (23:01 -0500)]
debian: fix maintainer name in changelog
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 25 Feb 2018 01:48:51 +0000 (20:48 -0500)]
debian: update changelog for 1.43.9-2 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 25 Feb 2018 01:23:24 +0000 (20:23 -0500)]
tune2fs: if turning off csum_seed and the UUID has changed, require fsck
In the case where the UUID has changed and the user wants to turn off
the csum_seed feature, it's important that file system be freshly
checked. That's also the only case when it's necessary to recalculate
all of the metadata file systems.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sat, 24 Feb 2018 23:11:19 +0000 (18:11 -0500)]
tune2fs/fuse2fs/debugfs: after replaying the journal, fix up s_lastcheck
If the file system needs to have the journal replayed, but definition
it can't be freshly checked. So if the time when the file system was
last checked (s_lastcheck) is before the time it was last mounted
(s_mtime), force s_lastcheck to be before s_mtime.
This is necessary to make sure some of tune2fs's safety checks work
correctly after replaying the journal, since some of tune2fs's
operations really require that the file system be self-consistent or
grave damage can result.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sat, 24 Feb 2018 23:07:44 +0000 (18:07 -0500)]
tune2fs: move the journal recovery before we try to modify the superblock
Also change the t_replay_and_set test so that we do something more
innocuous, such as setting the file system label, instead of something
much more dangerous such as removing metadata_csum feature (which
requires rewriting the metadat checksums, and this will fail
catastrophically after the test corrupts the inode bitmaps and we
perform the journal replay correctly).
Reported-by: NeilBrown <neilb@suse.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
NeilBrown [Sat, 24 Feb 2018 19:56:06 +0000 (14:56 -0500)]
tune2fs: don't recover journal if device is busy.
tune2fs currently replays the journal if it needs
recovery and the filesystem isn't mounted.
The test for "is the filesystem mounted" isn't completely robust.
Lustre makes use of ext4 filesystems in a way that they are mounted
without being visible in /proc/mounts or similar.
This usage can easily be detected by attempting to open the device
with O_EXCL. tune2fs already does this and the EXT2_MF_BUSY flag
is set if open(O_EXCL) fails.
Several uses other than lustre mounts could cause O_EXCL to fail,
but in any case it seems unwise to recover the journal when something
else is keeping the device busy.
So add an extra test to avoid journal recovery when the device
is busy. This fixes some problems with lustre usage.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Lukas Czerner [Thu, 22 Feb 2018 13:25:03 +0000 (14:25 +0100)]
libss: add newer libreadline.so.7 to dlopen path
Rawhide now has libreadline.so.7. Add it to the list of libs to look
for.
Based on commit
4e79a19fe0b6dc3c2bd9cae9dfdbc5e96a3f98f8 for previous
libreadline version.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 23 Feb 2018 20:42:27 +0000 (15:42 -0500)]
fsck: avoid buffer overflow if user passes in an insanely long fs type
Reported-by: <Hornseth_Brenan@bah.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 23 Feb 2018 20:39:46 +0000 (15:39 -0500)]
libuuid: fix UBSAN issue in get_random_fd()
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 23 Feb 2018 20:19:39 +0000 (15:19 -0500)]
debian: make transitional libraries to be Arch:any and M-A:same
Make transitional library packages be Arch: any and Multi-Arch: same
so that upgrades actually function correctly when two or more exist.
Addresses-Debian-Bug: #890590
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 9 Feb 2018 04:39:22 +0000 (23:39 -0500)]
Update release notes, etc., for the 1.43.9 release
This also includes some debian package renames to conform with Debian
naming conventions.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Balázs Úr [Thu, 8 Feb 2018 05:08:06 +0000 (00:08 -0500)]
po: update hu.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 8 Feb 2018 04:52:54 +0000 (23:52 -0500)]
debian: fix false positive lintian warning (new essential package)
This is caused by a transition to make e2fsprogs no longer be essential.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Tyson Nottingham [Mon, 5 Feb 2018 22:45:30 +0000 (14:45 -0800)]
chattr/lsattr: update obsolete attribute support
* Remove description of and printing of h, which was never visible to
clients of the EXT4_IOC_GETFLAGS ioctl, including chattr and lsattr.
* Remove descriptions of X and Z, whose support was removed in
4a05268cf86f713 (Remove compression support).
* Update a brief description of E, whose meaning was changed in
22f22ab1d2bc5ae (Reserve the codepoints for the new INCOMPAT
feature ENCRYPT).
* Add P to symbolic mode format string.
Signed-off-by: Tyson Nottingham <tgnottingham@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Tyson Nottingham [Wed, 24 Jan 2018 03:33:17 +0000 (19:33 -0800)]
debugfs: remove misplaced "MMP is unsupported" message
This message was inadvertently copied from the version of do_dump_mmp
that is used when CONFIG_MMP is disabled.
Signed-off-by: Tyson Nottingham <tgnottingham@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Theodore Ts'o [Fri, 5 Jan 2018 22:10:16 +0000 (17:10 -0500)]
debian: Fix missing "General" in "GNU General Public License" in copyright files
This was issue was pointed out by Lintian.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 5 Jan 2018 22:07:06 +0000 (17:07 -0500)]
debian: fix whitespace issue in debian/control
Fix a minor issue pointed out by Lintian.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 4 Jan 2018 00:28:43 +0000 (19:28 -0500)]
debian: remove -dbg packages from the control file
It looks like Debian's upload automation will reject a control file
that has packages that it doesn't recognize, even if they are not
built in the default build profile. (e.g., the expectation is that
build profiles will *disable* packages, but not *add* new binary
packages not normally built.)
So move the offending lines into debian/control.legacy-dbg which is
tacked onto the debian/control file via "./debian/rules debian-files"
and then removed via "./debian/rules mrproper". It's a hack, but it's
only needed when building backports for Debian Jessie.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 3 Jan 2018 21:19:36 +0000 (16:19 -0500)]
Update debian changelog for 1.43.8-2 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 3 Jan 2018 21:05:44 +0000 (16:05 -0500)]
debian: convert to use build profile rules exclusively
This commit drops support for the debian/rules.custom file, and only
relies on build profiles.
This means we no longer need to build the control file from
control.in, which simplifies this; developers can now build a debian
package immediately after checking out the tree from git. This also
implies that we are dropping support for Debian 7 (wheezy) and Ubuntu
Trusty (14.04LTS) and older releases. (People who want to backport to
these older distributions will have to make manual adjustments to the
debian/control and debian/rules files.)
Instead of using SKIP_E2FSCK_STATIC in debian/rules.custom, use the
new build profile: pkg.e2fsprogs.no-static-e2fsck
Support for the old-style *-dbg files used in Debian Jessie (which did
not support dbgsym packages) is completely automated. The system will
auto-detect systems which do not support dbgsym and automatically set
the pkg.e2fsprogs.legacy-pkg build profile.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Simon McVittie [Mon, 1 Jan 2018 23:24:03 +0000 (23:24 +0000)]
debian: add the build profile noudeb
This is a standard build profile. Not building udebs speeds up test
builds if only the full-fat version is going to be tested anyway.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Simon McVittie [Mon, 1 Jan 2018 23:23:36 +0000 (23:23 +0000)]
debian: add the build profile pkg.e2fsprogs.no-fuse2fs
This build profile is designed for use when bootstrapping a new Debian
architecture.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 3 Jan 2018 06:37:26 +0000 (01:37 -0500)]
Update debian changelog for 1.43.8-2 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 3 Jan 2018 06:32:02 +0000 (01:32 -0500)]
libext2fs: fix build failure in swapfs.c on big-endian systems
Addresses-Debian-Bug: #886119
Reported-by: James Clarke <jrtc27@debian.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 3 Jan 2018 06:28:55 +0000 (01:28 -0500)]
debian: simplify rules file and don't build e2fsprogs-l10n unnecessarily
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 3 Jan 2018 04:17:30 +0000 (23:17 -0500)]
debian: update standards compliance to 4.1.3
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 3 Jan 2018 03:17:34 +0000 (22:17 -0500)]
debian: mark library packages as optional
They will be pulled in by the binary package which is priority:
required.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 2 Jan 2018 02:33:09 +0000 (21:33 -0500)]
Update release notes, etc., for the 1.43.8 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Shen-Ta Hsieh [Mon, 18 Dec 2017 15:19:52 +0000 (23:19 +0800)]
e2fsck: fix printf format %d on ext2_ino_t
Signed-off-by: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Shen-Ta Hsieh [Mon, 18 Dec 2017 15:18:52 +0000 (23:18 +0800)]
debugfs: fix printf format %d on ext2_ino_t
Signed-off-by: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Palmer Dabbelt [Fri, 29 Dec 2017 18:19:51 +0000 (10:19 -0800)]
misc: rename copy_file_range to copy_file_chunk
As of 2.27, glibc will have a copy_file_range library call to wrap the
new copy_file_range system call. This conflicts with the function in
misc/create_inode.c, which this patch renames _copy_file_range.
Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 2 Jan 2018 00:36:37 +0000 (19:36 -0500)]
Update translation template in preparation for e2fsprogs 1.43.8 release.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Yuri Chornoivan [Tue, 2 Jan 2018 00:14:51 +0000 (19:14 -0500)]
po: update uk.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Antonio Ceballos [Tue, 2 Jan 2018 00:14:51 +0000 (19:14 -0500)]
po: update es.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 1 Jan 2018 23:59:16 +0000 (18:59 -0500)]
libext2fs: when writing bitmaps mark the fs as dirty if necessary
If any checksum fields are updated in the block group descriptors, we
need to set the EXT2_FLAG_DIRTY flag so that the block group
descriptors are written to disk.
Addresses-Debian-Bug: #883869
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 1 Jan 2018 21:29:56 +0000 (16:29 -0500)]
Add documentation for e4crypt's add_key command in the man page
Correctly document that the -S option takes an argument, and describe
what arguments to the -S, -k, and -p options.
Addresses-Debian-Bug: #880483
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Tyson Nottingham [Thu, 14 Dec 2017 07:13:13 +0000 (23:13 -0800)]
Fix minor typos in libext2fs documentation
Signed-off-by: Tyson Nottingham <tgnottingham@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Tyson Nottingham [Thu, 14 Dec 2017 07:13:12 +0000 (23:13 -0800)]
Add missing information to various man pages and usage texts
badblocks.c: Add -B and -X to usage text.
chattr.1.in: Add P to list of settable attributes.
e2image.8.in, e2image.c: Remove superfluous mention of -r option.
e2undo.8.in, e2undo.c: Add description for -z to man page and add -o and
-z to synopsis and usage text.
e4crypt.8.in: Add -p pad option to relevant command descriptions.
lsattr.1.in: Fix typo.
mke2fs.8.in: Add -C to synopsis. Add MKE2FS_DEVICE_PHYS_SECTSIZE
description and update MKE2FS_DEVICE_SECTSIZE description.
mke2fs.conf.5.in: Add devices stanza summary. Remove base_features and
default_features descriptions from defaults section, as they are
already described in fs_types section. Move enable_periodic_fsck and
force_undo to fs_types section, as they can be set per filesystem
type. Add missing lazy_journal_init and hugefiles_dir descriptions.
tune2fs.8.in: Remove unsupported -p option and deprecated -s option.
Add 64bit, ea_inode, large_dir, and metadata_csum_seed descriptions.
tune2fs.c: Remove unsupported -p option from usage text.
Add mmp_update_interval to extended option usage text.
resize/main.c: Add -S option to usage text.
Signed-off-by: Tyson Nottingham <tgnottingham@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Tyson Nottingham [Thu, 14 Dec 2017 07:13:11 +0000 (23:13 -0800)]
Add missing information to debugfs man pages and usage texts
Add descriptions for dump_unused, get_quota, list_quota,
set_current_time, show_debugfs_params, and supported_features
commands to debugfs man page. Add various missing command
arguments and correct a few typos in man page and usage texts.
Signed-off-by: Tyson Nottingham <tgnottingham@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Tyson Nottingham [Thu, 14 Dec 2017 07:13:10 +0000 (23:13 -0800)]
Add missing information to e2fsck man pages and usage text
Add environment variable and defaults stanza information.
Also, update a couple of descriptions.
Signed-off-by: Tyson Nottingham <tgnottingham@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Tyson Nottingham [Thu, 14 Dec 2017 07:13:09 +0000 (23:13 -0800)]
Add missing features and mount options to ext4 man page
Add descriptions for the metadata_csum and metadata_csum_seed
features, as well as nombcache and prjquota mount options. Also,
update a couple of descriptions.
Signed-off-by: Tyson Nottingham <tgnottingham@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Andreas Dilger [Wed, 13 Dec 2017 23:47:14 +0000 (16:47 -0700)]
libext2fs: add missing swab for superblock, add checks
Several recently-added fields in struct ext2_super_block were
not being swabbed in ext2fs_swap_super(), in particular:
s_raid_stride, s_raid_stripe_width, s_{first,last}_error_*
s_lpf_ino, s_prj_quota_inum
Add swabbing for these missing fields. Reorder the swabbing
on other fields so that they are in struct order, and add
comments for fields that do not need swabbing, so it is easier
to see that all fields are being handled.
Since this seems to be a fairly common occurrence, add compile
time checks to ext2fs_swap_super(), ext2fs_swap_inode_large(),
and ext2fs_swap_group_desc2() via a new EXT2FS_BUILD_BUG_ON()
macro to cause a compile warning if fields are used from these
structs without a corresponding change to the swab functions.
Lustre-bug: https://jira.hpdd.intel.com/browse/LU-9309
Reported-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Qian Yingjin [Wed, 13 Dec 2017 15:59:39 +0000 (10:59 -0500)]
debugfs: fix ncheck program output
Fix the bug that print the inode number not the program name
when reporting bad inode name during checking in ncheck.
Minor bug fix: it should reduce iw->inodes_left when found
matched inode number.
Signed-off-by: Qian Yingjin <qian@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 13 Dec 2017 04:18:27 +0000 (23:18 -0500)]
misc: clean up Makefile output
Make the Makefile's summary output to be consistent for its CC
messages.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Dmitry V. Levin [Wed, 13 Dec 2017 04:05:45 +0000 (23:05 -0500)]
Fix -Wunused-variable compilation warnings
Fix the following compilation warnings:
sha256.c: In function 'main':
sha256.c:238:20: warning: unused variable 'md' [-Wunused-variable]
sha512.c: In function 'main':
sha512.c:286:20: warning: unused variable 'md' [-Wunused-variable]
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Dmitry V. Levin [Wed, 13 Dec 2017 04:05:01 +0000 (23:05 -0500)]
Fix compilation warnings in digest_encode.c
Fix -Wpointer-sign and -Wunused-variable compilation warnings
in digest_encode.c
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Dmitry V. Levin [Thu, 18 May 2017 17:46:49 +0000 (17:46 +0000)]
Fix compilation warnings about functions declared in sys/xattr.h
attr commit v2.4.47-34-g7921157 removes <attr/xattr.h>
and syscall wrappers with the following wording:
"The xattr syscalls are provided by glibc since ages [...]
This removes the need for the <attr/xattr.h> header;
use <sys/xattr.h> instead."
Check for <sys/xattr.h> and include it to fix the following compilation
warnings:
create_inode.c: In function 'set_inode_xattr':
create_inode.c:136:9: warning: implicit declaration of function 'llistxattr' [-Wimplicit-function-declaration]
create_inode.c:172:16: warning: implicit declaration of function 'lgetxattr' [-Wimplicit-function-declaration]
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 13 Dec 2017 03:52:26 +0000 (22:52 -0500)]
debian: add Multi-Arch hints to the Debian packages
Addresses-Debian-Bug: Bug#881408
Addresses-Debian-Bug: Bug#881590
Addresses-Debian-Bug: Bug#881591
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 13 Dec 2017 03:25:10 +0000 (22:25 -0500)]
debian: add missing copyright file for the e2fsprogs-l10 package
Addresses-Debian-Bug: #880207
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 13 Dec 2017 02:46:36 +0000 (21:46 -0500)]
e2fsck: fix potential Floating Point Exception in show_stats()
If the free inodes count in the superblock is equal to the inodes
count in the superblock (which is not possible with a valid file
system and will be fixed by e2fsck unless it is prevented by, for
example, e2fsck -n), it is possible for e2fsck to crash due to a
divide by zero error.
Fix this potential bug.
Addresses-Debian-Bug: #879220
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kazuya Mio [Tue, 5 Dec 2017 00:15:38 +0000 (00:15 +0000)]
e2freefrag: print 64bit free blocks count
e2freefrag prints incorrect free blocks count when the number of free blocks
is larger than 2^32.
To fix this problem, e2freefrag uses ext2fs_free_blocks_count(),
not fs->super->s_free_blocks_count.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Artem Blagodarenko [Sat, 4 Nov 2017 17:22:18 +0000 (20:22 +0300)]
e2fsck: fix access after free for dx_db structure
dx_db structure is freed after fixing of PR_2_HTREE_BAD_ROOT
problem. Next code block use this structure to unerstand if leaf
is beeng processed.
If dx_db is freed, then root block is being processed and if_leaf
need to be set to 0.
Signed-off-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Мирослав Николић [Mon, 4 Dec 2017 00:41:43 +0000 (19:41 -0500)]
po: update sr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Philipp Thomas [Mon, 4 Dec 2017 00:41:42 +0000 (19:41 -0500)]
po: update de.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 2 Nov 2017 13:36:37 +0000 (09:36 -0400)]
resize2fs: fix free blocks count sanity check for 64-bit file systems
The sanity check that the free blocks count is not insane could fail
with a false positive on 64-bit file systems. Fix it.
Reported-by: Ian Astle <iastle@ott-fortimail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 18 Oct 2017 15:30:44 +0000 (11:30 -0400)]
Fix up additional release notes typos
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 17 Oct 2017 13:56:05 +0000 (09:56 -0400)]
debian: fix Lintian warning: not-binnmuable-all-depends-any
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 16 Oct 2017 05:45:45 +0000 (01:45 -0400)]
Update release notes, etc., for the 1.43.7 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 16 Oct 2017 04:53:19 +0000 (00:53 -0400)]
debian: update to Debian Standards Version 4.1.1
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Philipp Thomas [Mon, 16 Oct 2017 04:42:40 +0000 (00:42 -0400)]
po: update de.po (from translationproject.org)
Addresses-Debian-Bug: #833514
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 16 Oct 2017 04:38:00 +0000 (00:38 -0400)]
debian: fix FTBFS regression caused by debhelper/10.9
The problem is caused by obsolete packages referenced in the rules
file. The latest version of debhelper is no longer forgiving about
non-existing packages being referenced in debhelper commands.
Addresses-Debian-Bug: #876551
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 16 Oct 2017 04:28:45 +0000 (00:28 -0400)]
libext2fs: fix potential memory access overrun in ext2fs_inode_csum()
If the superblock has a revision level of 0, then s_inode_size is
undefined, and the actual inode size is 128 bytes. This is handled by
the EXT2_INODE_SIZE() helper macro. If s_inode_size is maliciously
set to a large value, and the s_rev_level is 0, then this could result
in an illegal memory pointer dereference.
Addresses-Debian-Bug: #878104
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Sebastian Rasmussen [Mon, 16 Oct 2017 03:18:25 +0000 (23:18 -0400)]
Fix historic typos in changelogs and release notes
Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Sebastian Rasmussen [Sun, 8 Oct 2017 11:30:08 +0000 (13:30 +0200)]
Fix typos in code comments and developer docs
Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Sebastian Rasmussen [Sat, 14 Oct 2017 18:44:54 +0000 (20:44 +0200)]
Fix typos in error messages and documentation
Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Andreas Dilger [Sun, 15 Oct 2017 20:23:24 +0000 (16:23 -0400)]
tests: shorten test descriptions to fit in 80 columns
While not critical to functionality, it is easier to see the pass/fail
status of each test if they are not wrapped onto the next line.
Shorten test descriptions so the name+description fit in 80 columns.
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Andreas Dilger [Sun, 15 Oct 2017 20:21:13 +0000 (16:21 -0400)]
Add various miscellaneous generated files to the gitignore file
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 15 Oct 2017 20:19:04 +0000 (16:19 -0400)]
tests: fix d_inline_dump and f_mke2fs_baddisk from leaving behind temp files
These two tests could leave an temp file behind if the test is
skipped. In general test script files should avoid using 'exit',
since this bypasses the test cleanup scripting.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Andreas Dilger [Tue, 10 Oct 2017 22:39:52 +0000 (16:39 -0600)]
tests: don't leave temporary files at end of test
Don't leave temp files around after test has completed successfully.
Some test scripts were creating their own temporary files, and in
some cases test_one was skipping a test completely (e.g. slow) after
the temp file had been created.
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 15 Oct 2017 04:22:20 +0000 (00:22 -0400)]
misc: clean up error handling for ext2fs_run_ext3_journal()
The ext2fs_run_ext3_journal() function is in debugfs/journal.c, and in
some error conditions cases may close the passed-in file system handle.
Clean up the both the function so that it reliably clears the file
system handle if it has been freed, and its callers so that they do
not crash by dereferencing a null pointer if it has been freed.
Reported-by: Erkki Ruohtula <eru@netti.fi>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sat, 14 Oct 2017 15:29:21 +0000 (11:29 -0400)]
tests: add new test r_move_itable_nostride
This a regression test for
ca74ecf32569: "libext2fs: skip start_blk
adjustment when stride and flex_bg is set"
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sat, 14 Oct 2017 15:18:44 +0000 (11:18 -0400)]
tests: add new test r_move_itable_realloc
This is a regression test for
0c12896e08d9: "libext2fs: prevent
allocating inode table from already used blocks"
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Sat, 14 Oct 2017 14:42:30 +0000 (10:42 -0400)]
libext2fs: skip start_blk adjustment when stride and flex_bg is set
Currently some stride optimization is done in
ext2fs_allocate_group_table() by adjusting start_blk block where we
start allocating block, or inode bitmaps.
However in flex_bg case this is currently useless since the values are
going to be overridden anyway. Moreover in flex_bg case the group might
already be full and the stride optimization will fail. As a result file
system resize might fail needlessly in some situations.
It can be shown by this example:
mke2fs -b 1024 -i 1024 -E stride=8192 -t ext4 /dev/loop0 1024000
resize2fs /dev/loop0
102400000
resize2fs 1.43.5 (04-Aug-2017)
Resizing the filesystem on /dev/loop0 to
102400000 (1k) blocks.
./resize/resize2fs: Could not allocate block in ext2 filesystem while trying to resize /dev/loop0
Please run 'e2fsck -fy /dev/loop0' to fix the filesystem
after the aborted resize operation.
Fix this by not doing the stride adjustment in case of flex_bg.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Sat, 14 Oct 2017 14:33:10 +0000 (10:33 -0400)]
libext2fs: prevent allocating inode table from already used blocks
Currently it's possible for ext2fs_allocate_group_table() to place inode
tables to blocks that are already occupied by different inode table.
This can be reproduced by resize2fs on the file system where we need to
move more than one inode table to a different location due to increase
in group descriptor blocks, inode and block bitmaps.
Best way I can reproduce this is to create big enough file system with
huge amount of inodes and without resize_inode
mke2fs -F -b 1024 -i 1024 -O ^resize_inode -t ext4 /dev/loop0 1024000
resize2fs /dev/loop0
10240000
e2fsck -fn /dev/loop0 | less
e2fsck 1.43.5 (04-Aug-2017)
ext2fs_check_desc: Corrupt group descriptor: bad block for inode table
e2fsck: Group descriptors look bad... trying backup blocks...
e2fsck: The journal superblock is corrupt while checking journal for /dev/loop0
e2fsck: Cannot proceed with file system check
Superblock has an invalid journal (inode 8).
Clear? no
/dev/loop0: ********** WARNING: Filesystem still has errors **********
None of the settings are strictly necessary and it can be reproducer in
various ways. This is just an example of one easy way to reproduce this.
This bug was introduced with commit
fccdbac39454 ("libext2fs: optimize
ext2fs_allocate_group_table()") and is caused by the fact that wrong
bitmap is used to mark the blocks as used.
Fix this by using ext2fs_mark_block_bitmap_range2() in both (flex_bg and
non flex_bg) cases and handle flex_bg case manually instead of relying
on ext2fs_block_alloc_stats_range() because there is no way in that
function to use different bitmap than fs->block_map.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 20 Sep 2017 05:10:01 +0000 (01:10 -0400)]
mke2fs: fix spelling typo
Reported-by: Philipp Thomas <pth@suse.de>
Signed-off-by: Philipp Thomas <pth@suse.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 7 Sep 2017 01:02:49 +0000 (21:02 -0400)]
debian: replace priority: extra with priority: optional
As of Debian policy 4.0.1, the "extra" priority has been deprecated.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 5 Sep 2017 00:32:22 +0000 (20:32 -0400)]
e2fsck, libext2fs: add checks for insanely large file systems
If the blocks count field is too large, this can cause numeric
overflows which can result in buffer overflows.
Addresses-Debian-Bug: #873757
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Theodore Ts'o [Mon, 4 Sep 2017 04:06:10 +0000 (00:06 -0400)]
debian: promote e2fsprogs-l10n from suggests to recommends
Addresses-Debian-Bug: #873812
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 4 Sep 2017 04:04:59 +0000 (00:04 -0400)]
debian: remove zsh30-static recommendation from package control file
The zsh30-static package hasn't existed in a very long time.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 4 Sep 2017 03:53:57 +0000 (23:53 -0400)]
debian: clean up conditional fuse2fs pacakge build rules
There's no point conditionalizing fuse2fs in the control file, since
we control whether or not fuse2fs is built in the rules file, and the
control file is going to be the same when built on all of the debian
build servers.
Also key off of DEB_HOST_ARCH_OS to determine whether or not we are
building for the Hurd, and define it so the right thing happens if
./debian/rules is run by hand on a Hurd system.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 4 Sep 2017 02:40:23 +0000 (22:40 -0400)]
debian: make e2fsprogs-l10n be arch:all
Addresses-Debian-Bug: 873813
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 29 Aug 2017 13:04:45 +0000 (09:04 -0400)]
Fix Debian packaging warnings for the 1.43.6 release
Added a missing ${misc:Depends} to a new package, and removed an
extraneous configure option (--enable-quota was removed as of
e2fsprogs 1.43.)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 23 Aug 2017 23:46:04 +0000 (19:46 -0400)]
Update release notes, etc., for the 1.43.6 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Matthias Andree [Tue, 29 Aug 2017 05:02:36 +0000 (01:02 -0400)]
Search for GNU-compatible dd for self-tests.
This checks for a dd that supports iflag=fullblock oflag=append,
and looks at gdd and dd for now, and warns of failing self-tests
if neither supports these two flags.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 28 Aug 2017 22:04:11 +0000 (18:04 -0400)]
Fix FreeBSD portability problem caused by it using character mode disk devices
We were using S_ISBLK() to test if a device could be used as a disk
device. This doesn't work for FreeBSD. We need to test for S_ISBLK()
|| S_ISCHR().
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jakub Bogusz [Mon, 28 Aug 2017 20:27:29 +0000 (16:27 -0400)]
po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sat, 26 Aug 2017 17:42:30 +0000 (13:42 -0400)]
Silence valgrind warnings
Valgrind doesn't understand that the kernel will be initializing the
struct termios and struct loop_info64 structures. Since they occur in
functions which are not in the hot path, preinitialize to zero to
prevent valgrind from producing a huge number of false positives.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jaco Kroon [Wed, 23 Aug 2017 18:21:43 +0000 (14:21 -0400)]
e2fsck: add optimization for heavily hard-linked file systems
In the case of file system with large number of hard links, e2fsck can
take a large amount of time in pass 2 due to binary search lookup of
inode numbers. This implements a memory trade-off (storing 2 bytes
in-memory for each inode to store inode counts).
For a 40TB filesystem with 2.8bn inodes this map alone requires 5.7GB
of RAM. For this reason, we don't enable this optimization by
default. It can be enabled using either an extended option to e2fsck
or via a seting in e2fsck.conf.
Even when the fullmap optimization is enabled, we don't use this for
the icount structure in pass 1. This is because the gain CPU gain is
nearly nil for that pass and the sacrificed memory does not justify
the increase in RAM.
(It could be that during pass 1, if more than 17% if possible inodes
has link_count>1 (466m inodes in the 40TB with 2.8bn possible inodes
case) then it becomes more memory efficient to use the full map
implementation in terms of memory. However, this is extremely
unlikely given that most file systems are heavily over-provisioned in
terms of the number of inodes in the system.)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jaco Kroon [Wed, 23 Aug 2017 17:54:25 +0000 (13:54 -0400)]
e2fsck: optimize out the use region_t in scan_extent_node()
Since extents have a guarantee of being monotonically increasing we
merely need to check that block n+1 starts after block n. This is a
simple enough check and we can perform this by calculating the next
expected logical block instead of using the region usage tracking data
abstraction.
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 23 Aug 2017 15:03:37 +0000 (11:03 -0400)]
tune2fs, mke2fs: clarify proceed delay question
The explanation of the what happens after delaying N seconds is
ambiguous. Clarify what happens.
Addresses-Debian-Bug: #857336
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 23 Aug 2017 14:57:25 +0000 (10:57 -0400)]
tune2fs: explain why an fsck is needed
Currently tune2fs just says without any explanation, "run fsck -f".
Add a short explanation that a freshly checked file system is required
to reduce user confusion. (We could add even more details, but
hopefully this is enough.)
Addresses-Debian-Bug: #857336
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 23 Aug 2017 14:44:44 +0000 (10:44 -0400)]
tune2fs: do not enable project feature or quota if inode size is 128 bytes
Don't allow the user to enable the project feature (or project quota)
if the inode size is 128 bytes.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>