linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: "André Almeida" <andrealmeid@igalia.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	Amir Goldstein <amir73il@gmail.com>, Theodore Tso <tytso@mit.edu>,
	Gabriel Krisman Bertazi <krisman@kernel.org>,
	linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	kernel-dev@igalia.com
Subject: Re: [PATCH RFC v2 2/8] ovl: Create ovl_strcmp() with casefold support
Date: Tue, 5 Aug 2025 06:08:09 +0100	[thread overview]
Message-ID: <20250805050809.GA222315@ZenIV> (raw)
In-Reply-To: <20250805-tonyk-overlayfs-v2-2-0e54281da318@igalia.com>

On Tue, Aug 05, 2025 at 12:09:06AM -0300, André Almeida wrote:

> +static int ovl_strcmp(const char *str, struct ovl_cache_entry *p, int len)

> +	if (p->map && !is_dot_dotdot(str, len)) {
> +		dst = kmalloc(OVL_NAME_LEN, GFP_KERNEL);

...`

> +	kfree(dst);
> +
> +	return cmp;
> +}
> +

> @@ -107,7 +145,7 @@ static struct ovl_cache_entry *ovl_cache_entry_find(struct rb_root *root,
>  	while (node) {
>  		struct ovl_cache_entry *p = ovl_cache_entry_from_node(node);
>  
> -		cmp = strncmp(name, p->name, len);
> +		cmp = ovl_strcmp(name, p, len);
>  		if (cmp > 0)
>  			node = p->node.rb_right;
>  		else if (cmp < 0 || len < p->len)

Am I misreading that, or do really we get a kmalloc()/kfree() for each
sodding tree node we traverse on rbtree lookup here?

  reply	other threads:[~2025-08-05  5:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-05  3:09 [PATCH RFC v2 0/8] ovl: Enable support for casefold filesystems André Almeida
2025-08-05  3:09 ` [PATCH RFC v2 1/8] olv: Store casefold name for case-insentive dentries André Almeida
2025-08-05  3:09 ` [PATCH RFC v2 2/8] ovl: Create ovl_strcmp() with casefold support André Almeida
2025-08-05  5:08   ` Al Viro [this message]
2025-08-05 13:01     ` André Almeida
2025-08-05 14:56   ` Gabriel Krisman Bertazi
2025-08-05 18:40     ` André Almeida
2025-08-05  3:09 ` [PATCH RFC v2 3/8] fs: Create sb_same_encoding() helper André Almeida
2025-08-05  3:09 ` [PATCH RFC v2 4/8] ovl: Ensure that all mount points have the same encoding André Almeida
2025-08-05  3:09 ` [PATCH RFC v2 5/8] ovl: Set case-insensitive dentry operations for ovl sb André Almeida
2025-08-05  3:09 ` [PATCH RFC v2 6/8] ovl: Set inode S_CASEFOLD for casefolded dentries André Almeida
2025-08-05  3:09 ` [PATCH RFC v2 7/8] ovl: Check casefold consistency in ovl stack André Almeida
2025-08-05  3:09 ` [PATCH RFC v2 8/8] ovl: Drop restrictions for casefolded dentries André Almeida

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250805050809.GA222315@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=amir73il@gmail.com \
    --cc=andrealmeid@igalia.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=kernel-dev@igalia.com \
    --cc=krisman@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).