erofs: remove the guard of showing domain_id and fsid
PATCH 1/1 erofs: remove the guard of showing domain_id and fsid
This change fixes an issue where domain_id was not shown when CONFIG_EROFS_FS_PAGE_CACHE_SHARE is enabled, as this configuration is mutually exclusive with CONFIG_EROFS_FS_ONDEMAND.
Both domain_id and fsid fields are present in struct erofs_sb_info regardless of configuration. They are not set if the configurations are not enabled, and remain NULL. Therefore, the conditional guard in erofs_show_options() are unnecessary and can be removed.
--- fs/erofs/super.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
fs/erofs/super.c +4 -6
@@ -1095,12 +1095,10 @@ static int erofs_show_options(struct seq_file *seq, struct dentry *root)seq_puts (seq,",dax=never" );if (erofs_is_fileio_mode (sbi) &&test_opt (opt,DIRECT_IO ))seq_puts (seq,",directio" ); -if (IS_ENABLED (CONFIG_EROFS_FS_ONDEMAND )) { -if (sbi->fsid) -seq_printf (seq,",fsid=%s" , sbi->fsid); -if (sbi->domain_id) -seq_printf (seq,",domain_id=%s" , sbi->domain_id); - } +if (sbi->fsid) +seq_printf (seq,",fsid=%s" , sbi->fsid); +if (sbi->domain_id) +seq_printf (seq,",domain_id=%s" , sbi->domain_id);if (sbi->dif0.fsoff)seq_printf (seq,",fsoffset=%llu" , sbi->dif0.fsoff);if (test_opt (opt,INODE_SHARE ))
Signature · 1 line
2.43.0
Hi Yuezhang,
Quoted 4 lines · Yuezhang Mo
This change fixes an issue where
domain_idwas not shown whenCONFIG_EROFS_FS_PAGE_CACHE_SHAREis enabled, as this configuration is mutually exclusive withCONFIG_EROFS_FS_ONDEMAND.
Quoted 8 lines
Both
domain_idand fsid fields are present in structerofs_sb_inforegardless of configuration. They are not set if the configurations are not enabled, and remain NULL. Therefore, the conditional guard inerofs_show_options()are unnecessary and can be removed.Signed-off-by Yuezhang Mo <[email protected]>Reviewed-by Friendy Su <[email protected]>Reviewed-by Daniel Palmer <[email protected]>
domain_id is a user-sensitive information for the page cache sharing feature (much like passwd), so it shouldn't be shown in the mount option by design, and only the mounter should know what it was set.
Thanks,
Gao Xiang
Quoted 25 lines
--- fs/erofs/super.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)fs/erofs/super.c +4
-6@@ -1095,12 +1095,10 @@ static int erofs_show_options(struct seq_file *seq, struct dentry *root)seq_puts (seq,",dax=never" );if (erofs_is_fileio_mode (sbi) &&test_opt (opt,DIRECT_IO ))seq_puts (seq,",directio" ); -if (IS_ENABLED (CONFIG_EROFS_FS_ONDEMAND )) { -if (sbi->fsid) -seq_printf (seq,",fsid=%s" , sbi->fsid); -if (sbi->domain_id) -seq_printf (seq,",domain_id=%s" , sbi->domain_id); - } +if (sbi->fsid) +seq_printf (seq,",fsid=%s" , sbi->fsid); +if (sbi->domain_id) +seq_printf (seq,",domain_id=%s" , sbi->domain_id);if (sbi->dif0.fsoff)seq_printf (seq,",fsoffset=%llu" , sbi->dif0.fsoff);if (test_opt (opt,INODE_SHARE ))
Quoted 10 lines · Yuezhang Mo
Quoted 9 lines
This change fixes an issue where
domain_idwas not shown whenCONFIG_EROFS_FS_PAGE_CACHE_SHAREis enabled, as this configuration is mutually exclusive withCONFIG_EROFS_FS_ONDEMAND.Both
domain_idand fsid fields are present in structerofs_sb_inforegardless of configuration. They are not set if the configurations are not enabled, and remain NULL. Therefore, the conditional guard inerofs_show_options()are unnecessary and can be removed.
Quoted 8 lines
Quoted 3 lines
Signed-off-by Yuezhang Mo <[email protected]>Reviewed-by Friendy Su <[email protected]>Reviewed-by Daniel Palmer <[email protected]>
domain_idis a user-sensitive information for the page cache sharing feature (much like passwd), so it shouldn't be shown in the mount option by design, and only the mounter should know what it was set.
Oh, this is part of the design, not a bug. Thank you for your explanation.
Quoted 14 lines · On 2026/3/30 16:48, [email protected] wrote:
Quoted 14 lines · Yuezhang Mo
Quoted 12 lines
This change fixes an issue where
domain_idwas not shown whenCONFIG_EROFS_FS_PAGE_CACHE_SHAREis enabled, as this configuration is mutually exclusive withCONFIG_EROFS_FS_ONDEMAND.Both
domain_idand fsid fields are present in structerofs_sb_inforegardless of configuration. They are not set if the configurations are not enabled, and remain NULL. Therefore, the conditional guard inerofs_show_options()are unnecessary and can be removed.Signed-off-by Yuezhang Mo <[email protected]>Reviewed-by Friendy Su <[email protected]>Reviewed-by Daniel Palmer <[email protected]>
Quoted 6 lines
Quoted 4 lines
domain_idis a user-sensitive information for the page cache sharing feature (much like passwd), so it shouldn't be shown in the mount option by design, and only the mounter should know what it was set.Oh, this is part of the design, not a bug. Thank you for your explanation.
Yes, if you need that information in the follow-up steps, you should keep somewhere in the userspace: but the proper permission is needed (e.g. like /etc/shadow).
Thanks,
Gao Xiang
Hi Yuezhang
Quoted 24 lines · Yuezhang Mo
This change fixes an issue where
domain_idwas not shown whenCONFIG_EROFS_FS_PAGE_CACHE_SHAREis enabled, as this configuration is mutually exclusive withCONFIG_EROFS_FS_ONDEMAND.Both
domain_idand fsid fields are present in structerofs_sb_inforegardless of configuration. They are not set if the configurations are not enabled, and remain NULL. Therefore, the conditional guard inerofs_show_options()are unnecessary and can be removed.Signed-off-by Yuezhang Mo <[email protected]>Reviewed-by Friendy Su <[email protected]>Reviewed-by Daniel Palmer <[email protected]>--- fs/erofs/super.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)fs/erofs/super.c +0
-0@@ -1095,12 +1095,10 @@ static int erofs_show_options(struct seq_file *seq, struct dentry *root)seq_puts (seq,",dax=never" );if (erofs_is_fileio_mode (sbi) &&test_opt (opt,DIRECT_IO ))seq_puts (seq,",directio" );
fs/erofs/super.c static int erofs_show_options(struct seq_file *seq, struct dentry *root) · line 1101
Quoted 10 lines
fs/erofs/super.c +4
-6-if (IS_ENABLED (CONFIG_EROFS_FS_ONDEMAND )) { -if (sbi->fsid) -seq_printf (seq,",fsid=%s" , sbi->fsid); -if (sbi->domain_id) -seq_printf (seq,",domain_id=%s" , sbi->domain_id); - } +if (sbi->fsid) +seq_printf (seq,",fsid=%s" , sbi->fsid); +if (sbi->domain_id) +seq_printf (seq,",domain_id=%s" , sbi->domain_id);
The domain_id in CONFIG_EROFS_FS_PAGE_CACHE_SHARE case means the trusted domain. We cannot show it to user.
Thanks,
Hongbo
Quoted 3 lines
fs/erofs/super.c +0
-0if (sbi->dif0.fsoff)seq_printf (seq,",fsoffset=%llu" , sbi->dif0.fsoff);if (test_opt (opt,INODE_SHARE ))