Re: [PATCH v7 2/3] exfat: retain the next empty directory entry hint

From: Namjae Jeon

Date: Wed Oct 07 2026 - 00:55:21 EST


> @@ -309,8 +358,9 @@ int exfat_find_empty_entry(struct inode *inode,
> hint_femp.eidx = EXFAT_HINT_NONE;
>
> if (ei->hint_femp.eidx != EXFAT_HINT_NONE) {
> - hint_femp = ei->hint_femp;
> - ei->hint_femp.eidx = EXFAT_HINT_NONE;
> + if (num_entries >= ei->hint_femp.min_entries)
This size check does not establish that the hint covers the beginning
of the directory. exfat_find_dir_entry() can start at hint_stat.eidx
and return a positive match without rewinding, while recording deleted
runs found only in that suffix. later Bloom-filter miss bypasses the
full scan. This condition can then reuse the suffix-only hint and skip
a larger free run earlier in the directory. That can cause unnecessary
directory growth and, if growth is impossible, a false -ENOSPC. Could
hints from partial scans be invalidated or marked unusable before
reuse?

> + hint_femp = ei->hint_femp;
> + exfat_invalidate_empty_hint(inode);