Re: [PATCH v6 4/9] ovl: Create ovl_casefold() to support casefolded strncmp()
From: Amir Goldstein
Date: Thu Aug 28 2025 - 07:10:26 EST
On Wed, Aug 27, 2025 at 10:45 PM André Almeida <andrealmeid@xxxxxxxxxx> wrote:
>
> Em 26/08/2025 04:19, Amir Goldstein escreveu:
> >
> > Andre,
> >
> > Just noticed this is a bug, should have been if (*dst), but anyway following
> > Gabriel's comments I have made this change in my tree (pending more
> > strict related changes):
> >
> > static int ovl_casefold(struct ovl_readdir_data *rdd, const char *str, int len,
> > char **dst)
> > {
> > const struct qstr qstr = { .name = str, .len = len };
> > char *cf_name;
> > int cf_len;
> >
> > if (!IS_ENABLED(CONFIG_UNICODE) || !rdd->map || is_dot_dotdot(str, len))
> > return 0;
> >
> > cf_name = kmalloc(NAME_MAX, GFP_KERNEL);
> > if (!cf_name) {
> > rdd->err = -ENOMEM;
> > return -ENOMEM;
> > }
> >
> > cf_len = utf8_casefold(rdd->map, &qstr, *dst, NAME_MAX);
>
> The third argument here should be cf_name, not *dst anymore.
oops. fixed in my tree.
Thanks,
Amir.