[Devel] [PATCH hci-8.1 v2 2/3] ext4: discard the balloon on FITRIM
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Wed Nov 11 01:35:39 MSK 2026
> From: Denis V. Lunev <den at openvz.org>
>
> The balloon holds file system space that never carries data, but its
> blocks are allocated, so ext4_trim_all_free() never discards them, and
> inflating the balloon is a plain fallocate() that does not discard
> either. Once the balloon is inflated over blocks that held data, e.g.
> on an online shrink after files were removed, the device below keeps
> them allocated: a ploop or qcow2 image keeps host disk space the
> container can never use, and compaction, which is FITRIM, does not give
> it back.
>
> Walk the balloon after the free space in ext4_trim_fs() and discard its
> unwritten extents that fall into the requested range. The walk goes to
> the end of the extent tree, as fallocate() with FALLOC_FL_KEEP_SIZE can
> leave extents past i_size. Physically adjacent extents are merged into
> [ ... ]
>
> https://virtuozzo.atlassian.net/browse/VSTOR-153590
>
> Feature: fs/ext4: fast online shrink support
> Signed-off-by: Denis V. Lunev <den at openvz.org>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261110222756.3236854-2-den@openvz.org?part=2
More information about the Devel
mailing list