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

From: Yang Wen

Date: Sat Sep 19 2026 - 11:38:05 EST


Hi,

Thank you for the careful review and for pointing out these issues.

> > @@ -1489,7 +1491,10 @@ int exfat_write_volume_label(struct super_block *sb,
> > goto unlock;
> > }
> >
> > - ret = exfat_find_empty_entry(root_inode, &clu, 1, &es);
> > + ret = exfat_find_empty_entry(root_inode, &clu, 1, &es,
> > + &next_hint);
> > + if (!ret)
> It should be if (ret >= 0) ?
exfat_find_empty_entry() returns a non-negative entry index on success.
I have changed the volume-label path to use ret >= 0.

> > + entry_allocated = true;
> > }
> >
> > +static void exfat_set_next_empty_hint(struct inode *inode,
> > + struct exfat_chain *p_dir, int dentry,
> > + int num_entries,
> > + struct exfat_entry_set_cache *es,
> > + struct exfat_hint_femp *hint_femp)
> > +{
> Please check whether smaller holes can be skipped. For example, if
> there is a 3 entry hole near the beginning and a 4 entry name is
> appended, a subsequent 3entry name may skip the existing hole because
> the Bloom filter miss bypasses the name scan and allocation starts
> from the saved hint. Unless another deletion occurs, could this state
> persist and cause the directory to grow unnecessarily?
The smaller-hole example is also valid. A Bloom-filter miss can skip the
name scan that would otherwise rediscover an earlier hole, while the saved
hint points past it. In v5, the hint records the entry-set size that
justified advancing it. If a later request needs fewer entries, allocation
discards the hint and searches from the beginning. I have also kept the
hint invalidation on paths that free entries.

> And please create the patches against #dev branch.
I have rebased the series on the exFAT dev branch.

Thanks again.