]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: don't clear qgroup reserved bit in release_folio
authorBoris Burkov <boris@bur.io>
Fri, 1 Dec 2023 21:00:12 +0000 (13:00 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 16:00:26 +0000 (17:00 +0100)
commit730b3322b8c3170abd3e25fca7fcbb65ac49dc65
treef9b1d0e99dc8ef7e226eb24b928c00b3a2a9cea0
parent9b670e1b644c845d3a0def23c0cce910c1ed0a00
btrfs: don't clear qgroup reserved bit in release_folio

commit a86805504b88f636a6458520d85afdf0634e3c6b upstream.

The EXTENT_QGROUP_RESERVED bit is used to "lock" regions of the file for
duplicate reservations. That is two writes to that range in one
transaction shouldn't create two reservations, as the reservation will
only be freed once when the write finally goes down. Therefore, it is
never OK to clear that bit without freeing the associated qgroup
reserve. At this point, we don't want to be freeing the reserve, so mask
off the bit.

CC: stable@vger.kernel.org # 5.15+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Boris Burkov <boris@bur.io>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/extent_io.c