diff options
author | Gabriel Krisman Bertazi <krisman@collabora.com> | 2019-05-25 05:48:23 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2019-05-25 05:48:23 +0200 |
commit | 66883da1eee8ad4b38eeff7fa1c86a097d9670fc (patch) | |
tree | 2aa59ae58d0ce4f7d01d7b35ecaf9d9bd8abf0a5 | |
parent | ext4: do not delete unlinked inode from orphan list on failed truncate (diff) | |
download | linux-66883da1eee8ad4b38eeff7fa1c86a097d9670fc.tar.xz linux-66883da1eee8ad4b38eeff7fa1c86a097d9670fc.zip |
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: b886ee3e778e ("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>
-rw-r--r-- | fs/ext4/dir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index 884a6e776809..c7843b149a1e 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c @@ -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); |