]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: free qgroup reserve when ORDERED_IOERR is set
authorBoris Burkov <boris@bur.io>
Fri, 1 Dec 2023 21:00:09 +0000 (13:00 -0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 6 Dec 2023 21:32:40 +0000 (22:32 +0100)
commitf63e1164b90b385cd832ff0fdfcfa76c3cc15436
tree2ddef0ef594b5e497f4a1b291e413185c95187ec
parent0ac1d13a55eb37d398b63e6ff6db4a09a2c9128c
btrfs: free qgroup reserve when ORDERED_IOERR is set

An ordered extent completing is a critical moment in qgroup reserve
handling, as the ownership of the reservation is handed off from the
ordered extent to the delayed ref. In the happy path we release (unlock)
but do not free (decrement counter) the reservation, and the delayed ref
drives the free. However, on an error, we don't create a delayed ref,
since there is no ref to add. Therefore, free on the error path.

CC: stable@vger.kernel.org # 6.1+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Boris Burkov <boris@bur.io>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ordered-data.c