Re: [PATCH 0/2] f2fs: fix device alias state across remount

From: Daeho Jeong

Date: Wed Aug 26 2026 - 14:10:27 EST


On Wed, Aug 26, 2026 at 10:10 AM Wenjie Qi <qwjhust@xxxxxxxxx> wrote:
>
> Hi Daeho,
>
> The f2fs-tools companion patch was sent separately. It populates
> dev_alias_ino[] when mkfs assigns the alias inodes, before calculating
> the superblock checksum, so a filesystem created with the updated tools
> has the mapping on its first mount.
>
> Current mkfs.f2fs accepts an arbitrary slash-free alias_filename.
> Enforcing basename equality will prevent new custom aliases, but it does
> not handle existing filesystems: after release and remount, reserve
> cannot identify a custom-named alias, and has_alias is not restored for
> pinned allocation.
>
> The added superblock commit is needed only when the mapping is first
> recorded, and the release ioctl already ends with a synchronous
> checkpoint.
>
> Should existing filesystems created with custom alias filenames remain
> supported? If so, a tools-only restriction does not seem sufficient.
>

Thanks for the clarification.

However, I don't think we need to modify the on-disk superblock format for this:

1. Custom alias filenames with dynamic reserve/release have never
worked properly from the beginning (as you noted, reserve and remount
with has_alias were already broken upon the introduction).
Since it was never a functioning feature in the wild, enforcing the
name alignment in mkfs.f2fs does not break any existing working
setups.

2. In real-world production environments (such as Android), the
partition name and alias filename are already configured identically
via /dev/block/by-name/ symlinks (e.g., -c
/dev/block/by-name/foo@foo).

3. If someone really wants a specific alias filename, they can simply
point to an appropriately named device node or symlink (e.g.,
/dev/block/by-name/my_alias@).

Modifying the on-disk superblock layout and performing runtime
superblock writes (f2fs_commit_super()) in ioctl paths introduce
permanent architectural baggage and complexity to the kernel, just to
support a corner case that was broken since its inception and can be
cleanly prevented at format time.

Thanks,

> Thanks,
> Wenjie