On Sun, Mar 27, 2022 at 09:58:44AM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <djwong@xxxxxxxxxx> > > Due to cycling of m_sb_lock, it's possible for multiple callers of > xfs_reserve_blocks to race at changing the pool size, subtracting blocks > from fdblocks, and actually putting it in the pool. The result of all > this is that we can overfill the reserve pool to hilarious levels. > > xfs_mod_fdblocks, when called with a positive value, already knows how > to take freed blocks and either fill the reserve until it's full, or put > them in fdblocks. Use that instead of setting m_resblks_avail directly. Looks good: Reviewed-by: Christoph Hellwig <hch@xxxxxx>