ceph: add sysfs entries signifying new mount syntax support
v5 cover ceph: add sysfs entries signifying new mount syntax support
v5:
- switch to sysfs instead of debugfs
[This is based on top of new mount syntax series]
Patrick/Ilya proposed the idea of having sysfs entries to signify if kernel supports the new (v2) mount syntax. The primary use of this information is to catch any bugs in the new syntax implementation.
This would be done as follows::
The userspace mount helper tries to mount using the new mount syntax and fallsback to using old syntax if the mount using new syntax fails. However, a bug in the new mount syntax implementation can silently result in the mount helper switching to old syntax.
So, the sysfs entries can be relied upon by the mount helper to check if the kernel supports the new mount syntax. Cases when the mount using the new syntax fails, but the kernel does support the new mount syntax, the mount helper could probably log before switching to the old syntax (or fail the mount altogether when run in test mode).
sysfs entries are as follows::
/sys/module/ceph/parameters/
....
....
/sys/module/ceph/parameters/mount_syntax_v2
/sys/module/ceph/parameters/mount_syntax_v1
....
....Venky Shankar (1):
ceph: mount syntax module parameter
fs/ceph/super.c | 8 ++++++++ 1 file changed, 8 insertions(+)
Signature · 1 line
2.27.0
PATCH v5 1/1 ceph: mount syntax module parameter
Add read-only paramaters for supported mount syntaxes. Primary user is the user-space mount helper for catching v2 syntax bugs during testing by cross verifying if the kernel supports v2 syntax on mount failure.
--- fs/ceph/super.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/ceph/super.c +8 -0
@@ -1452,6 +1452,14 @@ bool disable_send_metrics = false;module_param_cb (disable_send_metrics, ¶m_ops_metrics, &disable_send_metrics,0644 );MODULE_PARM_DESC (disable_send_metrics,"Enable sending perf metrics to ceph cluster (default: on)" ); +/* for both v1 and v2 syntax */ +bool mount_support = true; +static const struct kernel_param_ops param_ops_mount_syntax = { + .get = param_get_bool, +}; +module_param_cb (mount_syntax_v1, ¶m_ops_mount_syntax, &mount_support,0444 ); +module_param_cb (mount_syntax_v2, ¶m_ops_mount_syntax, &mount_support,0444 ); +module_init (init_ceph);module_exit (exit_ceph);
Signature · 1 line
2.27.0
Re: [PATCH v5 1/1] ceph: mount syntax module parameter
Quoted 19 lines · Venky Shankar
Add read-only paramaters for supported mount syntaxes. Primary user is the user-space mount helper for catching v2 syntax bugs during testing by cross verifying if the kernel supports v2 syntax on mount failure.
Signed-off-by Venky Shankar <[email protected]>--- fs/ceph/super.c | 8 ++++++++ 1 file changed, 8 insertions(+)fs/ceph/super.c +1
-0@@ -1452,6 +1452,14 @@ bool disable_send_metrics = false;module_param_cb (disable_send_metrics, ¶m_ops_metrics, &disable_send_metrics,0644 );MODULE_PARM_DESC (disable_send_metrics,"Enable sending perf metrics to ceph cluster (default: on)" ); +/* for both v1 and v2 syntax */
fs/ceph/super.c bool disable_send_metrics = false; · line 1465
Quoted 10 lines
fs/ceph/super.c +7
-0+bool mount_support = true; +static const struct kernel_param_ops param_ops_mount_syntax = { + .get = param_get_bool, +}; +module_param_cb (mount_syntax_v1, ¶m_ops_mount_syntax, &mount_support,0444 ); +module_param_cb (mount_syntax_v2, ¶m_ops_mount_syntax, &mount_support,0444 ); +module_init (init_ceph);module_exit (exit_ceph);
Thanks Venky. This looks good. Merged into testing.
Note that these new parameters are not visible via modinfo, but they do show up in /sys/module/ceph/parameters.
Signature · 1 line
Jeff Layton <[email protected]>
Re: [PATCH v5 1/1] ceph: mount syntax module parameter
In reply to Venky ShankarQuoted 15 lines · Venky Shankar
Add read-only paramaters for supported mount syntaxes. Primary user is the user-space mount helper for catching v2 syntax bugs during testing by cross verifying if the kernel supports v2 syntax on mount failure.
Signed-off-by Venky Shankar <[email protected]>--- fs/ceph/super.c | 8 ++++++++ 1 file changed, 8 insertions(+)fs/ceph/super.c +0
-0
fs/ceph/super.c bool disable_send_metrics = false; · line 1456
Quoted 5 lines
fs/ceph/super.c +2
-0@@ -1452,6 +1452,14 @@ bool disable_send_metrics = false;module_param_cb (disable_send_metrics, ¶m_ops_metrics, &disable_send_metrics,0644 );MODULE_PARM_DESC (disable_send_metrics,"Enable sending perf metrics to ceph cluster (default: on)" ); +/* for both v1 and v2 syntax */ +bool mount_support = true;
This bool should be static too. I'll just make that change in-tree, so you don't need to re-post.
Thanks,
Quoted 9 lines
fs/ceph/super.c +6
-0+static const struct kernel_param_ops param_ops_mount_syntax = { + .get = param_get_bool, +}; +module_param_cb (mount_syntax_v1, ¶m_ops_mount_syntax, &mount_support,0444 ); +module_param_cb (mount_syntax_v2, ¶m_ops_mount_syntax, &mount_support,0444 ); +module_init (init_ceph);module_exit (exit_ceph);
Signature · 1 line
Jeff Layton <[email protected]>