Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ext4: Support case-insensitive file name lookups

This patch implements the actual support for case-insensitive file name
lookups in ext4, based on the feature bit and the encoding stored in the
superblock.

A filesystem that has the casefold feature set is able to configure
directories with the +F (EXT4_CASEFOLD_FL) attribute, enabling lookups
to succeed in that directory in a case-insensitive fashion, i.e: match
a directory entry even if the name used by userspace is not a byte per
byte match with the disk name, but is an equivalent case-insensitive
version of the Unicode string. This operation is called a
case-insensitive file name lookup.

The feature is configured as an inode attribute applied to directories
and inherited by its children. This attribute can only be enabled on
empty directories for filesystems that support the encoding feature,
thus preventing collision of file names that only differ by case.

* dcache handling:

For a +F directory, Ext4 only stores the first equivalent name dentry
used in the dcache. This is done to prevent unintentional duplication of
dentries in the dcache, while also allowing the VFS code to quickly find
the right entry in the cache despite which equivalent string was used in
a previous lookup, without having to resort to ->lookup().

d_hash() of casefolded directories is implemented as the hash of the
casefolded string, such that we always have a well-known bucket for all
the equivalencies of the same string. d_compare() uses the
utf8_strncasecmp() infrastructure, which handles the comparison of
equivalent, same case, names as well.

For now, negative lookups are not inserted in the dcache, since they
would need to be invalidated anyway, because we can't trust missing file
dentries. This is bad for performance but requires some leveraging of
the vfs layer to fix. We can live without that for now, and so does
everyone else.

* on-disk data:

Despite using a specific version of the name as the internal
representation within the dcache, the name stored and fetched from the
disk is a byte-per-byte match with what the user requested, making this
implementation 'name-preserving'. i.e. no actual information is lost
when writing to storage.

DX is supported by modifying the hashes used in +F directories to make
them case/encoding-aware. The new disk hashes are calculated as the
hash of the full casefolded string, instead of the string directly.
This allows us to efficiently search for file names in the htree without
requiring the user to provide an exact name.

* Dealing with invalid sequences:

By default, when a invalid UTF-8 sequence is identified, ext4 will treat
it as an opaque byte sequence, ignoring the encoding and reverting to
the old behavior for that unique file. This means that case-insensitive
file name lookup will not work only for that file. An optional bit can
be set in the superblock telling the filesystem code and userspace tools
to enforce the encoding. When that optional bit is set, any attempt to
create a file name using an invalid UTF-8 sequence will fail and return
an error to userspace.

* Normalization algorithm:

The UTF-8 algorithms used to compare strings in ext4 is implemented
lives in fs/unicode, and is based on a previous version developed by
SGI. It implements the Canonical decomposition (NFD) algorithm
described by the Unicode specification 12.1, or higher, combined with
the elimination of ignorable code points (NFDi) and full
case-folding (CF) as documented in fs/unicode/utf8_norm.c.

NFD seems to be the best normalization method for EXT4 because:

- It has a lower cost than NFC/NFKC (which requires
decomposing to NFD as an intermediary step)
- It doesn't eliminate important semantic meaning like
compatibility decompositions.

Although:

- This implementation is not completely linguistic accurate, because
different languages have conflicting rules, which would require the
specialization of the filesystem to a given locale, which brings all
sorts of problems for removable media and for users who use more than
one language.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

Gabriel Krisman Bertazi and committed by
Theodore Ts'o
b886ee3e c83ad55e

+223 -21
+48
fs/ext4/dir.c
··· 26 26 #include <linux/buffer_head.h> 27 27 #include <linux/slab.h> 28 28 #include <linux/iversion.h> 29 + #include <linux/unicode.h> 29 30 #include "ext4.h" 30 31 #include "xattr.h" 31 32 ··· 661 660 .open = ext4_dir_open, 662 661 .release = ext4_release_dir, 663 662 }; 663 + 664 + #ifdef CONFIG_UNICODE 665 + static int ext4_d_compare(const struct dentry *dentry, unsigned int len, 666 + const char *str, const struct qstr *name) 667 + { 668 + struct qstr qstr = {.name = str, .len = len }; 669 + 670 + if (!IS_CASEFOLDED(dentry->d_parent->d_inode)) { 671 + if (len != name->len) 672 + return -1; 673 + return !memcmp(str, name, len); 674 + } 675 + 676 + return ext4_ci_compare(dentry->d_parent->d_inode, name, &qstr); 677 + } 678 + 679 + static int ext4_d_hash(const struct dentry *dentry, struct qstr *str) 680 + { 681 + const struct ext4_sb_info *sbi = EXT4_SB(dentry->d_sb); 682 + const struct unicode_map *um = sbi->s_encoding; 683 + unsigned char *norm; 684 + int len, ret = 0; 685 + 686 + if (!IS_CASEFOLDED(dentry->d_inode)) 687 + return 0; 688 + 689 + norm = kmalloc(PATH_MAX, GFP_ATOMIC); 690 + if (!norm) 691 + return -ENOMEM; 692 + 693 + len = utf8_casefold(um, str, norm, PATH_MAX); 694 + if (len < 0) { 695 + if (ext4_has_strict_mode(sbi)) 696 + ret = -EINVAL; 697 + goto out; 698 + } 699 + str->hash = full_name_hash(dentry, norm, len); 700 + out: 701 + kfree(norm); 702 + return ret; 703 + } 704 + 705 + const struct dentry_operations ext4_dentry_ops = { 706 + .d_hash = ext4_d_hash, 707 + .d_compare = ext4_d_compare, 708 + }; 709 + #endif
+15 -6
fs/ext4/ext4.h
··· 399 399 #define EXT4_EOFBLOCKS_FL 0x00400000 /* Blocks allocated beyond EOF */ 400 400 #define EXT4_INLINE_DATA_FL 0x10000000 /* Inode has inline data. */ 401 401 #define EXT4_PROJINHERIT_FL 0x20000000 /* Create with parents projid */ 402 + #define EXT4_CASEFOLD_FL 0x40000000 /* Casefolded file */ 402 403 #define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */ 403 404 404 - #define EXT4_FL_USER_VISIBLE 0x304BDFFF /* User visible flags */ 405 - #define EXT4_FL_USER_MODIFIABLE 0x204BC0FF /* User modifiable flags */ 405 + #define EXT4_FL_USER_VISIBLE 0x704BDFFF /* User visible flags */ 406 + #define EXT4_FL_USER_MODIFIABLE 0x604BC0FF /* User modifiable flags */ 406 407 407 408 /* Flags we can manipulate with through EXT4_IOC_FSSETXATTR */ 408 409 #define EXT4_FL_XFLAG_VISIBLE (EXT4_SYNC_FL | \ ··· 418 417 EXT4_SYNC_FL | EXT4_NODUMP_FL | EXT4_NOATIME_FL |\ 419 418 EXT4_NOCOMPR_FL | EXT4_JOURNAL_DATA_FL |\ 420 419 EXT4_NOTAIL_FL | EXT4_DIRSYNC_FL |\ 421 - EXT4_PROJINHERIT_FL) 420 + EXT4_PROJINHERIT_FL | EXT4_CASEFOLD_FL) 422 421 423 422 /* Flags that are appropriate for regular files (all but dir-specific ones). */ 424 - #define EXT4_REG_FLMASK (~(EXT4_DIRSYNC_FL | EXT4_TOPDIR_FL)) 423 + #define EXT4_REG_FLMASK (~(EXT4_DIRSYNC_FL | EXT4_TOPDIR_FL | EXT4_CASEFOLD_FL)) 425 424 426 425 /* Flags that are appropriate for non-directories/regular files. */ 427 426 #define EXT4_OTHER_FLMASK (EXT4_NODUMP_FL | EXT4_NOATIME_FL) ··· 2394 2393 extern int ext4_sync_file(struct file *, loff_t, loff_t, int); 2395 2394 2396 2395 /* hash.c */ 2397 - extern int ext4fs_dirhash(const char *name, int len, struct 2398 - dx_hash_info *hinfo); 2396 + extern int ext4fs_dirhash(const struct inode *dir, const char *name, int len, 2397 + struct dx_hash_info *hinfo); 2399 2398 2400 2399 /* ialloc.c */ 2401 2400 extern struct inode *__ext4_new_inode(handle_t *, struct inode *, umode_t, ··· 2991 2990 /* dir.c */ 2992 2991 extern const struct file_operations ext4_dir_operations; 2993 2992 2993 + #ifdef CONFIG_UNICODE 2994 + extern const struct dentry_operations ext4_dentry_ops; 2995 + #endif 2996 + 2994 2997 /* file.c */ 2995 2998 extern const struct inode_operations ext4_file_inode_operations; 2996 2999 extern const struct file_operations ext4_file_operations; ··· 3087 3082 extern int ext4_handle_dirty_dirent_node(handle_t *handle, 3088 3083 struct inode *inode, 3089 3084 struct buffer_head *bh); 3085 + extern int ext4_ci_compare(const struct inode *parent, 3086 + const struct qstr *name, 3087 + const struct qstr *entry); 3088 + 3090 3089 #define S_SHIFT 12 3091 3090 static const unsigned char ext4_type_by_mode[(S_IFMT >> S_SHIFT) + 1] = { 3092 3091 [S_IFREG >> S_SHIFT] = EXT4_FT_REG_FILE,
+33 -1
fs/ext4/hash.c
··· 6 6 */ 7 7 8 8 #include <linux/fs.h> 9 + #include <linux/unicode.h> 9 10 #include <linux/compiler.h> 10 11 #include <linux/bitops.h> 11 12 #include "ext4.h" ··· 197 196 * represented, and whether or not the returned hash is 32 bits or 64 198 197 * bits. 32 bit hashes will return 0 for the minor hash. 199 198 */ 200 - int ext4fs_dirhash(const char *name, int len, struct dx_hash_info *hinfo) 199 + static int __ext4fs_dirhash(const char *name, int len, 200 + struct dx_hash_info *hinfo) 201 201 { 202 202 __u32 hash; 203 203 __u32 minor_hash = 0; ··· 269 267 hinfo->hash = hash; 270 268 hinfo->minor_hash = minor_hash; 271 269 return 0; 270 + } 271 + 272 + int ext4fs_dirhash(const struct inode *dir, const char *name, int len, 273 + struct dx_hash_info *hinfo) 274 + { 275 + #ifdef CONFIG_UNICODE 276 + const struct unicode_map *um = EXT4_SB(dir->i_sb)->s_encoding; 277 + int r, dlen; 278 + unsigned char *buff; 279 + struct qstr qstr = {.name = name, .len = len }; 280 + 281 + if (len && IS_CASEFOLDED(dir)) { 282 + buff = kzalloc(sizeof(char) * PATH_MAX, GFP_KERNEL); 283 + if (!buff) 284 + return -ENOMEM; 285 + 286 + dlen = utf8_casefold(um, &qstr, buff, PATH_MAX); 287 + if (dlen < 0) { 288 + kfree(buff); 289 + goto opaque_seq; 290 + } 291 + 292 + r = __ext4fs_dirhash(buff, dlen, hinfo); 293 + 294 + kfree(buff); 295 + return r; 296 + } 297 + opaque_seq: 298 + #endif 299 + return __ext4fs_dirhash(name, len, hinfo); 272 300 }
+1 -1
fs/ext4/ialloc.c
··· 455 455 if (qstr) { 456 456 hinfo.hash_version = DX_HASH_HALF_MD4; 457 457 hinfo.seed = sbi->s_hash_seed; 458 - ext4fs_dirhash(qstr->name, qstr->len, &hinfo); 458 + ext4fs_dirhash(parent, qstr->name, qstr->len, &hinfo); 459 459 grp = hinfo.hash; 460 460 } else 461 461 grp = prandom_u32();
+1 -1
fs/ext4/inline.c
··· 1407 1407 } 1408 1408 } 1409 1409 1410 - ext4fs_dirhash(de->name, de->name_len, hinfo); 1410 + ext4fs_dirhash(dir, de->name, de->name_len, hinfo); 1411 1411 if ((hinfo->hash < start_hash) || 1412 1412 ((hinfo->hash == start_hash) && 1413 1413 (hinfo->minor_hash < start_minor_hash)))
+3 -1
fs/ext4/inode.c
··· 4742 4742 new_fl |= S_DAX; 4743 4743 if (flags & EXT4_ENCRYPT_FL) 4744 4744 new_fl |= S_ENCRYPTED; 4745 + if (flags & EXT4_CASEFOLD_FL) 4746 + new_fl |= S_CASEFOLD; 4745 4747 inode_set_flags(inode, new_fl, 4746 4748 S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC|S_DAX| 4747 - S_ENCRYPTED); 4749 + S_ENCRYPTED|S_CASEFOLD); 4748 4750 } 4749 4751 4750 4752 static blkcnt_t ext4_inode_blocks(struct ext4_inode *raw_inode,
+18
fs/ext4/ioctl.c
··· 278 278 struct ext4_iloc iloc; 279 279 unsigned int oldflags, mask, i; 280 280 unsigned int jflag; 281 + struct super_block *sb = inode->i_sb; 281 282 282 283 /* Is it quota file? Do not allow user to mess with it */ 283 284 if (ext4_is_quota_file(inode)) ··· 321 320 err = ext4_truncate(inode); 322 321 if (err) 323 322 goto flags_out; 323 + } 324 + 325 + if ((flags ^ oldflags) & EXT4_CASEFOLD_FL) { 326 + if (!ext4_has_feature_casefold(sb)) { 327 + err = -EOPNOTSUPP; 328 + goto flags_out; 329 + } 330 + 331 + if (!S_ISDIR(inode->i_mode)) { 332 + err = -ENOTDIR; 333 + goto flags_out; 334 + } 335 + 336 + if (!ext4_empty_dir(inode)) { 337 + err = -ENOTEMPTY; 338 + goto flags_out; 339 + } 324 340 } 325 341 326 342 handle = ext4_journal_start(inode, EXT4_HT_INODE, 1);
+96 -11
fs/ext4/namei.c
··· 35 35 #include <linux/buffer_head.h> 36 36 #include <linux/bio.h> 37 37 #include <linux/iversion.h> 38 + #include <linux/unicode.h> 38 39 #include "ext4.h" 39 40 #include "ext4_jbd2.h" 40 41 ··· 630 629 } 631 630 if (!fscrypt_has_encryption_key(dir)) { 632 631 /* Directory is not encrypted */ 633 - ext4fs_dirhash(de->name, 632 + ext4fs_dirhash(dir, de->name, 634 633 de->name_len, &h); 635 634 printk("%*.s:(U)%x.%u ", len, 636 635 name, h.hash, ··· 663 662 name = fname_crypto_str.name; 664 663 len = fname_crypto_str.len; 665 664 } 666 - ext4fs_dirhash(de->name, de->name_len, 667 - &h); 665 + ext4fs_dirhash(dir, de->name, 666 + de->name_len, &h); 668 667 printk("%*.s:(E)%x.%u ", len, name, 669 668 h.hash, (unsigned) ((char *) de 670 669 - base)); ··· 674 673 #else 675 674 int len = de->name_len; 676 675 char *name = de->name; 677 - ext4fs_dirhash(de->name, de->name_len, &h); 676 + ext4fs_dirhash(dir, de->name, de->name_len, &h); 678 677 printk("%*.s:%x.%u ", len, name, h.hash, 679 678 (unsigned) ((char *) de - base)); 680 679 #endif ··· 763 762 hinfo->hash_version += EXT4_SB(dir->i_sb)->s_hash_unsigned; 764 763 hinfo->seed = EXT4_SB(dir->i_sb)->s_hash_seed; 765 764 if (fname && fname_name(fname)) 766 - ext4fs_dirhash(fname_name(fname), fname_len(fname), hinfo); 765 + ext4fs_dirhash(dir, fname_name(fname), fname_len(fname), hinfo); 767 766 hash = hinfo->hash; 768 767 769 768 if (root->info.unused_flags & 1) { ··· 1009 1008 /* silently ignore the rest of the block */ 1010 1009 break; 1011 1010 } 1012 - ext4fs_dirhash(de->name, de->name_len, hinfo); 1011 + ext4fs_dirhash(dir, de->name, de->name_len, hinfo); 1013 1012 if ((hinfo->hash < start_hash) || 1014 1013 ((hinfo->hash == start_hash) && 1015 1014 (hinfo->minor_hash < start_minor_hash))) ··· 1198 1197 1199 1198 while ((char *) de < base + blocksize) { 1200 1199 if (de->name_len && de->inode) { 1201 - ext4fs_dirhash(de->name, de->name_len, &h); 1200 + ext4fs_dirhash(dir, de->name, de->name_len, &h); 1202 1201 map_tail--; 1203 1202 map_tail->hash = h.hash; 1204 1203 map_tail->offs = ((char *) de - base)>>2; ··· 1253 1252 dx_set_count(entries, count + 1); 1254 1253 } 1255 1254 1255 + #ifdef CONFIG_UNICODE 1256 + /* 1257 + * Test whether a case-insensitive directory entry matches the filename 1258 + * being searched for. 1259 + * 1260 + * Returns: 0 if the directory entry matches, more than 0 if it 1261 + * doesn't match or less than zero on error. 1262 + */ 1263 + int ext4_ci_compare(const struct inode *parent, const struct qstr *name, 1264 + const struct qstr *entry) 1265 + { 1266 + const struct ext4_sb_info *sbi = EXT4_SB(parent->i_sb); 1267 + const struct unicode_map *um = sbi->s_encoding; 1268 + int ret; 1269 + 1270 + ret = utf8_strncasecmp(um, name, entry); 1271 + if (ret < 0) { 1272 + /* Handle invalid character sequence as either an error 1273 + * or as an opaque byte sequence. 1274 + */ 1275 + if (ext4_has_strict_mode(sbi)) 1276 + return -EINVAL; 1277 + 1278 + if (name->len != entry->len) 1279 + return 1; 1280 + 1281 + return !!memcmp(name->name, entry->name, name->len); 1282 + } 1283 + 1284 + return ret; 1285 + } 1286 + #endif 1287 + 1256 1288 /* 1257 1289 * Test whether a directory entry matches the filename being searched for. 1258 1290 * 1259 1291 * Return: %true if the directory entry matches, otherwise %false. 1260 1292 */ 1261 - static inline bool ext4_match(const struct ext4_filename *fname, 1293 + static inline bool ext4_match(const struct inode *parent, 1294 + const struct ext4_filename *fname, 1262 1295 const struct ext4_dir_entry_2 *de) 1263 1296 { 1264 1297 struct fscrypt_name f; 1298 + #ifdef CONFIG_UNICODE 1299 + const struct qstr entry = {.name = de->name, .len = de->name_len}; 1300 + #endif 1265 1301 1266 1302 if (!de->inode) 1267 1303 return false; ··· 1308 1270 #ifdef CONFIG_FS_ENCRYPTION 1309 1271 f.crypto_buf = fname->crypto_buf; 1310 1272 #endif 1273 + 1274 + #ifdef CONFIG_UNICODE 1275 + if (EXT4_SB(parent->i_sb)->s_encoding && IS_CASEFOLDED(parent)) 1276 + return (ext4_ci_compare(parent, fname->usr_fname, &entry) == 0); 1277 + #endif 1278 + 1311 1279 return fscrypt_match_name(&f, de->name, de->name_len); 1312 1280 } 1313 1281 ··· 1334 1290 /* this code is executed quadratically often */ 1335 1291 /* do minimal checking `by hand' */ 1336 1292 if ((char *) de + de->name_len <= dlimit && 1337 - ext4_match(fname, de)) { 1293 + ext4_match(dir, fname, de)) { 1338 1294 /* found a match - just to be sure, do 1339 1295 * a full check */ 1340 1296 if (ext4_check_dir_entry(dir, NULL, de, bh, bh->b_data, ··· 1632 1588 return ERR_PTR(-EPERM); 1633 1589 } 1634 1590 } 1591 + 1592 + #ifdef CONFIG_UNICODE 1593 + if (!inode && IS_CASEFOLDED(dir)) { 1594 + /* Eventually we want to call d_add_ci(dentry, NULL) 1595 + * for negative dentries in the encoding case as 1596 + * well. For now, prevent the negative dentry 1597 + * from being cached. 1598 + */ 1599 + return NULL; 1600 + } 1601 + #endif 1635 1602 return d_splice_alias(inode, dentry); 1636 1603 } 1637 1604 ··· 1853 1798 if (ext4_check_dir_entry(dir, NULL, de, bh, 1854 1799 buf, buf_size, offset)) 1855 1800 return -EFSCORRUPTED; 1856 - if (ext4_match(fname, de)) 1801 + if (ext4_match(dir, fname, de)) 1857 1802 return -EEXIST; 1858 1803 nlen = EXT4_DIR_REC_LEN(de->name_len); 1859 1804 rlen = ext4_rec_len_from_disk(de->rec_len, buf_size); ··· 2038 1983 if (fname->hinfo.hash_version <= DX_HASH_TEA) 2039 1984 fname->hinfo.hash_version += EXT4_SB(dir->i_sb)->s_hash_unsigned; 2040 1985 fname->hinfo.seed = EXT4_SB(dir->i_sb)->s_hash_seed; 2041 - ext4fs_dirhash(fname_name(fname), fname_len(fname), &fname->hinfo); 1986 + ext4fs_dirhash(dir, fname_name(fname), fname_len(fname), &fname->hinfo); 2042 1987 2043 1988 memset(frames, 0, sizeof(frames)); 2044 1989 frame = frames; ··· 2091 2036 struct ext4_dir_entry_2 *de; 2092 2037 struct ext4_dir_entry_tail *t; 2093 2038 struct super_block *sb; 2039 + struct ext4_sb_info *sbi; 2094 2040 struct ext4_filename fname; 2095 2041 int retval; 2096 2042 int dx_fallback=0; ··· 2103 2047 csum_size = sizeof(struct ext4_dir_entry_tail); 2104 2048 2105 2049 sb = dir->i_sb; 2050 + sbi = EXT4_SB(sb); 2106 2051 blocksize = sb->s_blocksize; 2107 2052 if (!dentry->d_name.len) 2108 2053 return -EINVAL; 2054 + 2055 + #ifdef CONFIG_UNICODE 2056 + if (ext4_has_strict_mode(sbi) && IS_CASEFOLDED(dir) && 2057 + utf8_validate(sbi->s_encoding, &dentry->d_name)) 2058 + return -EINVAL; 2059 + #endif 2109 2060 2110 2061 retval = ext4_fname_setup_filename(dir, &dentry->d_name, 0, &fname); 2111 2062 if (retval) ··· 3038 2975 ext4_update_dx_flag(dir); 3039 2976 ext4_mark_inode_dirty(handle, dir); 3040 2977 2978 + #ifdef CONFIG_UNICODE 2979 + /* VFS negative dentries are incompatible with Encoding and 2980 + * Case-insensitiveness. Eventually we'll want avoid 2981 + * invalidating the dentries here, alongside with returning the 2982 + * negative dentries at ext4_lookup(), when it is better 2983 + * supported by the VFS for the CI case. 2984 + */ 2985 + if (IS_CASEFOLDED(dir)) 2986 + d_invalidate(dentry); 2987 + #endif 2988 + 3041 2989 end_rmdir: 3042 2990 brelse(bh); 3043 2991 if (handle) ··· 3117 3043 ext4_orphan_add(handle, inode); 3118 3044 inode->i_ctime = current_time(inode); 3119 3045 ext4_mark_inode_dirty(handle, inode); 3046 + 3047 + #ifdef CONFIG_UNICODE 3048 + /* VFS negative dentries are incompatible with Encoding and 3049 + * Case-insensitiveness. Eventually we'll want avoid 3050 + * invalidating the dentries here, alongside with returning the 3051 + * negative dentries at ext4_lookup(), when it is better 3052 + * supported by the VFS for the CI case. 3053 + */ 3054 + if (IS_CASEFOLDED(dir)) 3055 + d_invalidate(dentry); 3056 + #endif 3120 3057 3121 3058 end_unlink: 3122 3059 brelse(bh);
+6
fs/ext4/super.c
··· 4484 4484 iput(root); 4485 4485 goto failed_mount4; 4486 4486 } 4487 + 4488 + #ifdef CONFIG_UNICODE 4489 + if (sbi->s_encoding) 4490 + sb->s_d_op = &ext4_dentry_ops; 4491 + #endif 4492 + 4487 4493 sb->s_root = d_make_root(root); 4488 4494 if (!sb->s_root) { 4489 4495 ext4_msg(sb, KERN_ERR, "get root dentry failed");
+2
include/linux/fs.h
··· 1953 1953 #define S_DAX 0 /* Make all the DAX code disappear */ 1954 1954 #endif 1955 1955 #define S_ENCRYPTED 16384 /* Encrypted file (using fs/crypto/) */ 1956 + #define S_CASEFOLD 32768 /* Casefolded file */ 1956 1957 1957 1958 /* 1958 1959 * Note that nosuid etc flags are inode-specific: setting some file-system ··· 1994 1993 #define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC) 1995 1994 #define IS_DAX(inode) ((inode)->i_flags & S_DAX) 1996 1995 #define IS_ENCRYPTED(inode) ((inode)->i_flags & S_ENCRYPTED) 1996 + #define IS_CASEFOLDED(inode) ((inode)->i_flags & S_CASEFOLD) 1997 1997 1998 1998 #define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \ 1999 1999 (inode)->i_rdev == WHITEOUT_DEV)