On Wed, Mar 12, 2025 at 08:27:05AM +0000, John Garry wrote: > On 12/03/2025 07:24, Christoph Hellwig wrote: > > On Mon, Mar 10, 2025 at 06:39:39PM +0000, John Garry wrote: > > > Refactor xfs_reflink_end_cow_extent() into separate parts which process > > > the CoW range and commit the transaction. > > > > > > This refactoring will be used in future for when it is required to commit > > > a range of extents as a single transaction, similar to how it was done > > > pre-commit d6f215f359637. > > > > Darrick pointed out that if you do more than just a tiny number > > of extents per transactions you run out of log reservations very > > quickly here: > > > > https://urldefense.com/v3/__https://lore.kernel.org/all/20240329162936.GI6390@frogsfrogsfrogs/__;!!ACWV5N9M2RV99hQ!PWLcBof1tKimKUObvCj4vOhljWjFmjtzVHLx9apcU5Rah1xZnmp_3PIq6eSwx6TdEXzMLYYyBfmZLgvj$ > > > > how does your scheme deal with that? > > > The resblks calculation in xfs_reflink_end_atomic_cow() takes care of this, > right? Or does the log reservation have a hard size limit, regardless of > that calculation? The resblks calculated there are the reserved disk blocks and have nothing to do with the log reservations, which comes from the tr_write field passed in. There is some kind of upper limited to it obviously by the log size, although I'm not sure if we've formalized that somewhere. Dave might be the right person to ask about that.