- Dec 04, 2018
-
-
Gabriel Krisman Bertazi authored
Display encoding related fields when printing superblock in places like dumpe2fs or debugfs. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
-
- Dec 03, 2018
-
-
Gabriel Krisman Bertazi authored
The mkutf8data program was written by SGI for the kernel. We integrate it here, but it should be kept in sync with the kernel code, when applicable. The header generated by this script is also included in this repository, such that we don't have to carry the UCD files too. They are only necessary when the header has to be recreated (for instance, to update the Unicode version supported) The mkutf8data is not a dependency of utf8data.h because we don't want the utf8data.h rule to be called after a make clean that would remove mkutf8data. It is simpler to call it from inside the rule, and make sure we only trigger the utf8data.h rule if we really need to, particularly if we decide not to integrate the ucd files in the tree. The UCD files are not distributed along with this commit, but we add information on how to fetch them. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
-
Gabriel Krisman Bertazi authored
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Gabriel Krisman Bertazi authored
We need this such that we can do normalization and casefolding compatible with the kernel, in order to properly support fsck verification and rehashing. The UTF-8 11.0 implementation is copied and adapted from the kernel code to ensure maximum compatibility. The decode trie in utf8data.h is generated using a script and the UCD sources in the kernel code. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Gabriel Krisman Bertazi authored
The kernel will refuse to mount filesystems with the encryption and encoding features enabled at the same time. The encoding feature can only be set at mke2fs time, so we can just prevent encryption from being set at a later time by tune2fs. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Gabriel Krisman Bertazi authored
Implement two parameters -e and -c, to specify encoding and casefold when printing the hash of a given file. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Gabriel Krisman Bertazi authored
fsck must be aware of the superblock encoding and the casefold directory setting, such that it is able to correctly calculate the dentry hashes. [ Changed to use a stack-allocated buffer instead of a calling calloc() with a fixed size -- TYT ] Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Gabriel Krisman Bertazi authored
Basic NLS support is required in e2fsprogs because of fsck, which needsto calculate dx hashes for encoding aware filesystems. this patch implements this infrastructure as well as ascii support. We don't need to do all the dance of versioning as we do in the kernel, because we know before-hand which encodings and versions we support (those we know how to store in the sb), so it is simpler just to create static tables. This version only has support for ASCII; we'll add support for Unicode later. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Gabriel Krisman Bertazi authored
This flag can be set on directories to request insensitive file name lookups. I used the letter 'F', referring to "caseFold" for lack of a better option. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Gabriel Krisman Bertazi authored
This patch implements two new extended options to mkefs, allowing the user to specify an encoding for file name operations and encoding flags during filesystem creation. We provide default flags for each encoding, which the user can overwrite by passing -E fname_encoding-flags to mkfs. If the user doesn't specify an encoding, the default value from options.fname_encoding in mke2fs.conf.in file will be used. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Gabriel Krisman Bertazi authored
Implement helper functions to convert the encoding name and specific parameters requested by the user on the command line into the format that is written to disk. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Theodore Ts'o authored
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
- Nov 26, 2018
-
-
Theodore Ts'o authored
-
Darrick J. Wong authored
In e2freefrag live scan mode, we take the free block count from the ondisk superblock. This leads to screwy histogram percentages: Extent Size Range : Free extents Free Blocks Percent 4M... 8M- : 5 8234 1.05% 64M... 128M- : 2 52279 6.64% 512M... 1024M- : 1 202752 25.74% ...because there could be superblock updates in the journal that haven't yet been checkpointed. The online scan is perfectly capable of tallying the free blocks on its own, so teach it do that and make a more accurate report. Reported-by: Elana Hashman <Elana.Hashman@twosigma.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
- Nov 24, 2018
-
-
Theodore Ts'o authored
If the file system only has the flex_bg feature enabled (with out the metadata_csum feature enabled), it won't take a long time time fix up the checksums after changing the UUID. While it does need to recalculate all of the checksums in the block group descriptors, that doesn't take a long time. Also, if the ea_data feature is enabled, changing the UUID will also take a long time, and we weren't warning the user about that case. Fix up the warning message so it doesn't mislead people, and is more accurate. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
- Nov 22, 2018
-
-
Theodore Ts'o authored
$AWK doesn't use an explicit pathname, and it's perfectly fine to assume that awk and sed are in the user's PATH. The problem with using an explicit pathname is that Debian currently allows merged and non-merged /usr. Avoid using an explicit pathname to prevent potential problems. Addresses-Debian-Bug: #914087 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
- Nov 21, 2018
-
-
Gabriel Krisman Bertazi authored
New superblock fields must be byte swapped before being accessed in Big Endian machines. Not tested on an actual BE machine. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
- Nov 19, 2018
-
-
Gabriel Krisman Bertazi authored
The s_encoding field in the superblock stores a magic number indicating the encoding format and version used globally by file and directory names in the filesystem. The s_encoding_flags defines policies for using the charset encoding, like how to handle invalid sequences and what kind of normalization to use. A feature flag is also allocated to indicate whether this filesystem has encoding awareness enabled. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Gabriel Krisman Bertazi authored
Re-sync the superblock structure declaration with its kernel counterpart to include the fields added by kernel commit 6a0678a79bb3 ("ext4: super: extend timestamps to 40 bits") Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
- Nov 15, 2018
-
-
Darrick J. Wong authored
Apparently newer versions of systemd than the one on this author's laptop <cough> now complain about lack of (path) escaping in unit instance variable contents: # e2scrub_all Scrubbing /home... Invalid unit name "e2scrub@/home" was escaped as "e2scrub@-home" (maybe you should use systemd-escape?) Starting Online ext4 Metadata Check for /home... So change the escape_path_for_systemd function to escape paths unconditionally to make the warning go away. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Li Dongyang authored
ext2fs_inline_data_size will happy return 0 and set size to EXT4_MIN_INLINE_DATA_SIZE even when inode doesn't have xattr 'system.data', a corrupted i_flags could make e2fsck enable the inline_data on the superblock. We should only offer to enable inline_data when i_flags is set and xattr 'system.data' can be found. Also use correct prompt for PR_1_INLINE_DATA_FEATURE. Signed-off-by: Li Dongyang <dongyangli@ddn.com>
-
- Oct 21, 2018
-
-
Theodore Ts'o authored
The code to recalculate the checksums in an extent tree (which is needed after an inode is relocated so it has a different inode number) was duplicated in tune2fs and resize2fs. In addition, this work could be done in a much more efficient way inside lib/ext2fs/extent.c. This commit creates a new library function which corrects the checksums in an inode's extent tree, named: ext2fs_fix_extents_checksums() Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Theodore Ts'o authored
-
Theodore Ts'o authored
If e4defrag is run by root, it will try to open the underlying file system for files that it is trying to defrag so it can get the file system parameters. It's currently doing this by searching /etc/mtab. This isn't the best way to go about doing things, but we'll leave it for now, at least for a maintenance release. (The better way to do things would be to look up the device using the blkid library, but that's a more involved change.) Since the file system parameters isn't strictly speaking necessary (after all we get by without them when not running as root), we'll allow e4defrag to continue running if we can't find the file system. This can happen if /etc/mtab is pointing at /proc/mounts, and the kernel can't properly identify the root file system, it is reported as "/dev/root". Addresses-Debian-Bug: #907634 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
- Oct 20, 2018
-
-
Theodore Ts'o authored
Add a test case for the bug fixed in 4b303813: "resize2fs: update checksums in the extent tree's relocated block" Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Theodore Ts'o authored
When shrinking an file system, and we need to relocate an inode, the checksums in its extent tree must get updated to reflect its new inode number. When doing this, we need to do this *after* we update the extent tree to reflect any blocks which need to be relocated due to the file system shrink operation. Otherwise, in the case where only an interior node of the extent tree needs to get relocated, and none of the entries in that node need to be adjusted, the checksum for that interior node is updated in the old copy of that block, and then after the extent tree is updated to use the new copy of that interior node, the extent tree is left with an invalid checksum. This is a relatively rare case, since it requires the following conditions to be true: *) The metadata checksum feature must be enabled. *) An inode needs to be relocated. *) The inode needs to have an interior node. *) The block for that interior node needs to be relocated. *) None of blocks addressed by entries in that interior node needs to be relocated. When all of these conditions are true, though, the file system is left with corrupted with bad checksum for the extent tree block. Addresses-Launchpad-Bug: 1798562 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reported-by: Jean-Baptiste Lallement <jean-baptiste.lallement@ubuntu.com>
-
- Oct 16, 2018
-
-
Nicholas Clark authored
Add a new 'fakeroot' option to fuse2fs. When enabled, fuse2fs will will pretend to be root when checking file permssions. This allows fuse2fs to be used for building/modifying rootfs images as an unprivileged user. As per the maintainer's request, nosuid and nodev are automatically enabled when fakeroot is selected (on platforms that support them) to help prevent accidental misuse. Signed-off-by: Nicholas Clark <nicholas.clark@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Theodore Ts'o authored
-
Nicholas Clark authored
FUSE's parser allows command-line options to be specified before or after the device/image and mount-path. This commit changes the value of the fsname mount option to be correct even if options are specified before the target device/image. Signed-off-by: Nicholas Clark <nicholas.clark@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Theodore Ts'o authored
This makes the license of version.c to be consistent with the rest of the files in the library. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
- Oct 14, 2018
-
-
Theodore Ts'o authored
-
- Oct 13, 2018
-
-
Nick Kralevich authored
There are a number of error conditions which, due to the way ext2fs_dir_iterate2 operates, would not be propagated to the upper layers of the call stack. As a result, certain error conditions, such as not having enough room to allocate blocks for SELinux labels, would fail silently, instead of causing a compile failure. As suggested in https://android-review.googlesource.com/c/platform/external/e2fsprogs/+/324363 , add a error field to the caller's private data structure, and use the bit in the field to indicate an error condition. Now, certain errors which were silently ignored will cause a compile failure when compiling Android. Test: Artifically modify selabel_lookup() to return a failure, and verify Android doesn't compile. Test: Verify Android compiles under normal circumstances. Test: Artifically modify ino_add_xattr() to return a failure, and verify Android doesn't compile. Bug: 117502873 Bug: 117567573 Bug: 117473440 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Change-Id: Icdb0105a77e98c3428f20d3c59bf824dcad5db8d From AOSP commit: 7ca13b8b2953f93536ea09eb2ff19bd7cc85b3c1
-
David Anderson authored
Signed-off-by: Theodore Ts'o <tytso@mit.edu> Change-Id: Ic4de282039524e1858bbd288e2b85be30d843f40 From AOSP commit: 7e9e2ca4b08aab41b28e57d0c9b840b8b9e6466d
-
Jiyong Park authored
Bug: 112062612 Test: $ m SANITIZE_HOST=address $OUT_DIR/host/linux-x86/bin/resize2fs $OUT_DIR/host/linux-x86/bin/llvm-symbolizer $ $OUT_DIR/host/linux-x86/bin/resize2fs Signed-off-by: Theodore Ts'o <tytso@mit.edu> Change-Id: I72a8c183eb887137e3a414043b3d54771aa4eedc From AOSP commit: 9ba4dd69cfbf312c6015d5b007566e2467203f5e
-
- Oct 11, 2018
-
-
Theodore Ts'o authored
-
Theodore Ts'o authored
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Theodore Ts'o authored
f_detect_junk will skip the test by exiting; and in that case we need to make sure the test's tmpfile gets cleaned up. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Theodore Ts'o authored
The __GNUC_PREREQ convenience macro is defined by glibc's header files. If it isn't available, make it available for us to use. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
Theodore Ts'o authored
Use HAVE_LINUX_FD_H guard since not all libc's or operating systems provide <linux/fd.h>. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
- Oct 04, 2018
-
-
Theodore Ts'o authored
-