Re: [PATCH 1/2] exfat: reuse valid negative dentries for file creation
From: Namjae Jeon
Date: Fri Jun 12 2026 - 09:41:12 EST
> diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c
> index b7d5e44ad38e..fe26fbf6a0f2 100644
> --- a/fs/exfat/namei.c
> +++ b/fs/exfat/namei.c
> @@ -24,12 +24,9 @@ static inline void exfat_d_version_set(struct dentry *dentry,
> }
>
> /*
> - * If new entry was created in the parent, it could create the 8.3 alias (the
> - * shortname of logname). So, the parent may have the negative-dentry which
> - * matches the created 8.3 alias.
> - *
> - * If it happened, the negative dentry isn't actually negative anymore. So,
> - * drop it.
> + * exFAT has no FAT-style 8.3 alias entries. A negative dentry can therefore
> + * be reused for creation as long as the parent directory version did not
> + * change since the lookup that created it.
> */
> static int exfat_d_revalidate(struct inode *dir, const struct qstr *name,
> struct dentry *dentry, unsigned int flags)
> @@ -54,7 +51,7 @@ static int exfat_d_revalidate(struct inode *dir, const struct qstr *name,
> * Drop the negative dentry, in order to make sure to use the case
> * sensitive name which is specified by user if this is for creation.
> */
> - if (flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET))
> + if (flags & LOOKUP_RENAME_TARGET)
Removing LOOKUP_CREATE breaks case-preserving creation.
$ stat foo 2>/dev/null || true
$ touch FOO
$ ls
foo
The cached negative dentry for "foo" is reused for "FOO". I think only
the obsolete 8.3 alias comment should be updated, while keeping the
LOOKUP_CREATE check.