The Linux kernel for FS Ext4 includes support for case-insensitive operation

Ted Ts'o, author of the ext2/ext3/ext4 file systems, accepted the to the Linux-next branch that will form the basis of the Linux 5.2 kernel release, set changes, which implement support for case-insensitive operations in the Ext4 file system. The patches also add support for UTF-8 characters in filenames.

The case-insensitive operation mode is optionally enabled in relation to individual directories using the new attribute "+F" (EXT4_CASEFOLD_FL). When this attribute is set on a directory, all operations with files and subdirectories inside will be case-insensitive, including case will be ignored when searching and opening files (for example, Test.txt, test.txt and test.TXT files in such directories will be considered the same). By default, with the exception of directories with the "+F" attribute, the filesystem continues to be case sensitive. To control the inclusion of case-insensitive mode, a modified set of utilities is offered e2fsprogs.

Patches prepared by Gabriel Krisman Bertazi of Collabora and accepted with seventh attempts after three years development and elimination of comments. The implementation does not change the disk storage format and works solely at the level of changing the name comparison logic in the ext4_lookup() function and replacing the hash in the dcache (Directory Name Lookup Cache) structure. The value of the "+F" attribute is stored within the inodes of individual directories and propagates to all nested files and subdirectories. Encoding information is stored in the super block.

To avoid collisions with the names of existing files, the "+F" attribute can only be set to empty directories in file systems that have Unicode support enabled in file and directory names during the mount phase. The names of directory entries for which the "+F" attribute is enabled are automatically converted to lowercase and reflected in this form in dcache, but are stored on disk in the form initially set by the user, i.e. despite the processing of names regardless of case, the names are shown and saved without losing information about the case of characters (but the system will not allow you to create a file name with the same characters, but in a different case).

Source: opennet.ru

Add a comment