Qu Wenruo
88231c0c0b
btrfs: make sure btrfs can handle full fs trim correctly
...
Ancient commit f4c697e6406d ("btrfs: return EINVAL if start >
total_bytes in fitrim ioctl") introduced a regression where btrfs
may fail to trim any free space in existing block groups.
It's caused by confusion with btrfs_super_block->total_bytes and
btrfs logical address space.
Unlike physical address, any aligned bytenr in range [0, U64_MAX) is
valid in btrfs logical address space, and it's chunk mapping
mechanism of btrfs to handle the logical<->physical mapping.
The test case will craft a btrfs with the following features:
0) Single data/meta profile
Make trimmed bytes reporting and chunk allocation more predictable.
1) All chunks start beyond super_block->total_bytes (1G)
By relocating these blocks several times.
2) Unallocated space is less than 50% of the whole fs
3) Fragmented data chunks
Data chunks will be full of fragments, 50% of data chunks will be
free space.
So in theory fstrim should be able to trim over 50% space of the fs.
(after fix, 64% of the fs can be trimmed)
While the regression makes btrfs only able to trim unallocated
space, which is less than 50% of the total space.
(without fix, it's only 31%)
Fixed by patch named "btrfs: Ensure btrfs_trim_fs can trim the whole
fs".
Signed-off-by: Qu Wenruo <wqu@suse.com >
Reviewed-by: Eryu Guan <eguan@redhat.com >
Signed-off-by: Eryu Guan <eguan@redhat.com >
2017-12-01 16:51:00 +08:00
..
2016-02-19 10:44:53 +11:00
2013-08-13 16:16:27 -05:00
2017-02-07 12:15:33 +08:00
2013-08-13 16:16:27 -05:00
2017-04-24 18:01:33 +08:00
2013-08-13 16:16:27 -05:00
2017-04-24 18:01:33 +08:00
2013-08-13 16:16:27 -05:00
2016-02-19 10:44:53 +11:00
2013-08-13 16:16:27 -05:00
2017-01-03 11:41:36 +08:00
2017-01-03 11:41:36 +08:00
2016-02-19 10:49:17 +11:00
2013-08-13 17:17:03 -05:00
2017-03-31 13:09:16 +08:00
2013-08-14 14:54:34 -05:00
2014-01-24 12:06:14 +11:00
2013-08-14 15:42:59 -05:00
2017-10-26 15:00:36 +08:00
2017-06-08 10:53:27 +08:00
2017-02-07 12:15:33 +08:00
2013-08-28 09:05:25 -05:00
2017-02-03 12:48:23 +08:00
2013-10-12 19:30:19 -05:00
2014-12-12 11:26:15 +11:00
2013-10-16 15:14:35 -05:00
2014-01-24 12:06:14 +11:00
2013-10-16 15:21:35 -05:00
2014-12-12 11:26:15 +11:00
2013-10-18 17:26:18 -05:00
2017-03-31 13:09:16 +08:00
2013-10-22 15:54:17 -05:00
2017-01-15 13:56:45 +08:00
2015-12-21 18:01:46 +11:00
2014-12-12 11:26:15 +11:00
2013-10-22 16:07:35 -05:00
2017-03-31 13:09:16 +08:00
2013-10-22 16:28:19 -05:00
2017-03-13 11:59:04 +08:00
2013-10-23 18:57:48 -05:00
2013-11-12 08:05:19 -06:00
2013-11-12 08:05:19 -06:00
2017-02-07 12:15:33 +08:00
2013-12-03 10:29:29 +11:00
2013-12-03 10:29:31 +11:00
2013-12-03 10:29:31 +11:00
2016-04-05 11:46:12 +10:00
2013-12-03 10:29:34 +11:00
2017-03-31 13:09:16 +08:00
2014-02-03 10:06:14 +11:00
2016-02-19 10:49:17 +11:00
2015-12-21 17:03:17 +11:00
2017-06-29 11:14:29 +08:00
2016-05-09 10:58:06 +10:00
2016-12-19 10:34:49 +08:00
2016-06-15 15:55:25 +08:00
2017-09-03 12:20:00 +08:00
2016-01-11 15:05:20 +11:00
2017-03-31 13:09:16 +08:00
2014-01-24 12:04:18 +11:00
2016-02-19 10:49:17 +11:00
2014-01-24 12:06:31 +11:00
2014-02-03 09:50:41 +11:00
2014-02-03 09:50:41 +11:00
2014-02-03 10:05:34 +11:00
2014-02-03 10:05:34 +11:00
2017-03-31 13:09:16 +08:00
2014-02-18 21:18:21 +11:00
2015-10-14 14:19:34 +11:00
2015-10-14 14:19:34 +11:00
2017-03-31 13:09:16 +08:00
2014-02-18 17:50:23 +11:00
2016-02-19 10:49:17 +11:00
2014-02-18 18:04:00 +11:00
2017-03-31 13:09:16 +08:00
2014-02-18 21:18:20 +11:00
2017-03-31 13:09:16 +08:00
2014-02-18 21:18:21 +11:00
2017-03-31 13:09:16 +08:00
2014-02-18 21:18:21 +11:00
2016-02-19 10:49:17 +11:00
2014-03-13 15:18:18 +11:00
2016-12-09 15:55:19 +08:00
2014-03-13 15:20:09 +11:00
2017-03-31 13:09:16 +08:00
2014-04-04 17:16:23 +11:00
2017-03-31 13:09:16 +08:00
2014-04-04 17:16:41 +11:00
2017-03-31 13:09:16 +08:00
2014-04-04 17:17:01 +11:00
2017-03-31 13:09:16 +08:00
2014-04-04 17:20:52 +11:00
2017-01-27 16:06:12 +08:00
2017-01-27 16:06:12 +08:00
2017-03-31 13:09:16 +08:00
2016-07-01 11:17:08 +08:00
2016-02-19 10:49:17 +11:00
2014-05-13 15:29:37 +10:00
2017-03-31 13:09:16 +08:00
2014-05-15 11:37:54 +10:00
2017-03-31 13:09:16 +08:00
2014-05-27 12:07:03 +10:00
2017-01-15 13:56:45 +08:00
2015-12-21 18:01:46 +11:00
2017-03-31 13:09:16 +08:00
2014-05-27 12:07:39 +10:00
2017-03-31 13:09:16 +08:00
2014-05-27 12:07:42 +10:00
2017-01-15 13:56:45 +08:00
2015-12-21 18:01:46 +11:00
2017-01-15 13:56:45 +08:00
2015-12-21 18:01:46 +11:00
2016-02-19 10:49:17 +11:00
2014-08-13 10:59:59 +10:00
2017-03-31 13:09:16 +08:00
2014-08-13 11:20:37 +10:00
2016-12-09 15:54:19 +08:00
2016-03-23 17:39:11 +11:00
2016-03-23 17:39:11 +11:00
2014-10-14 22:59:37 +11:00
2014-10-14 22:59:37 +11:00
2014-10-14 22:59:37 +11:00
2014-10-14 22:59:37 +11:00
2014-10-14 22:59:37 +11:00
2014-10-14 22:59:37 +11:00
2014-10-14 22:59:37 +11:00
2014-10-14 22:59:37 +11:00
2014-10-14 22:59:37 +11:00
2016-03-23 17:39:11 +11:00
2014-10-14 22:59:38 +11:00
2016-03-23 17:39:11 +11:00
2014-10-14 22:59:38 +11:00
2016-03-23 17:39:11 +11:00
2014-10-14 22:59:38 +11:00
2016-03-23 17:39:11 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2014-10-14 22:59:38 +11:00
2016-02-19 10:49:17 +11:00
2014-10-14 22:59:38 +11:00
2017-03-31 13:09:16 +08:00
2014-10-14 22:59:39 +11:00
2016-02-19 10:49:17 +11:00
2014-11-10 13:03:43 +11:00
2017-04-24 18:01:33 +08:00
2014-11-10 13:04:00 +11:00
2016-02-19 10:49:17 +11:00
2014-12-16 10:50:56 +11:00
2016-02-19 10:49:17 +11:00
2014-12-16 10:53:42 +11:00
2015-04-01 11:38:40 +11:00
2015-02-12 14:14:00 +11:00
2017-03-31 13:09:16 +08:00
2015-04-01 11:31:24 +11:00
2017-03-31 13:09:16 +08:00
2015-04-01 11:32:01 +11:00
2017-03-31 13:09:27 +08:00
2015-04-01 11:35:44 +11:00
2016-02-19 10:49:17 +11:00
2015-04-01 11:39:24 +11:00
2017-03-31 13:09:16 +08:00
2015-05-04 22:55:19 +10:00
2016-02-19 10:49:17 +11:00
2015-05-04 22:55:21 +10:00
2016-02-19 10:49:17 +11:00
2015-08-04 14:10:48 +10:00
2015-05-04 22:56:11 +10:00
2015-05-04 22:56:11 +10:00
2016-05-09 10:46:14 +10:00
2015-05-04 22:56:13 +10:00
2017-03-31 13:09:16 +08:00
2015-05-04 22:56:13 +10:00
2016-02-19 10:49:17 +11:00
2015-05-14 20:27:53 +10:00
2017-03-31 13:09:16 +08:00
2015-12-21 18:01:46 +11:00
2017-08-25 13:54:24 +08:00
2015-12-21 18:01:46 +11:00
2017-01-15 13:56:45 +08:00
2015-12-21 18:01:46 +11:00
2017-03-31 13:09:16 +08:00
2015-12-21 18:01:46 +11:00
2017-08-25 13:54:24 +08:00
2015-12-21 18:01:46 +11:00
2016-12-09 15:55:19 +08:00
2015-09-21 13:06:18 +10:00
2016-02-19 10:49:17 +11:00
2015-09-23 12:52:34 +10:00
2016-02-19 10:49:17 +11:00
2015-09-23 12:52:34 +10:00
2016-02-19 10:49:17 +11:00
2015-09-21 13:06:18 +10:00
2017-01-15 13:56:45 +08:00
2015-12-21 18:01:46 +11:00
2016-12-30 14:18:30 +08:00
2015-10-14 14:06:50 +11:00
2017-03-31 13:09:16 +08:00
2015-10-14 14:07:42 +11:00
2016-02-19 10:49:17 +11:00
2015-12-21 18:01:47 +11:00
2016-02-19 10:49:17 +11:00
2015-10-14 14:19:33 +11:00
2017-03-31 13:09:16 +08:00
2015-10-14 14:19:34 +11:00
2017-03-31 13:09:16 +08:00
2015-10-14 14:19:34 +11:00
2017-03-31 13:09:16 +08:00
2015-10-14 14:19:34 +11:00
2017-03-31 13:09:16 +08:00
2015-10-14 14:19:34 +11:00
2016-02-19 10:49:17 +11:00
2015-10-14 14:19:34 +11:00
2016-02-19 10:49:17 +11:00
2015-11-02 11:00:22 +11:00
2016-02-19 10:48:38 +11:00
2015-11-17 08:42:29 +11:00
2015-11-17 08:43:27 +11:00
2015-11-17 08:43:27 +11:00
2016-02-19 10:49:17 +11:00
2016-01-11 15:12:20 +11:00
2017-03-31 13:09:16 +08:00
2016-02-08 09:27:15 +11:00
2017-08-25 13:54:24 +08:00
2016-02-19 10:50:32 +11:00
2017-08-25 13:54:24 +08:00
2016-04-05 11:42:21 +10:00
2017-08-25 13:54:24 +08:00
2016-04-05 11:45:12 +10:00
2016-12-19 10:34:49 +08:00
2016-05-09 10:51:48 +10:00
2016-12-19 10:34:49 +08:00
2016-05-09 10:57:01 +10:00
2016-12-19 10:34:49 +08:00
2016-06-15 16:46:12 +08:00
2017-11-03 19:04:49 +08:00
2016-07-01 23:12:50 +08:00
2017-11-03 19:04:49 +08:00
2016-07-01 23:12:50 +08:00
2016-12-19 10:34:49 +08:00
2016-11-03 10:41:41 +08:00
2017-03-31 13:09:16 +08:00
2016-07-12 18:27:17 +08:00
2017-03-31 13:09:16 +08:00
2016-07-12 18:27:17 +08:00
2017-03-31 13:09:16 +08:00
2016-07-12 18:27:17 +08:00
2016-07-19 12:20:43 +08:00
2016-07-19 12:20:43 +08:00
2016-12-09 15:54:19 +08:00
2016-09-24 00:39:13 +08:00
2016-12-28 19:19:03 +08:00
2016-11-13 14:01:06 +08:00
2017-03-31 13:09:16 +08:00
2017-01-20 20:05:56 +08:00
2017-03-31 13:09:16 +08:00
2017-01-20 20:05:56 +08:00
2017-03-31 13:09:16 +08:00
2017-01-20 20:05:56 +08:00
2017-02-03 12:48:23 +08:00
2017-02-03 12:48:23 +08:00
2017-03-31 13:09:16 +08:00
2017-02-15 18:02:15 +08:00
2017-02-19 07:59:33 +08:00
2017-02-19 07:59:33 +08:00
2017-03-15 18:55:38 +08:00
2017-03-15 18:55:38 +08:00
2017-05-19 15:06:30 +08:00
2017-05-19 15:06:30 +08:00
2017-05-19 15:06:30 +08:00
2017-05-19 15:06:30 +08:00
2017-08-18 13:39:34 +08:00
2017-05-19 15:06:30 +08:00
2017-11-16 17:04:03 +08:00
2017-05-19 15:06:30 +08:00
2017-06-08 13:09:54 +08:00
2017-06-08 13:09:54 +08:00
2017-06-15 13:56:19 +08:00
2017-06-15 13:56:19 +08:00
2017-06-20 20:33:16 +08:00
2017-06-20 20:33:16 +08:00
2017-06-29 11:14:29 +08:00
2017-06-29 11:14:29 +08:00
2017-07-16 19:15:15 +08:00
2017-07-16 19:15:15 +08:00
2017-08-18 13:39:27 +08:00
2017-08-18 13:39:27 +08:00
2017-09-30 00:53:29 +08:00
2017-09-30 00:53:29 +08:00
2017-10-22 19:16:56 +08:00
2017-10-22 19:16:56 +08:00
2017-11-03 19:04:49 +08:00
2017-11-03 19:04:49 +08:00
2017-11-03 19:04:49 +08:00
2017-11-03 19:04:49 +08:00
2017-11-15 14:45:24 +08:00
2017-11-15 14:45:24 +08:00
2017-11-28 15:26:47 +08:00
2017-11-28 15:26:47 +08:00
2017-12-01 16:51:00 +08:00
2017-12-01 16:51:00 +08:00
2017-12-01 16:51:00 +08:00
2016-07-18 16:55:04 +08:00