Whamcloud - gitweb
Andreas Dilger [Mon, 13 Dec 2021 06:35:30 +0000 (23:35 -0700)]
e2fsck: no parent lookup in disconnected dir
Don't call into ext2fs_get_pathname() to do a name lookup for a
disconnected directory, since the directory block traversal in
pass1 has already scanned all of the leaf blocks and never finds
the entry, always printing "???". If the name entry had been
found earlier, the directory would not be disconnected in pass3.
Instead, lookup ".." and print the parent name in the prompt, and
then do not search for the current directory name at all. This
avoids a useless full directory scan for each disconnected entry,
which can potentially be slow if the parent directory is large.
Separate the recursively looped directory case to a new error code,
since it is a different problem that should use its own descriptive
text, and a proper pathname can be shown in this case.
Lustre-bug-Id: https://jira.whamcloud.com/browse/LU-15330
Change-Id: If17a92689f24f365ca1fbe5c837e7d5f383ebbe5
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Andreas Dilger [Wed, 8 Dec 2021 07:51:12 +0000 (00:51 -0700)]
e2fsck: map PROMPT_* values to prompt messages
It isn't totally clear when searching the code for PROMPT_*
constants from problem codes where these messages come from.
Similarly, there isn't a direct mapping from the prompt string
to the constant.
Add comments that make this mapping more clear.
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Andreas Dilger [Wed, 1 Dec 2021 22:56:51 +0000 (15:56 -0700)]
misc: fix chattr usage message for project ID
Fix the "chattr -h" usage message to properly document that the
"-p" option takes a project argument, like "-v" takes a version.
Update the man page formatting to emphasize literal strings.
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Thu, 17 Feb 2022 09:25:00 +0000 (10:25 +0100)]
Use mallinfo2 instead of mallinfo if available
mallinfo has been deprecated with GNU C library version 2.33 in favor of
mallinfo2 which works exactly the same as mallinfo but with larger field
widths. Use mallinfo2 if available.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Thu, 17 Feb 2022 09:24:59 +0000 (10:24 +0100)]
libss: fix possible NULL pointer dereferece on allocation failure
Currently in ss_execute_command() we're missng a check to see if the
memory allocation was succesful. Fix it by checking the return from
malloc and returning ENOMEM if it had failed.
[ Removed addition of the SS_ET_ENOMEM entry to the the libss error
table. -TYT ]
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Thu, 17 Feb 2022 09:24:58 +0000 (10:24 +0100)]
resize2fs: remove unused variable 'c'
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Thu, 21 Apr 2022 17:31:48 +0000 (19:31 +0200)]
libext2fs: add sanity check to extent manipulation
It is possible to have a corrupted extent tree in such a way that a leaf
node contains zero extents in it. Currently if that happens and we try
to traverse the tree we can end up accessing wrong data, or possibly
even uninitialized memory. Make sure we don't do that.
Additionally make sure that we have a sane number of bytes passed to
memmove() in ext2fs_extent_delete().
Note that e2fsck is currently unable to spot and fix such corruption in
pass1.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reported-by: Nils Bars <nils_bars@t-online.de>
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2068113
Addresses: CVE-2022-1304
Addresses-Debian-Bug: #1010263
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Jan 2022 05:02:22 +0000 (00:02 -0500)]
setup-schroot: install the udev and systemd packages separately
On non-Linux Debian ports (e.g., GNU/Hurd and GNU/kFreeBSD) the udev
and systemd packages don't exist. So try to install them separately,
so they can fail on their own on those platforms.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 4 Jan 2022 03:45:37 +0000 (22:45 -0500)]
tests: support older versions of timeout in r_corrupt_fs
Older versions of the timeout program in coreutils don't support the
-v option. (This is apparently still in use in the GNU/FreeBSD Debain
port since coreutils hasn't built successfully since Coreutils version
8.28.)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 30 Dec 2021 15:43:49 +0000 (10:43 -0500)]
debian: suppress the no-debian-changes lintian warning
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 30 Dec 2021 05:52:29 +0000 (00:52 -0500)]
Update release notes, etc., for the 1.46.5 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 30 Dec 2021 02:33:27 +0000 (21:33 -0500)]
mke2fs.conf.5: fix spelling errors in man page
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 28 Dec 2021 20:17:31 +0000 (15:17 -0500)]
tst_getsize: use ext2fs_get_device_size2() to support testing large devices
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Wenbin Lv [Tue, 28 Dec 2021 20:16:43 +0000 (15:16 -0500)]
po: update zh_CN.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Yuri Chornoivan [Tue, 28 Dec 2021 20:16:43 +0000 (15:16 -0500)]
po: update uk.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Göran Uddeborg [Tue, 28 Dec 2021 20:16:43 +0000 (15:16 -0500)]
po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Мирослав Николић [Tue, 28 Dec 2021 20:16:42 +0000 (15:16 -0500)]
po: update sr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Sharuzzaman Ahmat Raslan [Tue, 28 Dec 2021 20:16:42 +0000 (15:16 -0500)]
po: update ms.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Antonio Ceballos [Tue, 28 Dec 2021 20:16:42 +0000 (15:16 -0500)]
po: update es.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 28 Dec 2021 17:33:15 +0000 (12:33 -0500)]
reisze2fs: sanity check free block group counts when calculating minimum size
If one or more block group descriptor's free blocks count is insane,
it's possible this can lead to a infinite loop in the function
calculate_minimum_resize_size(), which is called by resize2fs -P or
resize2fs -M.
Add some sanity checks to avoid this. In the case where the file
system is corrupt, this will result in resize2fs -P reporting an
incorrect value, but that's OK, since when we try to do an actual
resize operation, resize2fs requires that the file system be freshly
checked using e2fsck.
https://github.com/tytso/e2fsprogs/issues/94
Fixes:
ac94445fc01f ("resize2fs: make minimum size estimates more reliable for mounted fs")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 21 Dec 2021 19:55:32 +0000 (14:55 -0500)]
setup-schroot: add some additional packages needed to build debian packages
On older Debian systems, "apt-get build-dep e2fsprogs" might not bring
in all of the packages needed to build in the most recent versions of
e2fsprogs. So explicitly try to install some additional packages
including dh-exec, udev, systemd, and cron.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 21 Dec 2021 19:28:51 +0000 (14:28 -0500)]
libuuid: try to use getrandom() or getentropy() if available
If getrandom() or getentropy() is available, use these interfaces in
favor of opening /dev/[u]random. This avoids a potential TSAN problem
that could potentially cause a fd leak when trying to open
/dev/urandom. (Which is not a disaster, but these interfaces are more
foolproof and avoids needing to open a file descriptor in a library,
which is a good thing.)
Addresses-Google-Bug: #
198050608
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sat, 11 Dec 2021 03:40:40 +0000 (22:40 -0500)]
e2fsck: update the bg_checksum after fixing problems in the bg descriptor
Otherwise, we break the block group descriptor's checksum, and while
this gets fixed by e2fsck, it results unnecessary messages printed or
questions asked of the system administrator.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 9 Dec 2021 15:55:54 +0000 (10:55 -0500)]
libext2fs: don't old the CACHE_MTX while doing I/O
A report a deadlock problem caused by I/O errors (caused by e2fsck's
error handler trying to write to a bad block to perform a forced
rewrite) uncovered that we were holding the CACHE_MTX while doing read
operations. This serialized read operations which destroyed the
performance benefits from doing parallel bitmap loading (or the
parallel e2fsck processing under development).
So restructure the code in unix_read_blk64() so that the read is
always done into the user-provided buffer, and then copied into the
cache afterwards.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Harshad Shirwadkar [Wed, 17 Nov 2021 16:50:15 +0000 (08:50 -0800)]
e2fsck: skip sorting extents if there are no valid extents
At the end of a fast commit replay, e2fsck tries merging extents in a
inode. This patch fixes a bug in this logic where we were continuing
this action even if there were no extents to merge resulting in
accessing illegal memory.
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
ryancaicse [Mon, 1 Nov 2021 05:42:56 +0000 (13:42 +0800)]
libext2fs: fix missing unlocks in the error path in unix_set_blksize()
https://github.com/tytso/e2fsprogs/pull/83
Signed-off-by: Ryan Cai <ryancaicse@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Thu, 2 Sep 2021 10:58:52 +0000 (12:58 +0200)]
tests: Add option to print diff output of failed tests
Add variable $PRINT_FAILED which when set will print the diff output of
a failed test.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 14 Sep 2021 19:05:45 +0000 (15:05 -0400)]
resize2fs: optimize resize2fs_calculate_summary_stats()
Speed up an off-line resize of a 10GB file system to 64TB located on
tmpfs from 90 seconds to 16 seconds by extracting block group bitmaps
using a population count function to count the blocks in use instead
checking each bit in the block bitmap.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 14 Sep 2021 12:56:46 +0000 (08:56 -0400)]
resize2fs: adjust new size of the file system to allow a successful resize
The previous commit in this series (commit
50088b1996cc: "resize2fs:
attempt to keep the # of inodes valid by removing the last bg") allows
a successful off-line resize of a file system with the default 16k
inode ratio to be grown to support a 64TB storage device by dropping
the last block group so the number of inodes is just below the maximum
2**32-1 number of inodes.
However, this is not a complete solution, for two reasons. First,
this adjustment happens after resize2fs has started potentially making
changes to the file system in the off-line (unmounted) case, which
means resize2fs will do a lot of unnecessary work. Secondly, in the
on-line resize case, passing the original requested size to the kernel
causes the kernel fail the online resize request.
So teach resize2fs to adjust the new size of the file system much
earlier, which avoids both problems.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Leah Rumancik <leah.rumancik@gmail.com>
Theodore Ts'o [Tue, 14 Sep 2021 12:41:33 +0000 (08:41 -0400)]
resize2fs: attempt to keep the # of inodes valid by removing the last bg
If a the 10GB file system (with the default inode ratio size of 16k)
is resized to 64TB, the number of inodes will become 2**32 --- one
above the maximum allowed number of inodes of 2**32-1. In
adjust_fs_info(), we already try drop the last block group if there
isn't sufficient space in the last block group to support the metadata
for that block group. So if dropping the last block group allows the
number of inodes to valid, we should try that as well. In some cases
this will mean resizing a file system to 64TB will result in it be
resized to a size of 64TB - 128MB, which is close enough for
government work.
Addresses-Google-Bug:
199105099
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Leah Rumancik <leah.rumancik@gmail.com>
Lukas Czerner [Tue, 24 Aug 2021 12:10:20 +0000 (14:10 +0200)]
tests: update expect files for f_large_dir and f_large_dir_csum
Update expect files for f_large_dir and f_large_dir_csum tests to
include the warning about missing y2038 support with 128-byte inodes.
Fixes:
a23b50cd ("mke2fs: warn about missing y2038 support when formatting fresh ext4 fs")
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Tue, 24 Aug 2021 12:10:19 +0000 (14:10 +0200)]
tests: update expect files for f_mmp_garbage
Update expect file for f_mmp_garbage test to work correctly with the
new default 256 inode size.
Fixes:
d730be5ceeba ("tests: update mke2fs.conf to create 256 byte inodes by default")
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jan Kara [Mon, 23 Aug 2021 15:41:28 +0000 (17:41 +0200)]
quota: Drop dead code
Drop unused function from quota support code.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jan Kara [Mon, 23 Aug 2021 15:41:27 +0000 (17:41 +0200)]
debugfs: Fix headers for quota commands
list_quota and get_quota commands have 'blocks' header while what they
actually show is a used space in bytes. Fix the header to state 'space'
instead.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jan Kara [Mon, 23 Aug 2021 15:41:26 +0000 (17:41 +0200)]
tests: Expand test checking quota and orphan processing interaction
Expand f_orphquot test to also check handling of quotas for non-root
user and verify that quota limits are properly preserved over orphan
replay.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jan Kara [Mon, 23 Aug 2021 15:41:25 +0000 (17:41 +0200)]
e2fsck: Do not trash user limits when processing orphan list
When e2fsck was loading quotas to process orphan list, it was loading
only quota usage. However subsequent quota writeout has effectively
overwritten quota limits, loosing them forever. Make sure quota limits
are preserved over orphan replay.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jan Kara [Mon, 23 Aug 2021 15:41:24 +0000 (17:41 +0200)]
tune2fs: Fix conversion of quota files
When tune2fs is enabling quota feature, it looks for old-style quota
files and tries to transfer limits stored in these files into newly
created hidded quota files. However the code doing the transfer setups
the quota scan wrongly and instead of transferring limits we transfer
usage. So not only quota limits are lost (at least they can still be
recovered from the old quota files) but also usage information may be
wrong if the accounting in e2fsprogs does not exactly match the
accounting in quota-tools (which is actually the case). Fix the setup of
the quota scan.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jan Kara [Mon, 23 Aug 2021 15:41:23 +0000 (17:41 +0200)]
quota: Rename quota_update_limits() to quota_read_all_dquots()
quota_update_limits() is a misnomer because what it actually does is
that it updates 'usage' counters and leaves 'limit' counters intact.
Rename quota_update_limits() to quota_read_all_dquots() and while
changing prototype also add a flags argument so that callers can control
which quota information is actually updated from the disk.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jan Kara [Mon, 23 Aug 2021 15:41:22 +0000 (17:41 +0200)]
quota: Fold quota_read_all_dquots() into quota_update_limits()
There's just one caller of quota_read_all_dquots(), fold it into its
caller quota_update_limits(). No functional changes.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jan Kara [Mon, 23 Aug 2021 15:41:21 +0000 (17:41 +0200)]
quota: Add support to version 0 quota format
Version 0 quota format differs from version 1 by having only 32-bit
counters for inodes and block limits. For many installations this is not
limiting and thus the format is widely used. Also quota tools still
create quota files with this format by default. Add support for this
quota format to e2fsprogs so that we can seamlessly convert quota files
in this format into our internal quota files.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 22 Aug 2021 14:07:15 +0000 (10:07 -0400)]
tests: update expect file for u_direct_io
The u_direct_io test is normally not run (since it requires root
privileges); as a result, when the mke2fs.conf defaults were changed,
I didn't notice that the expected output for u_direct_io test needed
to be updated.
Fixes:
d730be5ceeba ("tests: update mke2fs.conf to create 256 byte inodes by default"
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jan Kara [Fri, 20 Aug 2021 16:15:02 +0000 (18:15 +0200)]
libss: add newer libreadline.so.8 to dlopen path
OpenSUSE Tumbleweed now has libreadline.so.8. Add it to the list of libs
to look for.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 19 Aug 2021 19:18:33 +0000 (15:18 -0400)]
debian/changelog: add missing section for 1.46.2-2
E2fsprogs 1.46.2-2 was uploaded during the release freeze, so the
changelog was assembled outside of the normal maint branch. Add it
now.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 17 Aug 2021 19:56:24 +0000 (15:56 -0400)]
fix unused-function -Wall warnings
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 17 Aug 2021 22:00:55 +0000 (18:00 -0400)]
debugfs: fix shadow and sign-compare -Wall warnings
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 19 Aug 2021 02:52:03 +0000 (22:52 -0400)]
Update release notes, etc., for the 1.46.4 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 17 Aug 2021 21:10:15 +0000 (17:10 -0400)]
libcom_err: fix suggest-attribute=format -Wall warnings
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 17 Aug 2021 21:08:56 +0000 (17:08 -0400)]
libss: fix fallthrough -Wall warnings
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 17 Aug 2021 22:01:39 +0000 (18:01 -0400)]
tests: fix shadow -Wall warnings in the crcsum test program
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 17 Aug 2021 19:45:49 +0000 (15:45 -0400)]
tests: fix "format not a string literal" -Wall warning in test_icount
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 17 Aug 2021 21:56:55 +0000 (17:56 -0400)]
libe2p: fix missing-prototypes and sign-compare -Wall warnings
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 17 Aug 2021 19:44:31 +0000 (15:44 -0400)]
debugfs: fix missing byte swap when dumping a revoke block
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 16 Aug 2021 12:18:59 +0000 (08:18 -0400)]
debian: switch to using build dependency on debhelper-compat
This is preferred in favor of using the debhelper/compat file, and we
no longer worry about supporting Debian Jessie or Debian Stretch
(at least without Stretch Backports).
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sat, 14 Aug 2021 22:53:30 +0000 (18:53 -0400)]
Update release notes, etc., for the 1.46.4-rc1 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 16 Aug 2021 00:42:14 +0000 (20:42 -0400)]
debian: set Rules-Requires-Root to "no".
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 15 Aug 2021 23:35:12 +0000 (19:35 -0400)]
Fix miscellaneous spelling errors in man pages, and release notes
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 15 Aug 2021 23:13:02 +0000 (19:13 -0400)]
Change "filesystem" to "file system" in the man pages
To improve consistency, use "file system" in all of the man pages in
preference over "filesystem".
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 15 Aug 2021 15:17:42 +0000 (11:17 -0400)]
libsupport: fix sort_r.h to work on FreeBSD
FreeBSD defines __GNU_SOURCE so this is not reliable marker that the
OS is using a glibc-style qsort_r(3).
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 15 Aug 2021 14:42:03 +0000 (10:42 -0400)]
mke2fs: allow the default creator os to be specified in /etc/mke2fs.conf
This is useful for keeping the regression test results consistent
when run on non-Linux systems, especially on GNU Hurd.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 15 Aug 2021 03:42:23 +0000 (23:42 -0400)]
config: update config.{guess,sub}
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sat, 14 Aug 2021 22:49:53 +0000 (18:49 -0400)]
resize2fs.8.in: clarify the description of the progress bar option
Addresses-Debian-Bug: #979411
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sat, 14 Aug 2021 22:08:19 +0000 (18:08 -0400)]
e2scrub: use WantedBy=multi-user.target in e2scrub_reap.service
Addresses-Debian-Bug: #991349
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Göran Uddeborg [Sat, 14 Aug 2021 21:10:48 +0000 (17:10 -0400)]
po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Pedro Albuquerque [Sat, 14 Aug 2021 21:10:48 +0000 (17:10 -0400)]
po: update pt.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jakub Bogusz [Sat, 14 Aug 2021 21:10:48 +0000 (17:10 -0400)]
po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Benno Schulenberg [Sat, 14 Aug 2021 21:10:48 +0000 (17:10 -0400)]
po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Samuel Thibault [Sat, 14 Aug 2021 21:10:48 +0000 (17:10 -0400)]
po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Petr Pisar [Sat, 14 Aug 2021 21:10:48 +0000 (17:10 -0400)]
po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sat, 14 Aug 2021 21:07:53 +0000 (17:07 -0400)]
tests: update mke2fs.conf to create 256 byte inodes by default
The regression tests have their own private copy of mke2fs which is
used when tests create file systems. Since we are now using 256 byte
inodes by default, the tests should reflect this.
While we're at it, modify the r_move_itable test so it actually tests
moving the inode table.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sat, 14 Aug 2021 14:39:13 +0000 (10:39 -0400)]
mke2fs: warn that bigalloc is experimental only for large cluster sizes
Since we have done a lot of testing with a cluster size equal to 64k
(or 16 times the default 4k block size), mke2fs will only warn for
bigalloc file systems where the cluster size is greater than 16 times
the block size.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Thu, 12 Aug 2021 23:22:22 +0000 (16:22 -0700)]
mke2fs: warn about missing y2038 support when formatting fresh ext4 fs
Filesystems with 128-byte inodes do not support timestamps beyond the
year 2038. Since we're now less than 16.5 years away from that point,
it's time to start warning users about this lack of support when they
format an ext4 filesystem with small inodes.
(Note that even for ext2 and ext3, we changed the default for
non-small file systems in 2008 in commit commit
b1631cce648e ("Create
new filesystems with 256-byte inodes by default").)
So change the mke2fs.conf file to specify 256-byte inodes even for
small filesystems, and then add a warning to mke2fs itself if someone
is trying to make us format a file system with 128-byte inodes. This
can be suppressed by setting the boolean option warn_y2038_dates in
the mke2fs.conf file to false, which we do in the case of GNU Hurd,
since it only supports 128 byte inodes as of this writing.
[ Patch reworked by tytso to only warn in the case of GNU Hurd, since
the default for ext2/ext3 was changed for all but small file systems
in 2008. ]
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jan Kara [Thu, 12 Aug 2021 13:32:16 +0000 (15:32 +0200)]
e2fsck: make sure quota files are not referenced from dirs
Quota files must not be referenced from directory entries. Otherwise
they can get corrupted under the hands of the kernel.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jan Kara [Wed, 4 Aug 2021 12:16:52 +0000 (14:16 +0200)]
tests: check quota file space usage does not get accounted
Check that space used by quota files themselves does not get accounted
into the space tracked by quota subsystem.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Heinrich Schuchardt [Wed, 11 Aug 2021 15:46:10 +0000 (17:46 +0200)]
tst_bitops: don't stop testing on low memory
Some build systems have 512 MiB memory or less, e.g. Ubiquity Edgeroute
Lite which can be used to build for the mips and mips64 architectures.
On these allocating 512 MIB will always fail. So if allocating 512 MiB
fails treat this as expected behavior and return 0.
This will allow testing to continue with the remaining tests.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 10 Aug 2021 19:36:46 +0000 (15:36 -0400)]
e2fsck: add maximum string length specifiers to fscanf format strings
When parsing strings from /proc/apm and /proc/acpi/ac_adapter, add
string length limits to prevent possible buffer overruns.
Addresses-Coverty-Bug: 1297496
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 10 Aug 2021 18:52:15 +0000 (14:52 -0400)]
libext2fs: fix coverity nits in tdb.c
Address unchecked returned value and a string not null terminated warnings.
Addresses-Coverity-Bug: 709473
Addresses-Coverity-Bug: 709474
Addresses-Coverity-Bug: 1464578
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 10 Aug 2021 18:02:33 +0000 (14:02 -0400)]
e2fsck: clean up two gcc -Wall warnings in recovery.c
Fix a signed vs unsigned and a void * pointer arithmetic warning.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Fri, 6 Aug 2021 09:58:20 +0000 (11:58 +0200)]
libsupport: fix potental NULL pointer dereferences in quota functions
get_dq() function can fail when the memory allocation fails and so we
could end up dereferencing NULL pointer. Fix it.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Fri, 6 Aug 2021 09:58:19 +0000 (11:58 +0200)]
libss: Add missing error handling for fdopen()
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Fri, 6 Aug 2021 09:58:18 +0000 (11:58 +0200)]
libss: handle memory allcation failure in ss_help()
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Fri, 6 Aug 2021 09:58:17 +0000 (11:58 +0200)]
libext2fs: remove augmented rbtree functionality
Rbtree code was originally taken from linux kernel. This includes the
augmented rbtree functionality, however this was never intended to be
used and is not used still. Just remove it.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Fri, 6 Aug 2021 09:58:16 +0000 (11:58 +0200)]
libext2fs: fix unexpected NULL variable
The ext2fs_check_mount_point() function can be called with mtpt being
NULL as for example from ext2fs_check_if_mounted(). However in the
is_swap_device condition we use the mtpt in strncpy without checking
whether it is non-null first.
This should not be a problem on linux since the previous attempt to open
the device exclusively would have prevented us from ever reaching the
problematic strncpy. However it's still a bug and can cause problems on
other systems, fix it by conditioning strncpy on mtpt not being null.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Fri, 6 Aug 2021 09:58:15 +0000 (11:58 +0200)]
ext2fs: initialize retval before using it
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Fri, 6 Aug 2021 09:58:14 +0000 (11:58 +0200)]
e2fsck: value stored to err is never read
Remove it to silence clang warning.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 10 Aug 2021 14:29:21 +0000 (10:29 -0400)]
e2fsck: drop gfp_t argument from blkdev_issue_flush()
This synchronizes e2fsprogs with kernel commit
c6bf3f0e25f4 ("block:
use an on-stack bio in blkdev_issue_flush").
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Thu, 5 Aug 2021 15:43:28 +0000 (08:43 -0700)]
tests: skip u_direct_io if losetup fails
This new test requires a loop device to run testing. While it checks
for some "obvious" parameters that might cause the test to fail such as
not being root and no losetup executable, it doesn't actually check that
the losetup -a call succeeds. This causes a test regression in my
package building container (where there is only a minimal /dev with no
loop devices available) so I can't build debian packages.
Fix the test to skip out if we can't create a loop device.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 4 Aug 2021 03:54:06 +0000 (23:54 -0400)]
mke2fs: fix a file descriptor leak when creating a file system image file
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jan Kara [Mon, 12 Jul 2021 15:43:09 +0000 (17:43 +0200)]
e2image: Dump quota files
Dump quota files to resulting filesystem image. They are fs metadata.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jan Kara [Mon, 12 Jul 2021 15:43:08 +0000 (17:43 +0200)]
quota: Do not account space used by project quota file to quota
Project quota files have high inode numbers but are not accounted in
quota usage. Do not track them when computing quota usage.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 3 Aug 2021 15:03:34 +0000 (11:03 -0400)]
ss_create_invocation: fix potential unititalized reference in error path
Fixes:
eccdde1ff381 ("ss_create_invocation: fix error handling when ...")
Addresses-Coverity-Bug: 1489771
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Zhiqiang Liu [Wed, 28 Jul 2021 01:56:48 +0000 (09:56 +0800)]
lsattr: check whether path is NULL in lsattr_dir_proc()
In lsattr_dir_proc(), if malloc() return NULL, it will cause
a segmentation fault problem.
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Zhiqiang Liu [Wed, 28 Jul 2021 01:56:47 +0000 (09:56 +0800)]
hashmap: change return value type of ext2fs_hashmap_add()
In ext2fs_hashmap_add(), new entry is allocated by calling
malloc(). If malloc() return NULL, it will cause a
segmentation fault problem.
Here, we change return value type of ext2fs_hashmap_add()
from void to int. If allocating new entry fails, we will
return -1, and the callers should also verify the return
value of ext2fs_hashmap_add().
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Wu Guanghao [Wed, 28 Jul 2021 01:56:46 +0000 (09:56 +0800)]
ss_create_invocation: fix error handling when memory allocation fails
In ss_create_invocation(), it is necessary to check whether
returned by malloc is a null pointer.
Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Wu Guanghao [Wed, 28 Jul 2021 01:56:45 +0000 (09:56 +0800)]
ss_add_info_dir: fix error handling when memory allocation fails
If the realloc() and malloc() calls fail, avoid a memory leak as well
as a potential seg fault.
[ Fix error code setting to avoid depending on malloc() and realloc()
setting errno. -- TYT ]
Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Reviewed-by: Wu Bo <wubo40@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 3 Aug 2021 01:08:01 +0000 (21:08 -0400)]
mke2fs: fix creating a file system image w/o a pre-existing file
The mke2fs program should allow creating a file system image when an
explicit file system size is specified, even if the file doesn't yet
exist. By deferring the call to check_plausible() in commit
942b00cb9d2f ("mke2fs: do not warn about a pre-existing partition
table when using a non-zero offset") this behaviour was broken.
Fix this regression by explicitly creating the file if the file system
size is specified.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Samuel Holland [Sat, 29 May 2021 03:14:04 +0000 (22:14 -0500)]
libext2fs: improve error handling in POSIX ACL conversions
When encoding a POSIX ACL to the EXT4 ACL format, if an unknown tag
is encountered, that entry is silently ignored. It would be better
to return an error to inform the user that the ACL is incompatible.
Also fix the mismatched indentation in the opposite function.
Signed-off-by: Samuel Holland <samuel@sholland.org>
Theodore Ts'o [Fri, 30 Jul 2021 17:11:40 +0000 (13:11 -0400)]
setup-schroot: install the acl and libreadline-dev packages
The acl package is needed to run the m_rootdir_acl test. The
libreadline-dev package will drag in the shared library package for
libreadline (libreadlineN) so that the developer running debugfs will
be able to use line editing.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 30 Jul 2021 17:10:28 +0000 (13:10 -0400)]
tests: skip m_rootdir_acl on GNU Hurd
The GNU Hurd doesn't support Posix ACL's, so even if the acl package
is installed, the setfattr command will fail. So just skip the test
on Hurd.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 30 Jul 2021 16:29:44 +0000 (12:29 -0400)]
libext2fs: fix translation of Posix ACL's on big-endian systems
The ACL returned by the kernel in lgetxattr(2) is returned in Little
Endian, even on Big Endian systems. Fix the functions
convert_posix_acl_to_disk_buffer() and convert_disk_buffer_to_posix_acl()
to work correctly on Big Endian systems. This fixes a failure of
the test m_rootdir_acl.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 30 Jul 2021 00:57:42 +0000 (20:57 -0400)]
contrib: add setup-schroot command for use on Debian porter boxes
Signed-off-by: Theodore Ts'o <tytso@mit.edu>