[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a29eec78-1e40-4ade-8b23-b44c3f72bee2@igalia.com>
Date: Tue, 26 Aug 2025 17:13:26 -0300
From: André Almeida <andrealmeid@...lia.com>
To: Amir Goldstein <amir73il@...il.com>,
Gabriel Krisman Bertazi <gabriel@...sman.be>
Cc: Miklos Szeredi <miklos@...redi.hu>, Theodore Tso <tytso@....edu>,
linux-unionfs@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
kernel-dev@...lia.com
Subject: Re: [PATCH v6 6/9] ovl: Set case-insensitive dentry operations for
ovl sb
Em 25/08/2025 12:34, Amir Goldstein escreveu:
> On Mon, Aug 25, 2025 at 1:24 PM Gabriel Krisman Bertazi
> <gabriel@...sman.be> wrote:
>>
>> André Almeida <andrealmeid@...lia.com> writes:
>>
>>> For filesystems with encoding (i.e. with case-insensitive support), set
>>> the dentry operations for the super block as ovl_dentry_ci_operations.
>>>
>>> Reviewed-by: Amir Goldstein <amir73il@...il.com>
>>> Signed-off-by: André Almeida <andrealmeid@...lia.com>
>>> ---
>>> Changes in v6:
>>> - Fix kernel bot warning: unused variable 'ofs'
>>> ---
>>> fs/overlayfs/super.c | 25 +++++++++++++++++++++++++
>>> 1 file changed, 25 insertions(+)
>>>
>>> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
>>> index b1dbd3c79961094d00c7f99cc622e515d544d22f..8db4e55d5027cb975fec9b92251f62fe5924af4f 100644
>>> --- a/fs/overlayfs/super.c
>>> +++ b/fs/overlayfs/super.c
>>> @@ -161,6 +161,16 @@ static const struct dentry_operations ovl_dentry_operations = {
>>> .d_weak_revalidate = ovl_dentry_weak_revalidate,
>>> };
>>>
>>> +#if IS_ENABLED(CONFIG_UNICODE)
>>> +static const struct dentry_operations ovl_dentry_ci_operations = {
>>> + .d_real = ovl_d_real,
>>> + .d_revalidate = ovl_dentry_revalidate,
>>> + .d_weak_revalidate = ovl_dentry_weak_revalidate,
>>> + .d_hash = generic_ci_d_hash,
>>> + .d_compare = generic_ci_d_compare,
>>> +};
>>> +#endif
>>> +
>>> static struct kmem_cache *ovl_inode_cachep;
>>>
>>> static struct inode *ovl_alloc_inode(struct super_block *sb)
>>> @@ -1332,6 +1342,19 @@ static struct dentry *ovl_get_root(struct super_block *sb,
>>> return root;
>>> }
>>>
>>> +static void ovl_set_d_op(struct super_block *sb)
>>> +{
>>> +#if IS_ENABLED(CONFIG_UNICODE)
>>> + struct ovl_fs *ofs = sb->s_fs_info;
>>> +
>>> + if (ofs->casefold) {
>>> + set_default_d_op(sb, &ovl_dentry_ci_operations);
>>> + return;
>>> + }
>>> +#endif
>>> + set_default_d_op(sb, &ovl_dentry_operations);
>>> +}
>>> +
>>> int ovl_fill_super(struct super_block *sb, struct fs_context *fc)
>>> {
>>> struct ovl_fs *ofs = sb->s_fs_info;
>>> @@ -1443,6 +1466,8 @@ int ovl_fill_super(struct super_block *sb, struct fs_context *fc)
>>> if (IS_ERR(oe))
>>> goto out_err;
>>>
>>> + ovl_set_d_op(sb);
>>> +
>>
>> Absolutely minor, but fill_super is now calling
>> set_default_d_op(sb, &ovl_dentry_operations) twice, once here and once
>> at the beginning of the function. You can remove the original call.
>
> Good catch!
>
> That was not my intention at all.
> I asked to replace the set_default_d_op() call with ovl_set_d_op()
> but I missed that in the review.
>
> Will fix it in my tree.
>
Ops, my bad. Thank you for the fix :)
> Thanks!
> Amir.
Powered by blists - more mailing lists