btrfs: don't clear qgroup reserved bit in release_folio

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>

authored by Boris Burkov and committed by David Sterba a8680550 b321a52c

Changed files
+2 -1
fs
btrfs
+2 -1
fs/btrfs/extent_io.c
··· 2302 2302 ret = 0; 2303 2303 } else { 2304 2304 u32 clear_bits = ~(EXTENT_LOCKED | EXTENT_NODATASUM | 2305 - EXTENT_DELALLOC_NEW | EXTENT_CTLBITS); 2305 + EXTENT_DELALLOC_NEW | EXTENT_CTLBITS | 2306 + EXTENT_QGROUP_RESERVED); 2306 2307 2307 2308 /* 2308 2309 * At this point we can safely clear everything except the