Re: [PATCH v5 03/10] xfs: Refactor xfs_reflink_end_cow_extent()

From: John Garry
Date: Wed Mar 12 2025 - 04:27:43 EST


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?

Thanks,
John