Re: [PATCH AUTOSEL 4.19 34/38] btrfs: file: reserve qgroup space after the hole punch range is locked

Pavel Machek
2020-08-29T12:11:46Z

[-- Attachment #1: Type: text/plain, Size: 1036 bytes --]

Hi!

> [ Upstream commit a7f8b1c2ac21bf081b41264c9cfd6260dffa6246 ]
>
> The incoming qgroup reserved space timing will move the data reservation
> to ordered extent completely.
>
> However in btrfs_punch_hole_lock_range() will call
> btrfs_invalidate_page(), which will clear QGROUP_RESERVED bit for the
> range.
>
> In current stage it's OK, but if we're making ordered extents handle the
> reserved space, then btrfs_punch_hole_lock_range() can clear the
> QGROUP_RESERVED bit before we submit ordered extent, leading to qgroup
> reserved space leakage.
>
> So here change the timing to make reserve data space after
> btrfs_punch_hole_lock_range().
> The new timing is fine for either current code or the new code.

I'm not sure why this is queued for -stable. It is preparation for
future work, and that work is not queued for -stable.

Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]