Boris Burkov
9e65bfca24
btrfs: fix qgroup_free_reserved_data int overflow
...
The reserved data counter and input parameter is a u64, but we
inadvertently accumulate it in an int. Overflowing that int results in
freeing the wrong amount of data and breaking reserve accounting.
Unfortunately, this overflow rot spreads from there, as the qgroup
release/free functions rely on returning an int to take advantage of
negative values for error codes.
Therefore, the full fix is to return the "released" or "freed" amount by
a u64 argument and to return 0 or negative error code via the return
value.
Most of the call sites simply ignore the return value, though some
of them handle the error and count the returned bytes. Change all of
them accordingly.
CC: stable@vger.kernel.org # 6.1+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Boris Burkov <boris@bur.io>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-06 22:32:46 +01:00
..
2023-10-12 16:44:07 +02:00
2022-12-05 18:00:58 +01:00
2023-10-12 16:44:11 +02:00
2023-01-19 09:24:28 +01:00
2023-01-19 09:24:27 +01:00
2023-10-12 16:44:10 +02:00
2023-10-12 16:44:10 +02:00
2023-10-12 16:44:13 +02:00
2023-10-12 16:44:13 +02:00
2023-10-12 16:44:10 +02:00
2023-06-19 13:59:36 +02:00
2023-10-12 16:44:16 +02:00
2023-08-21 14:52:12 +02:00
2023-10-12 16:44:09 +02:00
2023-06-19 13:59:24 +02:00
2023-10-12 16:44:19 +02:00
2023-10-12 16:44:07 +02:00
2023-06-19 13:59:36 +02:00
2023-11-03 16:39:06 +01:00
2023-10-12 16:44:17 +02:00
2023-10-12 16:44:14 +02:00
2023-10-12 16:44:13 +02:00
2023-12-06 22:32:46 +01:00
2022-12-05 18:00:44 +01:00
2023-10-12 16:44:19 +02:00
2023-10-12 16:44:12 +02:00
2023-11-09 14:01:59 +01:00
2023-10-12 16:44:16 +02:00
2023-10-12 16:44:07 +02:00
2022-12-05 18:00:47 +01:00
2023-10-12 16:44:07 +02:00
2023-10-12 16:44:02 +02:00
2023-06-19 13:59:25 +02:00
2023-06-19 13:59:25 +02:00
2023-11-23 22:27:26 +01:00
2023-10-12 16:44:07 +02:00
2022-12-05 18:00:47 +01:00
2022-12-05 18:00:41 +01:00
2023-11-24 18:50:49 +01:00
2023-10-12 16:44:05 +02:00
2023-08-18 14:38:10 +02:00
2023-06-19 13:59:33 +02:00
2023-10-12 16:44:15 +02:00
2023-10-12 16:44:15 +02:00
2023-11-03 16:39:06 +01:00
2023-11-03 16:39:06 +01:00
2023-10-12 16:44:07 +02:00
2023-08-21 14:54:48 +02:00
2023-12-06 22:32:46 +01:00
2022-12-05 18:00:56 +01:00
2023-10-12 16:44:12 +02:00
2023-06-19 13:59:24 +02:00
2023-10-12 16:44:07 +02:00
2023-05-10 14:51:27 +02:00
2023-02-13 17:50:35 +01:00
2023-10-12 16:44:17 +02:00
2023-10-12 16:44:11 +02:00
2023-10-12 16:44:02 +02:00
2023-12-06 22:32:46 +01:00
2023-11-24 18:50:42 +01:00
2023-01-19 09:24:27 +01:00
2023-10-12 16:44:05 +02:00
2023-10-12 16:44:09 +02:00
2023-09-08 14:10:49 +02:00
2023-02-15 19:38:50 +01:00
2023-04-17 18:01:18 +02:00
2023-06-19 13:59:34 +02:00
2023-10-12 16:44:09 +02:00
2023-10-12 16:44:07 +02:00
2023-10-12 16:44:07 +02:00
2023-08-24 16:20:18 -07:00
2023-12-06 22:32:46 +01:00
2023-10-12 16:44:16 +02:00
2022-12-05 18:00:47 +01:00
2022-12-05 18:00:47 +01:00
2023-10-12 16:44:11 +02:00
2023-06-19 13:59:22 +02:00
2023-10-12 16:44:02 +02:00
2022-12-05 18:00:40 +01:00
2023-12-06 22:32:46 +01:00
2023-12-06 22:32:46 +01:00
2023-08-21 14:54:48 +02:00
2023-08-21 14:52:12 +02:00
2023-11-03 16:38:51 +01:00
2023-10-12 16:44:09 +02:00
2022-12-05 18:00:59 +01:00
2023-11-23 22:27:34 +01:00
2019-04-29 19:02:49 +02:00
2023-10-12 16:44:12 +02:00
2020-03-23 17:01:54 +01:00
2023-10-12 16:44:14 +02:00
2023-10-12 16:44:13 +02:00
2023-10-12 16:44:10 +02:00
2023-10-12 16:44:04 +02:00
2023-11-03 16:40:15 +01:00
2023-04-17 18:01:24 +02:00
2023-11-24 18:50:53 +01:00
2022-12-05 18:00:41 +01:00
2023-10-12 16:44:16 +02:00
2023-10-12 16:44:05 +02:00
2023-06-19 13:59:35 +02:00
2023-06-19 13:59:35 +02:00
2023-11-23 22:27:26 +01:00
2022-12-05 18:00:47 +01:00
2023-10-12 16:44:18 +02:00
2023-02-13 17:50:35 +01:00
2023-11-15 17:08:14 +01:00
2023-10-12 16:44:17 +02:00
2023-11-15 17:08:09 +01:00
2023-06-19 13:59:25 +02:00
2023-10-12 16:44:19 +02:00
2023-06-19 13:59:26 +02:00
2023-06-19 13:59:38 +02:00
2022-12-05 18:00:48 +01:00
2023-10-12 16:44:04 +02:00
2022-12-05 18:00:50 +01:00
2023-10-12 16:44:07 +02:00
2022-12-05 18:00:46 +01:00
2023-10-12 16:44:12 +02:00
2022-12-05 18:00:47 +01:00
2023-11-23 22:27:46 +01:00
2023-10-12 16:44:18 +02:00
2023-10-12 16:44:12 +02:00
2019-04-29 19:02:44 +02:00
2023-06-19 13:59:34 +02:00
2023-11-03 16:38:56 +01:00
2023-08-21 14:52:19 +02:00
2023-10-12 16:44:04 +02:00