Skip to content

Commit 66883da

Browse files
krisman-at-collaboratytso
authored andcommitted
ext4: fix dcache lookup of !casefolded directories
Found by visual inspection, this wasn't caught by my xfstest, since it's effect is ignoring positive dentries in the cache the fallback just goes to the disk. it was introduced in the last iteration of the case-insensitive patch. d_compare should return 0 when the entries match, so make sure we are correctly comparing the entire string if the encoding feature is set and we are on a case-INsensitive directory. Fixes: b886ee3 ("ext4: Support case-insensitive file name lookups") Signed-off-by: Gabriel Krisman Bertazi <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
1 parent ee0ed02 commit 66883da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ static int ext4_d_compare(const struct dentry *dentry, unsigned int len,
671671
if (!IS_CASEFOLDED(dentry->d_parent->d_inode)) {
672672
if (len != name->len)
673673
return -1;
674-
return !memcmp(str, name, len);
674+
return memcmp(str, name->name, len);
675675
}
676676

677677
return ext4_ci_compare(dentry->d_parent->d_inode, name, &qstr);

0 commit comments

Comments
 (0)