lkml.org 
[lkml]   [2020]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 2/8] fs: Add standard casefolding support
On Fri, Feb 07, 2020 at 05:35:46PM -0800, Daniel Rosenberg wrote:

> +int generic_ci_d_compare(const struct dentry *dentry, unsigned int len,
> + const char *str, const struct qstr *name)
> +{
> + const struct dentry *parent = READ_ONCE(dentry->d_parent);
> + const struct inode *inode = READ_ONCE(parent->d_inode);
> + const struct super_block *sb = dentry->d_sb;
> + const struct unicode_map *um = sb->s_encoding;
> + struct qstr entry = QSTR_INIT(str, len);
> + int ret;
> +
> + if (!inode || !needs_casefold(inode))
> + goto fallback;
> +
> + ret = utf8_strncasecmp(um, name, &entry);

Again, is that safe in case when the contents of the string str points to
keeps changing under you?

\
 
 \ /
  Last update: 2020-02-08 03:13    [W:0.095 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site