aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2021-08-03dumpe2fs, debugfs, e2image: Add support for orphan filepuJan Kara3-1/+6
Print inode number of orphan file in outputs, dump e2image file to filesystem image. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-08-03mke2fs: Add orphan_file feature into mke2fs.confJan Kara1-1/+3
Enable orphan_file feature by default in larger filesystems. Since the feature is COMPAT, older kernels will just ignore it and happily work with the filesystem as well. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-08-03tune2fs: Add support for orphan_file featureJan Kara2-2/+92
Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-08-03e2fsck: Add support for handling orphan fileJan Kara7-44/+546
Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-08-03mke2fs: Add support for orphan_file featureJan Kara2-1/+40
Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-08-03libext2fs: Support for orphan file featureJan Kara8-8/+331
Add support for creating and deleting orphan file and a couple of utility functions that will be used in other tools. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-08-03e2image: Dump quota filesJan Kara1-3/+6
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>
2021-08-03quota: Do not account space used by project quota file to quotaJan Kara1-3/+5
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>
2021-08-03ss_create_invocation: fix potential unititalized reference in error pathTheodore Ts'o1-0/+1
Fixes: eccdde1ff381 ("ss_create_invocation: fix error handling when ...") Addresses-Coverity-Bug: 1489771 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-08-02lsattr: check whether path is NULL in lsattr_dir_proc()Zhiqiang Liu1-0/+5
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>
2021-08-02hashmap: change return value type of ext2fs_hashmap_add()Zhiqiang Liu4-9/+29
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>
2021-08-02ss_create_invocation: fix error handling when memory allocation failsWu Guanghao1-9/+33
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>
2021-08-02ss_add_info_dir: fix error handling when memory allocation failsWu Guanghao1-2/+5
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>
2021-08-02mke2fs: fix creating a file system image w/o a pre-existing fileTheodore Ts'o1-0/+19
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>
2021-07-30libext2fs: improve error handling in POSIX ACL conversionsSamuel Holland1-3/+5
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>
2021-07-30setup-schroot: install the acl and libreadline-dev packagesTheodore Ts'o1-1/+1
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>
2021-07-30tests: skip m_rootdir_acl on GNU HurdTheodore Ts'o1-0/+7
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>
2021-07-30libext2fs: fix translation of Posix ACL's on big-endian systemsTheodore Ts'o1-8/+8
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>
2021-07-29contrib: add setup-schroot command for use on Debian porter boxesTheodore Ts'o1-0/+44
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-29tests: add description for j_recover_fast_commitTheodore Ts'o1-0/+1
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-29tests: force test file systems to be built for the Linux OSTheodore Ts'o39-68/+58
This is needed to fix a large number of test failures on GNU Hurd. Also skip a number of tests that require creating very large test file systems,since Hurd does not support files greater than 4GB. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-28tests: try using truncate command before falling back to using ddTheodore Ts'o1-5/+7
On the GNU Hurd, dd seems to be buggy and hangs if seeking beyond 4G. Fortunately the GNU Hurd does have the truncate command, which does work correctly. So try using the truncate command first, and fall back to using dd only if the truncate command doesn't work. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-28libsupport: fix sort_r.h to work on the GNU HurdTheodore Ts'o1-4/+4
On the GNU Hurd both __MACH__ and __GNU__ are defined. So rearrange the #ifdef to prioritize checking for GLIBC compatibility over BSD compatibility. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-28e2fsck: fix f_baddotdir failure on big-endian systemsTheodore Ts'o1-5/+13
Commit 63f44aafb1f2 ("e2fsck: fix ".." more gracefully if possible") changed the check_dot() function to try to avoid resetting the '..' entry when the '.' entry is too large.. But if we do that, then on big-endian systems, we need to try byte swapping the rest of the directory entries, or else the f_baddotdir test will fail on big-endian systems. Also add a check to avoid UBSAN warning when there is not enough space at the end of the directory block for a directory entry, and so we can potentially overflow some pointer arithmetic when trying to byte swap the remainder of the (negative) space in the directory block. Fixes: 63f44aafb1f2 ("e2fsck: fix ".." more gracefully if possible") Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-27Update release notes, etc., for the 1.46.3 releasev1.46.3Theodore Ts'o10-408/+529
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-27AOSP: Move system_shared_libs into target.bionic clauseColin Cross6-17/+3
Use target.bionic.system_shared_libs when it is used to limit the default shared libraries (as opposed to remove them completely). This avoids attempting to add a host dependency on libc when system_shared_libs is modified to apply to all variants. Also remove system_shared_libs from static binaries where it has no effect, and consolidate it into e2fsprogs-defaults. Bug: 193559105 Test: m checkbuild Change-Id: I2d447b006afc783f4acd6c1acd93f338a68a01ed From AOSP commit: 48fa7248112701c30d3cabfb8d3360b2408d6491
2021-07-27AOSP: Use -Wno-pointer-arith in Android buildEric Biggers1-1/+1
Some "arithmetic on a void pointer is a GNU extension" warnings were introduced into upstream e2fsprogs, but they are of questionable value, so disable them for now. Change-Id: I19e99382e9434828927c1b8287b91f3333110151 From AOSP commit: f203c38fd43dc384cedfcaeb155771a15906022f
2021-07-27AOSP: Add a new upstream source file to lib/e2p/Android.bpEric Biggers1-0/+1
Change-Id: Ibc305759a9046996a397d652d799e930629f9f71 From AOSP commit: a02aa2b8e145449711e0dcdae5573fbaa888bf33
2021-07-27AOSP: [LSC] Add LOCAL_LICENSE_KINDS to external/e2fsprogsBob Badour15-0/+203
Added SPDX-license-identifier-0BSD SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-LGPL SPDX-license-identifier-LGPL-2.0 SPDX-license-identifier-LGPL-2.1 SPDX-license-identifier-LGPL-3.0 SPDX-license-identifier-MIT legacy_notice legacy_unencumbered to: Android.bp Added SPDX-license-identifier-0BSD SPDX-license-identifier-BSD SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-LGPL SPDX-license-identifier-LGPL-2.1 SPDX-license-identifier-LGPL-3.0 SPDX-license-identifier-MIT legacy_unencumbered to: lib/Android.bp Added SPDX-license-identifier-0BSD SPDX-license-identifier-BSD SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-MIT to: lib/et/Android.bp Added SPDX-license-identifier-0BSD SPDX-license-identifier-MIT to: lib/ss/Android.bp Added SPDX-license-identifier-Apache-2.0 to: contrib/android/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-GPL to: contrib/Android.bp Added SPDX-license-identifier-BSD to: lib/uuid/Android.bp Added SPDX-license-identifier-GPL to: resize/Android.bp Added SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0 to: debugfs/Android.bp Added SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-LGPL to: e2fsck/Android.bp Added SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-LGPL SPDX-license-identifier-LGPL-2.1 SPDX-license-identifier-LGPL-3.0 legacy_unencumbered to: lib/ext2fs/Android.bp Added SPDX-license-identifier-GPL SPDX-license-identifier-LGPL to: lib/e2p/Android.bp Added SPDX-license-identifier-GPL SPDX-license-identifier-LGPL SPDX-license-identifier-LGPL-2.1 SPDX-license-identifier-LGPL-3.0 to: lib/blkid/Android.bp misc/Android.bp Added SPDX-license-identifier-GPL SPDX-license-identifier-MIT to: lib/support/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: I239a04a83f12ba051be911d18f6df4ae77fb3368 From AOSP commit: e86522c572b5715b85889cf8ca1c52a5cc350ca7
2021-07-27po: update sr.po (from translationproject.org)Мирослав Николић1-915/+1011
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-27po: update nl.po (from translationproject.org)Benno Schulenberg1-920/+1025
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-27po: update ms.po (from translationproject.org)Sharuzzaman Ahmat Raslan1-973/+1052
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-25Fix miscellaneous compiler warnings using "make gcc-wall"Theodore Ts'o22-75/+127
Address a number of signed vs. unsigned comparison errors, unused function parameters, casts which drop const, etc. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-24libext2fs: avoid unnecessary stat(2) calls on mountpointsTheodore Ts'o1-4/+4
If the device name in the mtab or /proc/mounts file does not match with the device passed into ext2fs_check_if_mounted() or ext2fs_check_mount_point(), skip the stat(2) call on the mountpoint, since we never use the results of the stat(2) in that case. Not only does this provide a slight performance win, but it the stat calls on the mountpoints could potentially trigger some SELinux denials that could stress some sysadmins out. Google-Bug-Id: 193137337 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-23debian/changelog: fix missing Closed: annotationTheodore Ts'o1-1/+1
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-21AOSP: e2fsdroid: Don't over-reserve blocks for files in Base FS.David Anderson1-9/+30
If a large number of blocks move from one file to another file, e2fsdroid will inadvertently reserve the moved blocks for the source file. If the larger file is visited first, it can fail to acquire blocks because they're reserved by the smaller file. This patch only reserves the first N blocks of a file in Base FS, where N is large enough to satisfy the |st_size| property from lstat(2). We only consider "owned" blocks rather than deduplicated blocks, in case the new file cannot be deduplicated. Google-Bug-Id: 145316683 Test: e2fsdroid with dynamic partitions Change-Id: I32e255a19550d52d90342c21d7218981108a71b1 From AOSP commit: 2985b26cdbe674084fa02b211503eef9bf970023
2021-07-21mke2fs: do not warn about a pre-existing partition table when using a ↵Theodore Ts'o2-16/+17
non-zero offset The existing code attempted to avoid warning about a pre-existing file system with a non-zero offset, but because the offset was not set at the time of the check, this intention was not actually working. So this commit will suppress warnings about pre-existing a partition table as well as pre-existing file system when there is a non-zero offset. Addresses-Debian-Bug: #989612 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-18mke2fs: only try discarding a single block to test if discard worksTheodore Ts'o1-3/+2
Commit d2bfdc7ff15c ("Use punch hole as "discard" on regular files") added a test to see if the storage device actually supports discard. The intent was to try discarding the first block but since io_channel_discard() interprets the offset and count arguments in blocks, and not bytes, mke2fs was actually discarding the first 16 megabytes (when the block size is 4k). This is normally not a problem, since most file systems are larger than that, and requests to discard beyond the end of the block device are ignored. However, when creating a small file system as part of a image containing multiple partitions, the initial test discard can end up discarding data beyond the file system being created. Addresses-Debian-Bug: #989630 Reported-by: Josh Triplett <josh@joshtriplett.org> Fixes: d2bfdc7ff15c ("Use punch hole as "discard" on regular files") Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-16libext2fs: avoid forking a single thread in ext2fs_rw_bitmaps()Theodore Ts'o1-1/+1
https://github.com/tytso/e2fsprogs/issues/67 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-16libe2p: use stat to prevent calling EXT2_IOC_[GS]ETFLAGS on devicesTheodore Ts'o2-0/+24
Some devices can react badly to the EXT2_IOC_[GS]ETFLAGS ioctls, since ioctl codes are not guaranteed to be unique across different device drivers and file systems. Addresses-Debian-Bug: #986332 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-15ext2ed: fix potential NULL pointer dereference in dupstr()Zhiqiang Liu1-0/+2
In dupstr(), we should check return value of malloc(). Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com> Reviewed-by: Wu Bo <wubo40@huawei.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-15lib/ss/error.c: check return value malloc in ss_name()Zhiqiang Liu1-0/+2
In ss_name(), we should check return value of malloc(), otherwise, it may 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>
2021-07-15misc: fix potential segmentation fault problem in scandir()Zhiqiang Liu1-0/+2
In scandir(), temp_list[num_dent] is allocated by calling malloc(), we should check whether malloc() returns NULL before accessing temp_list[num_dent]. 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>
2021-07-15argv_parse: check return value of malloc in argv_parse()Zhiqiang Liu1-0/+2
In argv_parse(), return value of malloc should be checked whether it is NULL, otherwise, it may cause a segfault error. 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>
2021-07-15append_pathname: check the value returned by reallocwuguanghao1-1/+8
In append_pathname(), we need to add a new path to save the value returned by realloc, otherwise the name->path may be NULL, causing a segfault. 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>
2021-07-15zap_sector: fix memory leakwuguanghao1-1/+3
In zap_sector(), need free buf before return, otherwise it will cause memory leak. 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>
2021-07-15tdb_transaction_recover: fix memory leakwuguanghao1-0/+1
In tdb_transaction_recover(), need free data before return, otherwise it will cause memory leak. 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>
2021-07-15profile_create_node: set magic before strdup(name) to avoid memory leakwuguanghao1-1/+1
If new->magic != PROF_MAGIC_NODE, profile_free_node() don't free node. This will cause the node to be unable to be released correctly and a memory leak will occur. 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>
2021-07-06libext2fs: fix a -Wunused-label warningEric Biggers1-1/+0
Remove a label which isn't used. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-06Fix -Wunused-variable warningsEric Biggers8-11/+6
Fix all warnings about unused variables that were introduced since e2fsprogs v1.45.4. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-06Fix -Wunused-parameter warningsEric Biggers6-8/+14
Fix all warnings about unused function parameters that were introduced since e2fsprogs v1.45.4, by adding EXT2FS_ATTR((unused)) or removing parameters as appropriate. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-06mke2fs: use ext2fs_get_device_size2() on all platformsEric Biggers1-6/+0
Since commit e8c858047be6 ("libext2fs: fix build issue for on Windows/Cygwin systems"), ext2fs_get_device_size2() is available in Windows builds of libext2fs. So there is no need for mke2fs to call ext2fs_get_device_size() instead. This fixes a -Wincompatible-pointer-types warning because ext2fs_get_device_size() was being passed a 'blk64_t *', but it expected a 'blk_t *'. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-06e2fsck: sync fc_do_one_pass() changes from kernelEric Biggers1-3/+2
Sync the changes to fc_do_one_pass() from the kernel's recovery.c so that e2fsck picks up the fixes to the jbd_debug() statements. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-06libext2fs: improve jbd_debug() implementationEric Biggers3-29/+5
Make jbd_debug() do format string checking (but still get compiled away to nothing) when --enable-jbd-debug isn't specified, similar to commit d556435156b7 ("jbd2: avoid -Wempty-body warnings") on the kernel side. This should prevent --enable-jbd-debug from getting broken due to bad jbd_debug() statements. It also eliminates a -Wunused-variable warning where a variable was only used in a jbd_debug() statement. Also remove an alternative definition of jbd_debug() that was conditional on CONFIG_JBD_DEBUG && !CONFIG_JBD_DEBUG, so was dead code. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-06tune2fs: update overhead when toggling journal featureJan Kara1-2/+8
When adding or removing journal from a filesystem, we also need to add / remove journal blocks from overhead stored in the superblock. Otherwise total number of blocks in the filesystem as reported by statfs(2) need not match reality and could lead to odd results like negative number of used blocks reported by df(1). Fixes: 9046b4dfd0ce ("mke2fs: set overhead in super block") Signed-off-by: Jan Kara <jack@suse.cz> Reviewed-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-06e2fsck: fix last mount/write time when e2fsck is forcedLukas Czerner1-6/+6
With commit c52d930f e2fsck is no longer able to fix bad last mount/write time by default because it is conditioned on s_checkinterval not being zero, which it is by default. One place where it matters is when other e2fsprogs tools require to run full file system check before a certain operation. If the last mount time is for any reason in future, it will not allow it to run even if full e2fsck is ran. Fix it by checking the last mount/write time when the e2fsck is forced, except for the case where we know the system clock is broken. [ Reworked the conditionals so error messages claiming that the last write/mount time were corrupted wouldn't be always printed when the e2fsck was run with the -f option, thus causing 299 out of 372 regression tests to fail. -- TYT ] Fixes: c52d930f ("e2fsck: don't check for future superblock times if checkinterval == 0") Reported-by: Dusty Mabe <dustymabe@redhat.com> Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-06e2fsck: fix ".." more gracefully if possibleAndreas Dilger9-22/+36
If the "." entry is corrupted, it will be reset in check_dot(). It is possible that the ".." entry can be recovered from the directory block instead of also resetting it immediately. If it appears that there is a valid ".." entry in the block, allow that to be used, and let check_dotdot() verify the dirent itself. When resetting the "." and ".." entries, use EXT2_FT_DIR as the file type instead of EXT2_FT_UNKNOWN for the very common case of filesystems with the "filetype" feature, to avoid later problems that can be easily avoided. This can't always be done, even if filesystems without "filetype" are totally obsolete, because many old test images do not have this feature enabled. Fixup affected tests using the new "repair-test" script that updates the expect.[12] files from $test.[12].log for the given tests and re-runs the test to ensure it now passes. Signed-off-by: Andreas dilger <adilger@whamcloud.com> Reviewed-by: Artem Blagodarenko <artem.blagodarenko@hpe.com> Lustre-bug-Id: https://jira.whamcloud.com/browse/LU-14710 Change-Id: Ia5e579bcf31a9d9ee260d5640de6dbdb60514823 Reviewed-on: https://review.whamcloud.com/43858 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-05libext2fs: use offsetof() from stddef.hMichael Forney1-12/+1
offsetof is a standard C feature available from stddef.h, going back all the way to ANSI C. Signed-off-by: Michael Forney <mforney@mforney.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-05libext2fs: use statement-expression for container_of only on GNU-compatible ↵Michael Forney1-0/+5
compilers Functionally, the statement-expression is not necessary here; it just gives a bit of type-safety to make sure the pointer really does have a compatible type with the specified member of the struct. When statement expressions are not available, we can just use a portable fallback macro that skips this member type check. Signed-off-by: Michael Forney <mforney@mforney.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-05-07e2image: fix overflow in l2 table processingArtem Blagodarenko1-1/+1
For a large partition during e2image capture process it is possible to overflow offset at multiply operation. This leads to the situation when data is written to the position at the start of the image instead of the image end. Let's use the right cast to avoid integer overflow. Signed-off-by: Alexey Lyashkov <c17817@cray.com> Signed-off-by: Artem Blagodarenko <c17828@cray.com> HPE-bug-id: LUS-9368 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-05-07tests: add test of Direct I/O support in the Unix I/O managerTheodore Ts'o2-0/+105
This test requires root, and only works on Linux systems. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-05-07libext2fs: fix Direct I/O support in the Unix I/O managerAlexander Kanavin1-7/+8
Commit d557b9659ba9 ("libext2fs: fix potential races in unix_io") contained some additional changes that were supposed to clarify the management of the length calculations when reading and writing non-page aligned data using Direct I/O; unfortunately, those changes were incorrect, and actually broke the Direct I/O support. Fix these problems by reverting those portions of that commit. [ commit description rewritten by tytso ] Originally from https://github.com/tytso/e2fsprogs/pull/68 Fixes: d557b9659ba9 ("libext2fs: fix potential races in unix_io") Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-05-07libext2fs: fix missing mutex unlock in an error path of the Unix I/O managerAlexander Kanavin1-1/+1
Originally from https://github.com/tytso/e2fsprogs/pull/68 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-05-06e2fsck: fix unaligned accesses to ext4_fc_add_range and fc_raw_inodeTheodore Ts'o1-9/+7
These fast commit related structures can be unaligned on disk. So we need to avoid accessing these structures directly, and first copy them to memory which we know is appropriately aligned. This fixes an e2fsck crash while running the j_recovery_fast_commit regression test on a sparc64 system. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-05-06e2fsck: fix unaligned accesses to ext4_fc_tl structHarshad Shirwadkar3-72/+65
Fast commit related struct ext4_fc_tl can be unaligned on disk. So, while accessing that we should ensure that the pointers are aligned. This patch fixes unaligned accesses to ext4_fc_tl and also gets rid of macros fc_for_each_tl and ext4_fc_tag_val that may result in unaligned accesses to struct ext4_fc_tl. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-05-06e2fsck: fix portability problems caused by unaligned accessesTheodore Ts'o3-50/+56
The on-disk format for the ext4 journal can have unaigned 32-bit integers. This can happen when replaying a journal using a obsolete checksum format (which was never popularly used, since the v3 format replaced v2 while the metadata checksum feature was being stablized), and in the fast commit feature (which landed in the 5.10 kernel, although it is not enabled by default). This commit fixes the following regression tests on some platforms (such as running 32-bit arm architectures on a 64-bit arm kernel): j_recover_csum2_32bit, j_recover_csum2_64bit, j_recover_fast_commit. https://github.com/tytso/e2fsprogs/issues/65 Addresses-Debian-Bug: #987641 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-04-11blkid: include time.h to provide explicit declaration for time()Theodore Ts'o2-1/+2
This was originally reported to the MacPorts of e2fsprogs at: https://github.com/macports/macports-ports/pull/9137 Reported-by: Ryan Schmidt <ryandesign@macports.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-04-02filefrag: minor usability improvementsAndreas Dilger2-41/+74
Add '-V' to filefrag to print the installed version of the tool. If '-V' is used twice, print out the list of supported FIEMAP flags. This can be used to check if filefrag understands a specific feature. Include FIEMAP in the error message printed when filefrag cannot get the file layout. Since FIEMAP is commonly available and tried first, it should also be mentioned in the error message unless it was requested to only run FIBMAP. Update filefrag.1.in man page to cover the new -V option. Fix a formatting error with the recently added '-P' options, and include '-E' and '-P' in the SYNOPSIS section. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Lustre-bug-id: https://jira.whamcloud.com/browse/LU-11848 Reviewed-by: Wang Shilong <wshilong@whamcloud.com> Change-Id: Ib126bdd70efa1775aef6db761f54e27a593ebbe5 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-04-02e2image: add OPTIONS section to man pageAndreas Dilger1-166/+184
Reorganize the e2image.8 man page so that the command-line options are listed in a dedicated OPTIONS section, rather than being interspersed among the text in the DESCRIPTION section. Otherwise, it is difficult to determine which options are available, and to find where each option is described. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-04-02misc: remove useless code in set_inode_xattr()Zhiqiang Liu1-1/+0
In set_inode_xattr(), there are two returns as follows, - return retval; return 0; - Here, we remove useless 'return 0;' code. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Reviewed-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-03-31ext2fs: compile the io implementation according to osPaulo Antonio Alvarez3-3/+37
In mingw and cygwin, compile the windows_io manager, compile the unix_io everywhere else. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-03-31libext2fs: code adaptation to use the Windows IO managerPaulo Antonio Alvarez6-10/+88
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-03-31libext2fs: add a Windows implementation of the IO managerPaulo Antonio Alvarez1-0/+1041
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-03-06resize2fs: close the file system on errors or early exitsTheodore Ts'o1-20/+30
When resize2fs exits early, perhaps because of an error, we should free the file system so that if MMP is in use, the MMP block is reset. This also releases the memory to avoid memory leak reports. Addresses-Debian-Bug: #984472 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-03-06resize2fs: avoid allocating over the MMP blockTheodore Ts'o1-0/+5
When resizing past the point where the reserve inode has reserved space for the block group descriptors to expand, and resize2fs (in an offline resize) needs to move the allocation bitmaps and/or inode table around, it's possible for resize2fs to allocate over the MMP block, which would be bad. Prevent this from happening by reserving the MMP block as a file system metadata block (which it is) in resize2fs's accounting. Addresses-Debian-Bug: #984472 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-28Update release notes, etc., for the 1.46.2 releasev1.46.2Theodore Ts'o9-630/+718
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-28libext2fs: fix potential races in unix_ioTheodore Ts'o1-26/+31
When unix_io does not use pread/pread64 (which is the case the bounce buffer is in use, either when Direct I/O is in use or the IO_FLAG_FORCE_BOUNCE in enabled), there are races between the llseek and and read or write system calls. Fix this by using the BOUNCE_MTX so only one thread is using the file descriptor at a time. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-28libext2s: fix unix_io with IO_FLAG_FORCE_BOUNCE flag setTheodore Ts'o3-12/+121
The bounce read/write code would crash with a floating point exception if alignment is set to 0. Fixes: c001596110e8 ("libext2fs: fix unix_io's Direct I/O support") Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-27po: update es.po (from translationproject.org)Antonio Ceballos1-916/+1014
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-26libext2fs: fix unix_io's Direct I/O supportTheodore Ts'o2-23/+70
The previous Direct I/O support worked on HDD's with 512 byte logical sector sizes, and on FreeBSD which required 4k aligned memory buffers. However, it was incomplete and was not correctly working on HDD's with 4k logical sector sizes (aka Advanced Format Disks). Based on a patch from Alexey Lyashkov <alexey.lyashkov@hpe.com> but rewritten to work with the latest e2fsprogs and to minimize changes to make it easier to review. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reported-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>
2021-02-26iscan: fix the test program iscan so it builds againTheodore Ts'o2-18/+139
The iscan program program isn't built by default, and was relying on e2fsck's util.c, so it had suffered bitrot as e2fsck/util.c had evolved. Fix it so that iscan builds correct. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-25mmp: do not use O_DIRECT when working with regular fileLukas Czerner1-11/+11
Currently the mmp block is read using O_DIRECT to avoid any caching that may be done by the VM. However when working with regular files this creates alignment issues when the device of the host file system has sector size larger than the blocksize of the file system in the file we're working with. This can be reproduced with t_mmp_fail test when run on the device with 4k sector size because the mke2fs fails when trying to read the mmp block. Fix it by disabling O_DIRECT when working with regular files. I don't think there is any risk of doing so since the file system layer, unlike shared block device, should guarantee cache consistency. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-25resize2fs: prevent block bitmap warnings when doing extreme fs expansionsTheodore Ts'o1-4/+8
This commit fixes a bug where if a small file system is resized to ridiculous sizes, such that the size of the resized block group descriptor blocks exceed the original file system, and this would result in resize2fs triggering a large number of scary warning messages: Illegal block number passed to ext2fs_test_block_bitmap #12440 for block bitmap for broken.img This can be replicated via: ./misc/mke2fs broken.img -b 1024 -T default truncate -s +1500G broken.img ./resize/resize2fs broken.img Fortunately, aside from triggering these warning messages, the bug had no other bad effects. https://github.com/tytso/e2fsprogs/issues/60 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-25debugfs: fix rdump and ls to handle uids and gids > 65536 correctlyTheodore Ts'o2-4/+4
https://github.com/tytso/e2fsprogs/issues/63 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-25Remove superfluous break statementsTheodore Ts'o2-2/+0
https://github.com/tytso/e2fsprogs/pull/45 https://github.com/tytso/e2fsprogs/pull/46 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-25chattr/lsattr: expose FS_NOCOMP_FL (aka EXT2_NOCOMPR_FL)Lennart Poettering3-3/+9
This adds support for setting/querying the FS_NOCOMP_FL/EXT2_NOCOMPR_FL file flag to chattr/lsattr. I picked the character "m" because it was so far unused and all other characters that were more obvious candidates were already taken. The flag is available on btrfs, and with this patch it is possible to manage it correctly. Signed-off-by: Lennart Poettering <lennart@poettering.net> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-25debugfs: fix memory leak problem in read_list()Zhiqiang Liu1-4/+8
In read_list func, if strtoull() fails in while loop, we will return the error code directly. Then, memory of variable lst will be leaked without setting to *list. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: linfeilong <linfeilong@huawei.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-24libe2p: remove nested #ifdefs in fgetflags.c and fsetflags.cTheodore Ts'o2-20/+16
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-23debugfs: fix file descriptor leak on error path in do_logdump()Theodore Ts'o1-1/+1
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-23misc/Makefile.in: add rules to build static versions of lsattr and chattrTheodore Ts'o1-1/+11
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-23libe2p: skip unneeded lstat(2) in fgetflags() and fsetflags()Theodore Ts'o2-34/+41
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-23debugfs: fix uninitialized variable es in do_logdump()Theodore Ts'o1-1/+5
Fixes: d96064e9821a ("debugfs: simplify the do_logdump() function") Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-23debugfs: simplify the do_logdump() functionTheodore Ts'o1-24/+22
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-23Add checks for fs->blocksize == 0 which could cause some crashesTheodore Ts'o5-4/+13
This should never happeb, but some checks is useful, and also fixes some Coverity warnings. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-23e2fsck: fix miscellaneous clang warningsTheodore Ts'o2-2/+3
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-23e2fsck: initialize variable before first use in fast commit replayHarshad Shirwadkar2-2/+2
Initialize ext2fs_ex variable in ext4_fc_replay_scan() before first use. Also make sure ext2fs_decode_extent() completely overwrites the extent structure passed to it as argument to prevent potential future bugs for the users of the function. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-23e2fsck: add fallthrough comment in fc replay switch caseHarshad Shirwadkar1-0/+1
During fast commit replay scan phase, in ext4_fc_replay_scan(), we want to fallthrough in switch case for EXT4_FC_TAG_ADD_RANGE case. Add a comment for that. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-23ext2fs: don't ignore return value in ext2fs_count_blocksHarshad Shirwadkar1-2/+5
Don't ignore return value of ext2fs_get_array() in ext2fs_count_blocks(). Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-23e2fsck: don't ignore return values in e2fsck_rewrite_extent_treeHarshad Shirwadkar1-7/+9
Don't ignore return values of library function calls in e2fsck_rewrite_extent_tree. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-23create_inode: fix potential file descriptor leak on an error pathTheodore Ts'o1-1/+1
Addresses-Coverity-Bug: 1473307 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-22misc: replace remaining loff_t with ext2_loff_tAndreas Dilger3-14/+15
Replace the remaining loff_t uses with ext2_loff_t, as was done in patch 1df6a4555, since loff_t is a GCC'ism and is not portable. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-22chattr.1: improve attributes description to btrfsAkatsuki Rui1-2/+4
- c: for btrfs, compression are conflicts with nodatacow and nodatasum - C: for btrfs, nodatacow is conflict with compression ref: - https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs(5)#MOUNT_OPTIONS - https://www.spinics.net/lists/linux-btrfs/msg103219.html Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-22create_inode: Find subdirectory in do_write_internalEarl Chew3-7/+50
Follow the example in do_mkdir_internal, and do_symlink_internal, and find the correct parent directory if the destination is not just a plain basename. https://github.com/tytso/e2fsprogs/issues/61 Signed-off-by: Earl Chew <earl_chew@yahoo.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-16debugfs: fix dump_metadata_block() for block sizes > 8192Theodore Ts'o1-1/+1
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-14libext2fs: fix crash when ext2fs_mmp_stop() is called before MMP is initializedTheodore Ts'o1-1/+2
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-14tune2fs: teach tune2fs to use a random value for "-c random"Theodore Ts'o2-18/+21
Addresses-Debian-Bug: #926293 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-13debugfs: clamp journal s_maxlen value when dumping the journal logTheodore Ts'o1-12/+33
Addresses-Coverity-Bug: 1432478 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-13debugfs: fix logdump on file systems with block sizes > 8192Theodore Ts'o1-2/+2
Addresses-Coverity-Bug: 1472879 Addresses-Coverity-Bug: 1472880 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12debugfs: fix memory allocation failures when parsing journal_write argumentsTheodore Ts'o2-10/+13
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-12debugfs: fix header checks in logdumpTheodore Ts'o1-3/+6
Fixes: bd9ac48c9200 ("debugfs: add journal header checks in logdump") Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12e2fsck: fix error code return in e2fsck_read_extents()Theodore Ts'o1-1/+1
Addresses-Coverity-Bug: 1472586 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12libext2fs: fix incorrect error code return in ext2fs_add_jounral_inode3()Theodore Ts'o1-1/+1
Addresses-Coverity-Bug: 1472255 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12debugfs: add journal header checks in logdumpTheodore Ts'o1-1/+11
Addresses-Coverity-Bug: 1431466 Addresses-Coverity-Bug: 1432478 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-12badblocks: add error checking for command-line arguments for -b and -cTheodore Ts'o1-1/+13
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-12ext2_fs.h: use the ext2fs_has_feature_64bits() instead of open coded checkTheodore Ts'o1-2/+1
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-11e2fsck: add error checking for ext2fs_extent_get_info()Theodore Ts'o1-1/+6
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-11Fix clang warnings on architectures with a 64-bit longTheodore Ts'o44-266/+399
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-11mke2fs: fix resource leak on error path when creating inodesTheodore Ts'o1-1/+1
Addresses-Coverity-Bug: 1472856 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-10tests: fix environmental dependency in m_rootdir_aclTheodore Ts'o1-1/+1
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-09Update release notes, etc., for the 1.46.1 releasev1.46.1Theodore Ts'o11-750/+903
(Also update some inaccuracies in the 1.46.0 release.) Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09po: update uk.po (from translationproject.org)Yuri Chornoivan1-914/+1011
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09po: update sv.po (from translationproject.org)Göran Uddeborg1-916/+1003
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09po: update pt.po (from translationproject.org)Pedro Albuquerque1-930/+1031
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09po: update pl.po (from translationproject.org)Jakub Bogusz1-915/+1002
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09po: update ms.po (from translationproject.org)Sharuzzaman Ahmat Raslan1-34/+25
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09po: update fr.po (from translationproject.org)Samuel Thibault1-942/+1001
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09po: update cs.po (from translationproject.org)Petr Pisar1-913/+1010
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09mke2fs: fix a importing a directory with an ACL and inline dataTheodore Ts'o4-0/+229
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-09debian: add build profiles noudeb and pkg.e2fsprogs.no-staticTheodore Ts'o2-1/+11
Addresses-Debian-Bug: #966686 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-09configure.ac: convert all help strings to use AS_HELP_STRINGTheodore Ts'o3-75/+81
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-09Provide and use sort_r() instead of qsort_r() for portability reasonsTheodore Ts'o2-7/+333
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-08e2fsck: endianness fixes for fast commit replayHarshad Shirwadkar1-18/+26
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-08ext2fs: initialize handle to NULL in ext2fs_count_blksHarshad Shirwadkar1-1/+1
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-08e2fsck: fix check of directories over 4GBAndreas Dilger12-39/+98
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: 49f28a06b738 ("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-07libext2fs: fix more compiler warningsTheodore Ts'o4-13/+13
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-02-07libext2fs: fix segault when setting an xattr with an unknown prefixTheodore Ts'o1-32/+32
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-07misc: fix minor llvm warningsAndreas Dilger2-2/+2
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-01-29debian: drop transitional packagesTheodore Ts'o4-111/+0
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-29configure.ac: fix build failure on systems with pthreads && !fuse supportTheodore Ts'o2-1/+2
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-29Update release notes, etc., for the 1.46.0 releasev1.46.0Theodore Ts'o7-10/+166
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29Update makefile dependenciesTheodore Ts'o5-56/+127
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29Update debian/libext2fs2.symbols with the additions to the shared libraryTheodore Ts'o1-0/+11
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29Merge branch 'maint' into nextTheodore Ts'o27-564/+750
2021-01-29e2fsck: drop use of sysctl(2)Theodore Ts'o3-12/+1
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-29configure.ac: add substitution for @mkdir_p@ since po/Makefile.in.in uses itTheodore Ts'o2-0/+8
Fixes: e598c29b4d38 ("Update gettext files to version 0.19.8") Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-29Update release notes, etc., for the 1.45.7 releasev1.45.7Theodore Ts'o23-498/+685
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28po: update sr.po (from translationproject.org)Мирослав Николић1-1699/+1429
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28po: update nl.po (from translationproject.org)Benno Schulenberg1-64/+74
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28po: update ms.po (from translationproject.org)Sharuzzaman Ahmat Raslan1-274/+242
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28misc: fix a spelling nit in the mke2fs man pageTheodore Ts'o1-1/+1
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28Update Makefile dependencies for lib/e2p and lib/ext2fsTheodore Ts'o2-11/+16
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-28Merge branch 'maint' into nextTheodore Ts'o26-64/+356
2021-01-28AOSP: Add assemble_cvd to com.android.virtJiyong Park2-0/+8
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-28AOSP: tune2fs/resize2fs: make vendor_ramdisk_available.Yifan Hong8-0/+8
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-28AOSP: Make libext2_uuid and e2fsprogs headers vendor_ramdisk_available.David Anderson2-0/+2
This is needed to build snapuserd into the vendor ramdisk. Google-Bug-Id: 173463595 Test: snapuserd builds Change-Id: I05d85357ebf47abd0d82e9c6211e854bdf0d5ae9 From AOSP commit: b28c0ef21cf8ebd172a07cfd09551af38366a5a7
2021-01-27AOSP: Add "product_available" to product available modulesJustin Yun2-0/+2
"vendor_available" modules were available to product modules. However, not all "vendor_available" modules are required to be available to product modules. Some modules want to be available only to product modules but not vendor modules. To cover the requirement, we separate "product_available" from "vendor_available". "vendor_available" will not provide product available module. Google-Bug-Id: 150902910 Test: build Change-Id: I316da0d24bde8b6231114aa80841c59547691152 From AOSP commit: df51b0de40581f52c6515f8775ecd84dc4a50bb0
2021-01-27AOSP: ANDROID: e2fsck: Handle casefolded encryptionDaniel Rosenberg8-30/+181
Adds support for EXT2_HASH_SIPHASH, and reading the hash from disk in that case. We cannot compute the siphash without the key, so we must not modify the names of any encrypted and casefolded directories, which limits some recovery options, and we must assume the hashes stored in dirents are correct. This is in preparation for upcoming kernel support for encryption and casefolding at the same time. Google-Bug-Id: 138322712 Test: Create fs with casefold and encryption enabled via mke2fs and tune2fs, run fsck after creating casefolded + encrypted folder Change-Id: Icca32d7d9dd3c7f52da03d60e4d89273cbec0a7d From AOSP commit: 67eae926bdac1a54dbb8335731c5e1581f93e4bb
2021-01-27AOSP: ANDROID: mke2fs: Support encrypt+casefoldDaniel Rosenberg1-9/+0
In preparation for upcoming kernel changes that will make the kernel support both encryption and casefolding at the same time, allow mke2fs to enable both features at the same time. Signed-off-by: Daniel Rosenberg <drosen@google.com> Google-Bug-Id: 138322712 Test: Create fs with casefold and encryption enabled via mke2fs Change-Id: I4e2350e43e21cffb3d972310cd74df1e662bf87e From AOSP commit: f8fc427df385260f3424e1e9d5485c8640606920
2021-01-27AOSP: ANDROID: tune2fs: Support encrypt+casefoldDaniel Rosenberg1-17/+0
In preparation for upcoming kernel changes that will make the kernel support both encryption and casefolding at the same time, allow tune2fs to enable both features at the same time. Signed-off-by: Daniel Rosenberg <drosen@google.com> Google-Bug-Id: 138322712 Test: Create fs with casefold and encryption enabled via tune2fs Change-Id: I36537a8b6dc5e2997b7016212f9b574c76673067 From AOSP commit: 44ac9dccd9853cc9807f0d6ce952bdcdeb93954a
2021-01-27AOSP: ANDROID: e2fsck: Do not mutate encrypted namesDaniel Rosenberg7-0/+52
We can't mutate a name without the key, as this will at best cause the name to become gibberish, and at worst may introduce invalid characters or even fail to be unique after decoding, so drop duplicates instead. Files lost in this way will be reconnected to lost+found Fixes: dbff534ec685 ("e2fsck: suppress bad name checks for encrypted directories") Signed-off-by: Daniel Rosenberg <drosen@google.com> Google-Bug-Id: 138322712 Test: f_dup_de_crypt Change-Id: I8d6cc3984872868a845fafabc554abdd86351fcc From AOSP commit: 80b85f8a0b2ba7090a927f692ff9d2097ffd8d1f
2021-01-27AOSP: ANDROID: tune2fs: Allow setting the casefold featureDaniel Rosenberg2-7/+119
This allows tune2fs to enable casefolding on an existing filesystem. At the moment, casefolding is incompatible with encryption. Signed-off-by: Daniel Rosenberg <drosen@google.com> Google-Bug-Id: 138322712 Test: Create fs without casefold and enable it via tune2fs Change-Id: Ic9ed63180ef28c36e083cee85ade432e4bfcc654 From AOSP commit: eb5b168decac07058e90ead191350be80c75aff4
2021-01-27AOSP: Make e2fsck depends on badblocksHoward Chen1-0/+1
The e2fsck may invoke the badblocks when -c is specified. Also the badblocks is required by Mediatek devices. Add it for completeness. Test: compile wembley-userdebug Google-Bug-Id: 157393160 Change-Id: I1163129c925e93ef386e86a60c93e9c314397134 From AOSP commit: dffec44dd56175b80810657f95f8e09a7e3ab0bf
2021-01-27tests: test case-folding checks in e2fsckGabriel Krisman Bertazi4-0/+30
Add the test f_bad_fname which test fixes of invalid filenames and duplicates. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27e2fsck.8.in: document check_encoding extended optionGabriel Krisman Bertazi1-0/+4
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27e2fsck: add option to force encoded filename verificationGabriel Krisman Bertazi3-2/+8
This is interesting for !strict filesystems as part of the encoding update procedure. Once the filesystem is known to not have badly encoded filenames, the update is trivial, thanks to the stability of assigned code points in the unicode specification. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27e2fsck: detect duplicated casefolded direntries for rehashGabriel Krisman Bertazi1-1/+21
On pass2, support casefolded directories when looking for duplicated entries. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27dict: support comparison with contextGabriel Krisman Bertazi5-10/+22
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27e2fsck: support casefold directories when rehashingGabriel Krisman Bertazi1-16/+69
When rehashing a +F directory, the casefold comparison needs to be performed, in order to identify duplicated filenames. Like the -F version, This is done in two steps, first adapt the qsort comparison to consider casefolded directories, and then iterate over the sorted list fixing dups. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27e2fsck: fix entries with invalid encoded charactersGabriel Krisman Bertazi4-5/+69
On strict mode, invalid Unicode sequences are not permited. This patch adds a verification step to pass2 to detect and modify the entries with the same replacement char used for non-encoding directories '.'. After the encoding test, we still want to check the name for usual problems, '\0', '/' in the middle of the sequence. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27e2fsck: add new problem for encoded name checkArnaud Ferraris2-0/+8
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27ext2fs: implement faster CI comparison of stringsGabriel Krisman Bertazi3-0/+40
Instead of calling casefold two times and memcmp the result, which require allocating a temporary buffer for the casefolded version, add a strcasecmp-like method to perform the comparison of each code-point during the casefold itself. This method is exposed because it needs to be used directly by fsck. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27ext2fs: add method to validate casefolded stringsGabriel Krisman Bertazi3-0/+32
This is exported to be used by fsck. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27tune2fs: fix casefold+encrypt error messageGabriel Krisman Bertazi1-1/+1
Refering to EXT4_INCOMPAT_CASEFOLD as encoding is not as meaningful as saying casefold. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27tune2fs: allow enabling casefold feature after fs creationGabriel Krisman Bertazi1-1/+14
The main reason we didn't allow this before was because !CASEFOLDED directories were expected to be normalized(). Since this is no longer the case, and as long as the encrypt feature is not enabled, it should be safe to enable this feature. Disabling the feature is trickier, since we need to make sure there are no existing +F directories in the filesystem. Leave that for a future patch. Also, enabling strict mode requires some filesystem-wide verification, so ignore that for now. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27tests: add fast commit recovery testsHarshad Shirwadkar4-0/+52
Add j_recover_fast_commit test that ensure that e2fsck is able to recover a disk from fast commit log. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27e2fsck: add replay for add_range, del_range, and inode tagsHarshad Shirwadkar1-1/+347
Add replay for inode's extent trees and inode itself. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27e2fsck: add fc replay for link, unlink, creat tagsHarshad Shirwadkar3-3/+119
Add fast commit replay for directory entry updates. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27e2fsck: add fast commit replay skeletonHarshad Shirwadkar1-0/+72
This function adds the skeleton for the replay path. Following patches in the series implement the handling for individual tags. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27e2fsck: add fast commit scan passHarshad Shirwadkar1-0/+109
Add fast commit scan pass. Scan pass is responsible for following things: * Count total number of fast commit tags that need to be replayed during the replay phase. * Validate whether the fast commit area is valid for a given transaction ID. * Verify the CRC of fast commit area. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27e2fsck: add fast commit setup codeHarshad Shirwadkar3-0/+32
Introduce "e2fsck_fc_replay_state" structure which is needed for ext4 fast commit replay. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Reviewed-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27e2fsck: add function to rewrite extent treeHarshad Shirwadkar2-60/+131
Fast commit replay needs to rewrite the entire extent tree for inodes found in fast commit area. This patch makes e2fsck's rewrite extent tree path visible. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Reviewed-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27ext2fs: add new APIs needed for fast commitsHarshad Shirwadkar2-0/+68
This patch adds the following new APIs: Count the total number of blocks occupied by inode including intermediate extent tree nodes. extern errcode_t ext2fs_count_blocks(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode, blk64_t *ret_count); Convert the on-disk reputation of an extent to the in-memory representation. extern errcode_t ext2fs_decode_extent(struct ext2fs_extent *to, void *from, int len); Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-27e2fsck: declare the size of bh->b_data to be 4096 in jfs_user.hTheodore Ts'o1-1/+1
When allocating buffer_heads in e2fsck and debugfs the actual size of the memory which is requested is based on the file system block size. So the actual size of b_data in struct buffer_head doesn't actually matter, except that it can triggers a UBSAN error when running the e2fsck regression test. So change it to be 4096 to avoid this false positive. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-23Merge branch 'maint' into nextTheodore Ts'o13-35/+54
2021-01-23Include PTHREAD_CFLAGS in LDFLAGS* macrosTheodore Ts'o1-3/+3
PTHREAD_CFLAGS is set by AX_PTHREADS, and these flags need to be included when linking executables. Fixes: bdcd5f22203f ("Add configure and build support for the pthreads library") Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-23Fix clang warningsTheodore Ts'o4-8/+9
Clang gets unhappy when passing an unsigned char to string functions. For better or for worse we use __u8[] in the definition of the superblock. So cast them these to "char *" to prevent clang build-time warnings. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-23libext2fs: use compiler built-in offsetof() if availableTheodore Ts'o3-12/+26
This avoids UBSAN sanitizer warnings, since &(0->member) is technically undefined per the C standard. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-23Only build resize2fs.static when running "make all-static"Theodore Ts'o1-1/+1
Fixes: 93df80d2409d ("Teach makefiles... the target all-static") Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-21libext2fs: fix UBSAN warning in ext2fs_mmp_new_seq()Theodore Ts'o1-1/+3
Left shifting the pid by 16 bits can cause a UBSAN warning if the pid is greater than or equal to 2**16. It doesn't matter since we're just using the pid to seed for a pseudo-random number generator, but silence the warning by just swapping the high and low 16 bits of the pid instead. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-21mke2fs.8: Improve valid block size documentationJan Kara1-4/+6
Explain which valid block sizes mke2fs supports in more detail. Reviewed-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-21build: Add SYSLIBS to e4crypt linkingHauke Mehrtens1-1/+1
The $(SYSLIBS) was missing when linking the e4crypt application. This is available in the e4crypt.profiled variant, so I assume this was just missing in the normal variant and is not left out intentionally. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-21tune2fs: abort clearing the dir_index when the fs needs to be fsck'ed firstTheodore Ts'o1-2/+3
We were not checking the return value of check_fsck_needed() when checking to clear the dir_index feature. As a result, tune2fs would print that the file system needed to be checked first, but then go ahead and clear the dir_index flag. Addresses-Coverity-Bug: 1467671 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-21e2fsck: remove dead code when recreating the journalTheodore Ts'o1-7/+0
params.num_journal_blocks is an unsigned value so it can never be less than zero. Addresses-Coverity-Bug: 1472250 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-21debugfs: fix the printf specifier when dumping a fast commit blockTheodore Ts'o1-1/+1
Addresses-Coverity-Bug: 1472249 Addresses-Coverity-Bug: 1472253 Addresses-Coverity-Bug: 1472254 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-21libext2fs: fix minor Coverity nits in ext2fs_rw_bitmaps()Theodore Ts'o1-13/+11
Addresses-Coverity-Bug: 1472252 Addresses-Coverity-Bug: 1472253 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-21tune2fs: fix resource leak in handle_quota_options()Theodore Ts'o1-2/+4
Addresses-Coverity-Bug: 1467672 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-21debugfs: fix double free in realloc() error path in read_list()Theodore Ts'o1-4/+2
Fixes-Coverity-Bug: 1464575 Fixes-Coverity-Bug: 1464571 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-21libext2fs: fix incorrect negative error return in unix and sparse io managersTheodore Ts'o2-3/+3
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-21libext2fs: fix incorrect negative error return in ext2fs_rw_bitmaps()Theodore Ts'o1-1/+1
Fixes: e2e58d312804 ("ext2fs: parallel bitmap loading") Fixes-Coverity-Bug: 147255 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-01-21debugfs: add fast commit support to logdumpHarshad Shirwadkar2-5/+320
Add fast commit support for debugfs logdump. This commit also adds fast_commit.h that contains the necessary helpers needed for fast commit replay. Note that this file is also byte by byte identical with kernel's fast_commit.h. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>