Skip to content

Commit a868055

Browse files
boryaskdave
authored andcommitted
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: [email protected] # 5.15+ Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Boris Burkov <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent b321a52 commit a868055

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/btrfs/extent_io.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2302,7 +2302,8 @@ static int try_release_extent_state(struct extent_io_tree *tree,
23022302
ret = 0;
23032303
} else {
23042304
u32 clear_bits = ~(EXTENT_LOCKED | EXTENT_NODATASUM |
2305-
EXTENT_DELALLOC_NEW | EXTENT_CTLBITS);
2305+
EXTENT_DELALLOC_NEW | EXTENT_CTLBITS |
2306+
EXTENT_QGROUP_RESERVED);
23062307

23072308
/*
23082309
* At this point we can safely clear everything except the

0 commit comments

Comments
 (0)