Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

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