Commit Graph

6675 Commits

Author SHA1 Message Date
Theodore Ts'o
71f9bf7b08 libext2fs: fix crash when ext2fs_mmp_stop() is called before MMP is initialized
The fatal_error() function in e2fsck can call ext2fs_mmp_stop() on a
file system where MMP hasn't yet been initialized.  When that happens,
instead of crashing, have ext2fs_mmp_stop() return success, since mmp
doesn't need to be stopped if it hasn't even been initialized yet.

Addresses-Debian-Bug: #696609
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-14 23:51:45 -05:00
Theodore Ts'o
e3a13a47e6 tune2fs: teach tune2fs to use a random value for "-c random"
Addresses-Debian-Bug: #926293
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-14 10:37:00 -05:00
Theodore Ts'o
ff9b039b1f debugfs: clamp journal s_maxlen value when dumping the journal log
Addresses-Coverity-Bug: 1432478
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-13 11:54:58 -05:00
Theodore Ts'o
28e22540e2 debugfs: fix logdump on file systems with block sizes > 8192
Addresses-Coverity-Bug: 1472879
Addresses-Coverity-Bug: 1472880
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-13 10:35:50 -05:00
Theodore Ts'o
462c424500 debugfs: fix memory allocation failures when parsing journal_write arguments
Fix double-free issues when parsing an invalid journal_write command,
such as: "journal_write -b 12 -b BAD -b 42".

Addresses-Coverity-Bug: 1464571
Addresses-Coverity-Bug: 1464575
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12 21:43:00 -05:00
Theodore Ts'o
eef68a593f debugfs: fix header checks in logdump
Fixes: bd9ac48c92 ("debugfs: add journal header checks in logdump")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12 16:50:07 -05:00
Theodore Ts'o
4d8169ad2a e2fsck: fix error code return in e2fsck_read_extents()
Addresses-Coverity-Bug: 1472586
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12 15:12:42 -05:00
Theodore Ts'o
1b25ea248c libext2fs: fix incorrect error code return in ext2fs_add_jounral_inode3()
Addresses-Coverity-Bug: 1472255
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12 15:10:11 -05:00
Theodore Ts'o
bd9ac48c92 debugfs: add journal header checks in logdump
Addresses-Coverity-Bug: 1431466
Addresses-Coverity-Bug: 1432478
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12 12:04:21 -05:00
Theodore Ts'o
10f9b11b76 badblocks: add error checking for command-line arguments for -b and -c
Also remove a dead assignment (the value of try is overwritten after
the continue statement).

Addresses-Coverity-Bug: 1297515
Addresses-Coverity-Bug: 1464573
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12 11:53:23 -05:00
Theodore Ts'o
46fcf7087b ext2_fs.h: use the ext2fs_has_feature_64bits() instead of open coded check
This makes the code a bit cleaner and fixes a false positive warning by
Coverity.  (CID #1464576)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12 00:10:06 -05:00
Theodore Ts'o
ea41284998 e2fsck: add error checking for ext2fs_extent_get_info()
This function can't actually fail today, but in the future it could
return an error, so it's better to add the appropriate error check.

Addresses-Coverity-Bug: #1464579
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-11 23:47:32 -05:00
Theodore Ts'o
33b9a60c36 Fix clang warnings on architectures with a 64-bit long
On most systems where we compile e2fsprogs, the u64 type is an
unsigned long long.  However, there are platforms (such as the
PowerPC) where a long 64-bits and so u64 is typedef'ed to be unsigned
long instead of a unsigned long long.  Fix this by using explicit
casts in printf statements.  For scanf calls, we need to receive the
value into a unsigned long long, and then assign it to a u64, after
doing range checks.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-11 10:55:21 -05:00
Theodore Ts'o
fb874e6ff4 mke2fs: fix resource leak on error path when creating inodes
Addresses-Coverity-Bug: 1472856
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-11 10:45:13 -05:00
Theodore Ts'o
b79f56ce5d tests: fix environmental dependency in m_rootdir_acl
The test script had a dependency on the group id for the "adm" group
being 4.  Fixed by hard-coding the group id for the default acl for
the acl_dir directory.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-10 11:12:49 -05:00
Theodore Ts'o
df0fe7c9a3 Update release notes, etc., for the 1.46.1 release
(Also update some inaccuracies in the 1.46.0 release.)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 18:36:32 -05:00
Yuri Chornoivan
d50ffa90a4 po: update uk.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Göran Uddeborg
66b6b4869b po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Pedro Albuquerque
4a9730000f po: update pt.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Jakub Bogusz
1f1b285c2c po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Sharuzzaman Ahmat Raslan
1d4a6b2a1e po: update ms.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Samuel Thibault
a9c317cc50 po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Petr Pisar
77e1dd3fc0 po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:37:28 -05:00
Theodore Ts'o
67e6ae0a35 mke2fs: fix a importing a directory with an ACL and inline data
If an inode which is copied into a file system using "mke2fs -d" has
an ACL (or extended attributes) and it is also using inline data, when
the extended attribute(s) are copied in, the inline data gets dropped due to a missing call to ext2fs_xattrs_read().

Addresses-Debian-Bug: #971014
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 17:11:23 -05:00
Theodore Ts'o
b637c57d12 debian: add build profiles noudeb and pkg.e2fsprogs.no-static
Addresses-Debian-Bug: #966686
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 15:56:12 -05:00
Theodore Ts'o
8c9e2921ec configure.ac: convert all help strings to use AS_HELP_STRING
Some help strings were using the deprecated AC_HELP_STRING, and others
were completely hard-coded.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 15:54:12 -05:00
Theodore Ts'o
319b6c4f1c Provide and use sort_r() instead of qsort_r() for portability reasons
The qsort_r() function is specific to glibc.  It is not present in the
musl C library.  Worse, FreeBSD supports qsort_r, but with an
incompatible interface.  So use sort_r() from commit c8c65c1e183d
from the git repository: https://github.com/noporpoise/sort_r

https://github.com/tytso/e2fsprogs/issues/58

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09 15:27:51 -05:00
Harshad Shirwadkar
4e95b37230 e2fsck: endianness fixes for fast commit replay
There are a few places where the endianness conversion wasn't done
right. This patch fixes that. Verified that after this patch,
j_recover_fast_commit passes on big endian qemu VM.

root@debian-powerpc:~/e2fsprogs/tests# make j_recover_fast_commit
j_recover_fast_commit: : ok

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-08 23:36:48 -05:00
Harshad Shirwadkar
2fae964a0e ext2fs: initialize handle to NULL in ext2fs_count_blks
Initialize the handle to NULL to ensure that in error cases,
ext2fs_free_mem can be called on it.

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-08 23:36:21 -05:00
Andreas Dilger
f15b1aaf8f e2fsck: fix check of directories over 4GB
If directories grow larger than 4GB in size with the large_dir
feature, e2fsck will consider them to be corrupted and clear
the high bits of the size.

Since it isn't very common to have directories this large, and
unlike sparse files that don't have ill effects if the size is
too large, an too-large directory will have all of the sparse
blocks filled in by e2fsck, so huge directories should still
be viewed with suspicion.  Check for consistency between two of
the three among block count, inode size, and superblock large_dir
flag before deciding whether the directory inode should be fixed
or cleared, or if large_dir should be set in the superblock.

Update the f_recnect_bad test case to match new output.

Fixes: 49f28a06b7 ("e2fsck: allow to check >2GB sized directory")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Lustre-bug-id: https://jira.whamcloud.com/browse/LU-14345
Change-Id: I1b898cdab95d239ba1a7b37eb96255acadce7057
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-08 22:40:42 -05:00
Theodore Ts'o
d9844883a1 libext2fs: fix more compiler warnings
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-07 23:27:56 -05:00
Theodore Ts'o
9f4e9fbbe2 libext2fs: fix segault when setting an xattr with an unknown prefix
Also avoid unnecessary calls to find_ea_index() by caching the short
name and name index in the ext2_attr structure.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-07 23:21:58 -05:00
Andreas Dilger
f41c7da2e4 misc: fix minor llvm warnings
Fix a couple minor type mismatch warnings.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-07 20:30:21 -05:00
Theodore Ts'o
ee2ee8343e debian: drop transitional packages
We renamed the libcomerr2, e2fslibs, and e2fslibs-dev packages to
match Debian package naming convetions in Debian 10 (Buster).  Now
that Debian 11 (Bullseye) is about to be released, we no longer need
the transitional packages.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 23:35:38 -05:00
Theodore Ts'o
24487a7fa6 configure.ac: fix build failure on systems with pthreads && !fuse support
The configure script checks for pthread.h as part of double-checking
that the FUSE support works correctly, which implicitly defined
HAVE_PHREAD_H.  If the FUSE libraries are not present (or fuse support
is explicitly disabled), this check doesn't happen and so
HAVE_PTHREAD_H is not defined, and this causes a build failure.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 22:28:31 -05:00
Theodore Ts'o
2b0d66bbec Update release notes, etc., for the 1.46.0 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 17:02:31 -05:00
Theodore Ts'o
30d07316e5 Update makefile dependencies
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 17:00:06 -05:00
Theodore Ts'o
2eebc9949c Update debian/libext2fs2.symbols with the additions to the shared library
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 01:56:41 -05:00
Theodore Ts'o
e678ab3970 Merge branch 'maint' into next 2021-01-29 01:13:18 -05:00
Theodore Ts'o
35b67cab5c e2fsck: drop use of sysctl(2)
Remove the use of the binary interface using the sysctl(2) system call
since sys/sysctl.h has been deprecated.  We can find the total memory
available in the system using the POSIX standard sysconf(2) interface.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 01:10:29 -05:00
Theodore Ts'o
3fb16e7424 configure.ac: add substitution for @mkdir_p@ since po/Makefile.in.in uses it
Fixes: e598c29b4d ("Update gettext files to version 0.19.8")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 01:10:18 -05:00
Theodore Ts'o
fa86b5c2aa Update release notes, etc., for the 1.45.7 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29 00:51:02 -05:00
Мирослав Николић
37226f12ba po: update sr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28 14:27:00 -05:00
Benno Schulenberg
43d9f902b8 po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28 14:27:00 -05:00
Sharuzzaman Ahmat Raslan
d863dafb60 po: update ms.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28 14:27:00 -05:00
Theodore Ts'o
5162872480 misc: fix a spelling nit in the mke2fs man page
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28 14:21:09 -05:00
Theodore Ts'o
7f69ca1757 Update Makefile dependencies for lib/e2p and lib/ext2fs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28 01:31:21 -05:00
Theodore Ts'o
6be3ce7a54 Merge branch 'maint' into next 2021-01-28 00:52:22 -05:00
Jiyong Park
e1af9546e6 AOSP: Add assemble_cvd to com.android.virt
assemble_cvd directly or indirectly depends on these modules. To add
assemble_cvd to the com.anroid.virt APEX, these modules are marked as
being available to the APEX.

Google-Bug-Id: 174639526
Test: m com.android.virt
Change-Id: Ibc28d24abd358fb1f8608b3f3d6d06c2746f2d72
From AOSP commit: e70718ecae3cf1e2a26af800734130e003186e7e
2021-01-28 00:05:08 -05:00
Yifan Hong
643ee34074 AOSP: tune2fs/resize2fs: make vendor_ramdisk_available.
The vendor_ramdisk variant is dynamic, unlike the ramdisk variant.

Test: builds
Google-Bug-Id: 173425293
Change-Id: I45547b5ea99aae98727121c038129844b7930ed6
From AOSP commit: 073ede3200afeffd82889cb61a71fa1947314476
2021-01-28 00:04:14 -05:00