在 2021/9/24 12:35, Al Viro 写道:
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@xxxxxxxxxx>
---
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.
Thanks for your advise. Will do it next version.
.