Filipe Manana
2c4741d1b0
btrfs: fix unexpected error path when reflinking an inline extent
...
[ Upstream commit 1f4613cdbe ]
When reflinking an inline extent, we assert that its file offset is 0 and
that its uncompressed length is not greater than the sector size. We then
return an error if one of those conditions is not satisfied. However we
use a return statement, which results in returning from btrfs_clone()
without freeing the path and buffer that were allocated before, as well as
not clearing the flag BTRFS_INODE_NO_DELALLOC_FLUSH for the destination
inode.
Fix that by jumping to the 'out' label instead, and also add a WARN_ON()
for each condition so that in case assertions are disabled, we get to
known which of the unexpected conditions triggered the error.
Fixes: a61e1e0df9 ("Btrfs: simplify inline extent handling when doing reflinks")
Signed-off-by: Filipe Manana <fdmanana@suse.com >
Signed-off-by: David Sterba <dsterba@suse.com >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2022-04-08 14:40:04 +02:00
..
2020-11-13 22:15:59 +01:00
2019-04-29 19:02:44 +02:00
2021-11-26 10:39:20 +01:00
2020-03-23 17:01:51 +01:00
2022-01-27 10:54:19 +01:00
2021-03-04 11:38:29 +01:00
2021-03-09 11:11:11 +01:00
2021-03-09 11:11:11 +01:00
2020-11-05 13:02:05 +01:00
2020-03-23 17:01:55 +01:00
2021-09-03 10:09:28 +02:00
2020-07-27 12:55:21 +02:00
2020-03-23 17:01:39 +01:00
2021-08-04 12:46:39 +02:00
2020-10-07 12:06:55 +02:00
2022-01-27 10:54:27 +01:00
2021-03-09 11:11:11 +01:00
2020-10-07 12:06:52 +02:00
2020-07-27 12:55:36 +02:00
2021-07-14 16:55:55 +02:00
2020-03-23 17:01:53 +01:00
2021-03-04 11:38:30 +01:00
2021-03-04 11:38:30 +01:00
2021-01-17 14:16:54 +01:00
2019-11-18 12:46:52 +01:00
2019-04-29 19:02:50 +02:00
2021-01-19 18:27:24 +01:00
2020-04-20 17:43:42 +02:00
2021-12-22 09:30:57 +01:00
2020-10-26 15:04:57 +01:00
2020-05-25 11:25:37 +02:00
2020-03-23 17:01:42 +01:00
2021-12-14 11:32:38 +01:00
2020-10-07 12:13:25 +02:00
2020-02-12 17:16:46 +01:00
2019-11-18 23:43:44 +01:00
2020-10-07 12:13:25 +02:00
2021-10-20 11:44:59 +02:00
2021-10-09 14:40:56 +02:00
2021-10-20 11:44:59 +02:00
2021-03-09 11:11:11 +01:00
2020-07-27 12:55:21 +02:00
2021-02-03 23:28:40 +01:00
2019-11-18 17:51:51 +01:00
2019-09-09 14:59:16 +02:00
2020-07-27 12:55:36 +02:00
2018-04-12 16:29:46 +02:00
2022-01-27 10:54:27 +01:00
2022-02-01 17:25:48 +01:00
2021-07-14 16:55:56 +02:00
2020-10-07 12:12:16 +02:00
2020-10-07 12:12:17 +02:00
2019-11-18 12:46:59 +01:00
2020-03-23 17:01:54 +01:00
2020-05-25 11:25:19 +02:00
2020-10-07 12:13:22 +02:00
2020-10-07 12:13:22 +02:00
2018-04-12 16:29:51 +02:00
2021-01-27 11:55:06 +01:00
2021-01-27 11:55:06 +01:00
2020-05-25 11:25:37 +02:00
2019-04-29 19:02:54 +02:00
2022-03-08 19:09:38 +01:00
2021-03-11 14:17:22 +01:00
2021-09-30 10:11:04 +02:00
2019-07-01 13:34:58 +02:00
2020-03-23 17:01:53 +01:00
2020-10-26 15:03:59 +01:00
2020-11-05 13:03:39 +01:00
2019-04-29 19:02:49 +02:00
2022-04-08 14:40:04 +02:00
2020-03-23 17:01:54 +01:00
2021-05-11 14:47:22 +02:00
2021-12-14 11:32:38 +01:00
2021-03-09 11:11:11 +01:00
2022-02-23 12:00:58 +01:00
2020-10-07 12:13:17 +02:00
2021-09-30 10:11:00 +02:00
2021-03-04 11:38:30 +01:00
2020-10-07 12:13:23 +02:00
2021-01-19 18:27:24 +01:00
2021-07-14 16:55:55 +02:00
2020-10-07 12:12:21 +02:00
2021-07-14 16:55:40 +02:00
2021-09-03 10:09:28 +02:00
2022-03-02 11:42:45 +01:00
2019-04-29 19:02:39 +02:00
2020-07-27 12:55:28 +02:00
2022-03-08 19:09:38 +01:00
2020-10-07 12:06:56 +02:00
2018-04-12 16:29:51 +02:00
2018-04-12 16:29:46 +02:00
2020-05-25 11:25:36 +02:00
2021-11-26 10:39:22 +01:00
2021-02-03 23:28:40 +01:00
2021-03-09 11:11:12 +01:00
2019-04-29 19:02:44 +02:00
2020-01-31 10:30:40 -08:00
2019-11-18 12:46:59 +01:00