linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: yangerkun <yangerkun@huawei.com>
Cc: akpm@linux-foundation.org, jack@suse.cz,
	gregkh@linuxfoundation.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, yukuai3@huawei.com
Subject: Re: [PATCH] ramfs: fix mount source show for ramfs
Date: Fri, 24 Sep 2021 04:35:06 +0000	[thread overview]
Message-ID: <YU1VegG/+AHwHaom@zeniv-ca.linux.org.uk> (raw)
In-Reply-To: <20210811122811.2288041-1-yangerkun@huawei.com>

On Wed, Aug 11, 2021 at 08:28:11PM +0800, yangerkun wrote:
> ramfs_parse_param does not parse key "source", and will convert
> -ENOPARAM to 0. This will skip vfs_parse_fs_param_source in
> vfs_parse_fs_param, which lead always "none" mount source for ramfs. Fix
> it by parse "source" in ramfs_parse_param.
> 
> Signed-off-by: yangerkun <yangerkun@huawei.com>
> ---
>  fs/ramfs/inode.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
> index 65e7e56005b8..0d7f5f655fd8 100644
> --- a/fs/ramfs/inode.c
> +++ b/fs/ramfs/inode.c
> @@ -202,6 +202,10 @@ static int ramfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
>  	struct ramfs_fs_info *fsi = fc->s_fs_info;
>  	int opt;
>  
> +	opt = vfs_parse_fs_param_source(fc, param);
> +	if (opt != -ENOPARAM)
> +		return opt;
> +
>  	opt = fs_parse(fc, ramfs_fs_parameters, param, &result);
>  	if (opt < 0) {
>  		/*

	Umm...  If anything, I would rather call that thing *after*
fs_parse() gives negative, similar to what kernel/cgroup/cgroup-v1.c
does.


  parent reply	other threads:[~2021-09-24  4:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 12:28 [PATCH] ramfs: fix mount source show for ramfs yangerkun
2021-09-08  8:56 ` yangerkun
2021-09-08 22:39   ` Andrew Morton
2021-09-09  8:37     ` yangerkun
2021-09-13  1:10       ` yangerkun
2021-09-18  7:08         ` yangerkun
2021-09-23  6:07           ` yangerkun
2021-09-24  4:35 ` Al Viro [this message]
2021-09-24  7:53   ` yangerkun

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=YU1VegG/+AHwHaom@zeniv-ca.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=yangerkun@huawei.com \
    --cc=yukuai3@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).