Re: [PATCH v17 3/7] libfs: Introduce case-insensitive string comparison helper

From: Eric Biggers
Date: Fri May 31 2024 - 00:49:05 EST


On Wed, May 29, 2024 at 11:26:30AM +0300, Eugen Hristev via Linux-f2fs-devel wrote:
> + /*
> + * Attempt a case-sensitive match first. It is cheaper and
> + * should cover most lookups, including all the sane
> + * applications that expect a case-sensitive filesystem.
> + */
> +
> + if (dirent.len == (folded_name->name ? folded_name->len : name->len) &&
> + !memcmp(name->name, dirent.name, dirent.len))
> + goto out;

Shouldn't it be just 'name->len' instead of
'(folded_name->name ? folded_name->len : name->len)'?

- Eric