]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: simplify range tracking in cow_file_range()
authorHaisu Wang <haisuwang@tencent.com>
Fri, 25 Oct 2024 06:54:41 +0000 (14:54 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 11 Nov 2024 13:34:22 +0000 (14:34 +0100)
commit5599f39356c6ec73d2015ae88286382d1034ef0d
tree6c0b4a037a3cc3c6efc916191a2f8390330c4111
parent7c855e16ab72596d771355050ffe026e6b99f91c
btrfs: simplify range tracking in cow_file_range()

Simplify tracking of the range processed by using cur_alloc_size only to
store the reserved part that may fail to the allocated extent. Remove
the ram_size as well since it is always equal to cur_alloc_size in the
context. Advance the start in normal path until extent allocation
succeeds and keep the start unchanged in the error handling path.

Passed the fstest generic/475 test for a hundred times with quota
enabled. And a modified generic/475 test by removing the sleep time
for a hundred times. About one tenth of the tests do enter the error
handling path due to fail to reserve extent.

Suggested-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Haisu Wang <haisuwang@tencent.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c