Re: [PATCH RESEND v2 19/25] vfs: Handle case-exact lookup in d_add_ci

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Theodore Y. Ts'o" <tytso@xxxxxxx> 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



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux