Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Hongbo Li <lihongbo22@huawei.com>
To: <linux-erofs@lists.ozlabs.org>
Subject: Re: [PATCH] erofs: use more informative s_id for file-backed mounts
Date: Tue, 30 Jun 2026 12:22:47 +0800	[thread overview]
Message-ID: <f3729d34-c160-46e6-adb1-e02b87165514@huawei.com> (raw)
In-Reply-To: <20260630031813.3992408-1-hsiangkao@linux.alibaba.com>



On 2026/6/30 11:18, Gao Xiang wrote:
> For file-backed mounts, set sb->s_id to the MAJOR:MINOR of sb->s_dev
> (which fstat() will return) so that kernel messages and the sysfs
> name are more informative rather than just "erofs: (device erofs): ...".
> 
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Reviewed-by: Hongbo Li <lihongbo22@huawei.com>

Thanks,
Hongbo

> ---
>   fs/erofs/super.c | 17 ++++-------------
>   1 file changed, 4 insertions(+), 13 deletions(-)
> 
> diff --git a/fs/erofs/super.c b/fs/erofs/super.c
> index 86fa5c6a0c70..c5881bb8d52b 100644
> --- a/fs/erofs/super.c
> +++ b/fs/erofs/super.c
> @@ -595,17 +595,6 @@ static const struct export_operations erofs_export_ops = {
>   	.get_parent = erofs_get_parent,
>   };
>   
> -static void erofs_set_sysfs_name(struct super_block *sb)
> -{
> -	struct erofs_sb_info *sbi = EROFS_SB(sb);
> -
> -	if (erofs_is_fileio_mode(sbi))
> -		super_set_sysfs_name_generic(sb, "%s",
> -					     bdi_dev_name(sb->s_bdi));
> -	else
> -		super_set_sysfs_name_id(sb);
> -}
> -
>   static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
>   {
>   	struct inode *inode;
> @@ -657,12 +646,14 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
>   		err = super_setup_bdi(sb);
>   		if (err)
>   			return err;
> +
> +		snprintf(sb->s_id, sizeof(sb->s_id),
> +			 "%u:%u", MAJOR(sb->s_dev), MINOR(sb->s_dev));
>   	} else {
>   		if (!sb_set_blocksize(sb, PAGE_SIZE)) {
>   			errorfc(fc, "failed to set initial blksize");
>   			return -EINVAL;
>   		}
> -
>   		sbi->dif0.dax_dev = fs_dax_get_by_bdev(sb->s_bdev,
>   				&sbi->dif0.dax_part_off, NULL, NULL);
>   	}
> @@ -740,7 +731,7 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
>   	if (err)
>   		return err;
>   
> -	erofs_set_sysfs_name(sb);
> +	super_set_sysfs_name_id(sb);
>   	err = erofs_register_sysfs(sb);
>   	if (err)
>   		return err;


      reply	other threads:[~2026-06-30  4:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30  3:18 [PATCH] erofs: use more informative s_id for file-backed mounts Gao Xiang
2026-06-30  4:22 ` Hongbo Li [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f3729d34-c160-46e6-adb1-e02b87165514@huawei.com \
    --to=lihongbo22@huawei.com \
    --cc=linux-erofs@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox