Re: [f2fs-dev] [PATCH v2] f2fs: support dynamic include/exclude for device aliasing

From: Eric Biggers

Date: Fri Jun 05 2026 - 18:12:56 EST


On Fri, Jun 05, 2026 at 02:25:04PM -0700, Daeho Jeong wrote:
> - F2FS_IOC_EXCLUDE_DEV_ALIAS: This reclaims the space occupied by a
> device aliasing file. It first performs a capacity check, resets GC
> victim information for the target range, marks the segments as in-use
> to prevent new allocations, and then triggers GC to migrate existing
> valid data out of the range. Finally, it reserves these blocks in the
> SIT to effectively exclude the device from the usable capacity.

Does this do anything to zeroize the device so that random data isn't
leaked in it, or is that the responsibility of the userspace code that
reallocates the device to something?

> @@ -2214,7 +2231,8 @@ static const struct {
> FS_INLINE_DATA_FL | \
> FS_NOCOW_FL | \
> FS_VERITY_FL | \
> - FS_CASEFOLD_FL)
> + FS_CASEFOLD_FL | \
> + F2FS_DEVICE_ALIAS_FL)

This is extending FS_IOC_GETFLAGS, which you probably don't really want
to be doing, right?

- Eric