Re: [PATCH] exfat: speed up file creation in large directories

From: Chi Zhiling

Date: Sun Aug 30 2026 - 21:11:22 EST


Hi, Yang Wen


On 8/28/26 10:58 PM, Yang Wen wrote:
Negative name lookups scan a directory from the beginning. Repeating
this scan before creating each file makes bulk file creation approach
O(N^2).

Add a 64 KiB per-directory Bloom filter and retain the next empty entry
found during directory scans. A definite Bloom filter miss skips the
directory scan, while a possible match falls back to the normal lookup
path, preserving correctness in the presence of hash collisions.

I think this is a nice optimization, and for large-directory workloads, the 64 KB overhead is acceptable to me.

static void exfat_free_inode(struct inode *inode)
{
+ exfat_name_filter_free(inode);
The exfat_free_inode() could be called in softirq context, see destroy_inode() in fs/inode.c, which calls free_inode() via call_rcu(),

so you can't call exfat_name_filter_free() from exfat_free_inode(). It should be moved to exfat_evict_inode(), otherwise LOCKDEP will report a warning.


Thanks,