Skip to content

Commit

Permalink
ext4: fix dcache lookup of !casefolded directories
Browse files Browse the repository at this point in the history
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 <krisman@collabora.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
Gabriel Krisman Bertazi authored and Theodore Ts'o committed May 25, 2019
1 parent ee0ed02 commit 66883da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext4/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ static int ext4_d_compare(const struct dentry *dentry, unsigned int len,
if (!IS_CASEFOLDED(dentry->d_parent->d_inode)) {
if (len != name->len)
return -1;
return !memcmp(str, name, len);
return memcmp(str, name->name, len);
}

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

0 comments on commit 66883da

Please sign in to comment.