[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87va6bmbdk.fsf@collabora.co.uk>
Date: Tue, 09 Oct 2018 10:40:39 -0400
From: Gabriel Krisman Bertazi <krisman@...labora.co.uk>
To: "Theodore Y. Ts'o" <tytso@....edu>
Cc: linux-ext4@...r.kernel.org
Subject: Re: [PATCH RESEND v2 19/25] vfs: Handle case-exact lookup in d_add_ci
"Theodore Y. Ts'o" <tytso@....edu> writes:
> On Mon, Sep 24, 2018 at 05:56:49PM -0400, Gabriel Krisman Bertazi wrote:
>> This prevents a soft hang if called d_add_ci is called from the FS
>> layer, when doing a CI search but the result dentry is the exact match.
>
> This isn't the right way to fix this problem. Take a look at how xfs
> handles this in fs/xfs/xfs_iops.c:xfs_vn_ci_lookup(). This logic
> should be in the file system, not in d_add_ci(). Also, we don't want
> to use d_same_name(), since that is *not* guaranteed to do an exact
> match. It happens to do so for ext4 since we don't provide d_compare,
> but it's better just check for an exact match and call
> d_splice_alias() instead of d_add_ci() in ext4_lookup().
>
> Also note that d_same_name() is *not* guaranteeed to do an exact
> match, in particular if the file system provides d_compare (which
> granted, ext4 doesn't right now). It's simpler to just do a direct
> strcmp in ext4_lookup.
>
> - Ted
>
> P.S. Apologies for not having a chance to look at this series in
> detail until now. It's been a crazy month...
Hey Ted,
No worries. Thanks for the review.
I'm aware of how xfs does it. I was looking for a generic way but I see
its problems now. I will have it addressed in the next iteration.
thanks.
--
Gabriel Krisman Bertazi
Powered by blists - more mailing lists