Skip to contentSkip to conversation

ramfs: fix mount source show for ramfs

PATCH Superseded yangerkun 3 participants 9 messages Aug 11, 2021 – Sep 24, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

yangerkun

author
#0 lore raw

PATCH 1/1 ramfs: fix mount source show for ramfs

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.

---
 fs/ramfs/inode.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/ramfs/inode.c +4 -0
index 65e7e56005b8..0d7f5f655fd8 100644
@@ -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) {
 		/*
Signature · 1 line
2.31.1
author
#1 lore raw

Hi, this patch seems still leave in linux-next, should we pull it to mainline?

Quoted 26 lines · yangerkun

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.

---
  fs/ramfs/inode.c | 4 ++++
  1 file changed, 4 insertions(+)
fs/ramfs/inode.c +4 -0
index 65e7e56005b8..0d7f5f655fd8 100644
@@ -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) {
  		/*
maintainer
#2 lore raw
Quoted 19 lines · On Wed, 8 Sep 2021 16:56:25 +0800 yangerkun <[email protected]> wrote:
Quoted 18 lines · yangerkun

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.

---
  fs/ramfs/inode.c | 4 ++++
  1 file changed, 4 insertions(+)
fs/ramfs/inode.c +0 -0
index 65e7e56005b8..0d7f5f655fd8 100644
@@ -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;
 
Quoted 8 lines

fs/ramfs/inode.c static int ramfs_parse_param(struct fs_context *fc, struct fs_parameter *param) · line 211

Quoted 8 lines
fs/ramfs/inode.c +4 -0
+	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) {
  		/*

(top-posting repaired)

Quoted 2 lines

Hi, this patch seems still leave in linux-next, should we pull it to mainline?

I was hoping for a comment from Al?

author
#3 lore raw
Quoted 32 lines · Andrew Morton
Quoted 19 lines · On Wed, 8 Sep 2021 16:56:25 +0800 yangerkun <[email protected]> wrote:
Quoted 18 lines · yangerkun

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.

---
   fs/ramfs/inode.c | 4 ++++
   1 file changed, 4 insertions(+)
fs/ramfs/inode.c +0 -0
index 65e7e56005b8..0d7f5f655fd8 100644
@@ -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;
 
Quoted 8 lines

fs/ramfs/inode.c static int ramfs_parse_param(struct fs_context *fc, struct fs_parameter *param) · line 211

Quoted 8 lines
fs/ramfs/inode.c +4 -0
+	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) {
   		/*

(top-posting repaired)

Quoted 4 lines
Quoted 2 lines

Hi, this patch seems still leave in linux-next, should we pull it to mainline?

I was hoping for a comment from Al?

Hi, Al,

Can you help to review this patch...

Thanks,
Kun.

Quoted 2 lines

.

author
#4 lore raw
Quoted 35 lines · yangerkun
Quoted 32 lines · Andrew Morton
Quoted 11 lines · On Wed, 8 Sep 2021 16:56:25 +0800 yangerkun <[email protected]> wrote:
Quoted 10 lines · yangerkun

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.

---
   fs/ramfs/inode.c | 4 ++++

   1 file changed, 4 insertions(+)
Quoted 16 lines
Quoted 6 lines
fs/ramfs/inode.c +0 -0
index 65e7e56005b8..0d7f5f655fd8 100644

fs/ramfs/inode.c static int ramfs_parse_param(struct fs_context · line 211

Quoted 10 lines
fs/ramfs/inode.c +4 -0
@@ -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) {
            /*

(top-posting repaired)

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Hi, this patch seems still leave in linux-next, should we pull it to mainline?

I was hoping for a comment from Al?

Hi, Al,

Can you help to review this patch...

Hi, Al,

Sorry for the noise again, can you help to give some comments for this patch.

Quoted 7 lines

Thanks,
Kun.

Quoted 2 lines

.

.

author
#5 lore raw

Ping...

Quoted 59 lines · yangerkun
Quoted 35 lines · yangerkun
Quoted 32 lines · Andrew Morton
Quoted 11 lines · On Wed, 8 Sep 2021 16:56:25 +0800 yangerkun <[email protected]> wrote:
Quoted 10 lines · yangerkun

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.

---
   fs/ramfs/inode.c | 4 ++++

   1 file changed, 4 insertions(+)
Quoted 16 lines
Quoted 6 lines
fs/ramfs/inode.c +0 -0
index 65e7e56005b8..0d7f5f655fd8 100644

fs/ramfs/inode.c static int ramfs_parse_param(struct fs_context · line 211

Quoted 10 lines
fs/ramfs/inode.c +4 -0
@@ -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) {
            /*

(top-posting repaired)

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Hi, this patch seems still leave in linux-next, should we pull it to mainline?

I was hoping for a comment from Al?

Hi, Al,

Can you help to review this patch...

Hi, Al,

Sorry for the noise again, can you help to give some comments for this patch.

Quoted 7 lines

Thanks,
Kun.

Quoted 2 lines

.

.

.

author
#6 lore raw

Ping again...

Quoted 63 lines · yangerkun

Ping...

Quoted 52 lines · yangerkun
Quoted 35 lines · yangerkun
Quoted 32 lines · Andrew Morton
Quoted 11 lines · On Wed, 8 Sep 2021 16:56:25 +0800 yangerkun <[email protected]> wrote:
Quoted 10 lines · yangerkun

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.

---
   fs/ramfs/inode.c | 4 ++++

   1 file changed, 4 insertions(+)
Quoted 16 lines
Quoted 6 lines
fs/ramfs/inode.c +0 -0
index 65e7e56005b8..0d7f5f655fd8 100644

fs/ramfs/inode.c static int ramfs_parse_param(struct · line 211

Quoted 10 lines
fs/ramfs/inode.c +4 -0
@@ -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) {
            /*

(top-posting repaired)

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Hi, this patch seems still leave in linux-next, should we pull it to mainline?

I was hoping for a comment from Al?

Hi, Al,

Can you help to review this patch...

Hi, Al,

Sorry for the noise again, can you help to give some comments for this patch.

Quoted 1 line
Quoted 7 lines
Quoted 6 lines

Thanks,
Kun.

Quoted 2 lines

.

.

.

.

maintainer
#7 lore raw
In reply to yangerkun
Quoted 15 lines · yangerkun

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.

---
 fs/ramfs/inode.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/ramfs/inode.c +0 -0
index 65e7e56005b8..0d7f5f655fd8 100644

fs/ramfs/inode.c static int ramfs_parse_param(struct fs_context *fc, struct fs_parameter *param) · line 211

Quoted 10 lines
fs/ramfs/inode.c +4 -0
@@ -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.

author
#8 lore raw
Quoted 19 lines · Al Viro
Quoted 18 lines · yangerkun

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.

---
  fs/ramfs/inode.c | 4 ++++
  1 file changed, 4 insertions(+)
fs/ramfs/inode.c +0 -0
index 65e7e56005b8..0d7f5f655fd8 100644
@@ -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;
 
Quoted 11 lines

fs/ramfs/inode.c static int ramfs_parse_param(struct fs_context *fc, struct fs_parameter *param) · line 211

Quoted 7 lines
fs/ramfs/inode.c +4 -0
+	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.

Quoted 2 lines

.