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

From: Daeho Jeong

Date: Wed Aug 26 2026 - 12:50:04 EST


On Wed, Aug 26, 2026 at 8:42 AM Wenjie Qi <qwjhust@xxxxxxxxx> wrote:
>
> Split device-alias remount handling into two changes. The first records a
> stable device-to-inode mapping so a custom alias name can be reserved again
> after release and remount. The second uses that mapping to keep released
> alias devices out of pinned allocation, both immediately and after remount.
>
> The f2fs-tools layout and mkfs update will be sent separately because it
> applies to a different repository.
>
> Wenjie Qi (2):
> f2fs: persist device alias inode across remount
> f2fs: keep released alias devices out of pinned allocation

Hi Wenjie,

Thanks for pointing out this issue and for the patch series.

However, there are several concerns with the proposed approach:

1. Fresh mount issue:
Since mkfs.f2fs does not populate dev_alias_ino in the superblock, on
the very first mount right after format with a custom alias name,
f2fs_restore_device_alias() will still fall back to the basename
lookup, fail to find the alias file, and leave FDEV(i).has_alias unset
until a release ioctl is explicitly called at runtime.

2. Superblock updates during runtime ioctl:
Writing and committing the superblock (f2fs_commit_super()) during the
runtime release ioctl path adds unnecessary complexity and overhead to
regular filesystem operations.

3. On-disk format change and kernel complexity:
Modifying the on-disk superblock reserved area and introducing
validation logic in the kernel adds notable complexity to resolve a
name-mismatch issue that can be prevented at format time.

The original design intent of device aliasing was to map a device to
an alias file that shares the exact same name as the device basename
(for example, /dev/block/by-name/userdata_exp mapped to userdata_exp).
Rather than changing the on-disk format and kernel runtime paths, the
cleaner and more fundamental fix is to enforce that the alias filename
matches the device basename in mkfs.f2fs.
In addition, we can allow the `-c <device_path>@` syntax in mkfs.f2fs
so that users don't need to specify the filename redundantly.
I will prepare and submit a patch for f2fs-tools to enforce this alignment.

Thanks,

>
> fs/f2fs/file.c | 100 ++++++++++++++++++++++++++++++++++------
> fs/f2fs/super.c | 48 +++++++++++++++++++
> include/linux/f2fs_fs.h | 3 +-
> 3 files changed, 136 insertions(+), 15 deletions(-)
>
> --
> 2.43.0
>
>
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel