ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/1] ceph: add sysfs entries signifying new mount syntax support
@ 2021-11-03  5:00 Venky Shankar
  2021-11-03  5:00 ` [PATCH v5 1/1] ceph: mount syntax module parameter Venky Shankar
  0 siblings, 1 reply; 4+ messages in thread
From: Venky Shankar @ 2021-11-03  5:00 UTC (permalink / raw)
  To: jlayton, pdonnell, idryomov; +Cc: ceph-devel, Venky Shankar

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(+)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v5 1/1] ceph: mount syntax module parameter
  2021-11-03  5:00 [PATCH v5 0/1] ceph: add sysfs entries signifying new mount syntax support Venky Shankar
@ 2021-11-03  5:00 ` Venky Shankar
  2021-11-03 10:33   ` Jeff Layton
  2021-11-05 10:43   ` Jeff Layton
  0 siblings, 2 replies; 4+ messages in thread
From: Venky Shankar @ 2021-11-03  5:00 UTC (permalink / raw)
  To: jlayton, pdonnell, idryomov; +Cc: ceph-devel, 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 <vshankar@redhat.com>
---
 fs/ceph/super.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 609ffc8c2d78..32e5240e33a0 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -1452,6 +1452,14 @@ bool disable_send_metrics = false;
 module_param_cb(disable_send_metrics, &param_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, &param_ops_mount_syntax, &mount_support, 0444);
+module_param_cb(mount_syntax_v2, &param_ops_mount_syntax, &mount_support, 0444);
+
 module_init(init_ceph);
 module_exit(exit_ceph);
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v5 1/1] ceph: mount syntax module parameter
  2021-11-03  5:00 ` [PATCH v5 1/1] ceph: mount syntax module parameter Venky Shankar
@ 2021-11-03 10:33   ` Jeff Layton
  2021-11-05 10:43   ` Jeff Layton
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Layton @ 2021-11-03 10:33 UTC (permalink / raw)
  To: Venky Shankar, pdonnell, idryomov; +Cc: ceph-devel

On Wed, 2021-11-03 at 10:30 +0530, Venky Shankar wrote:
> 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 <vshankar@redhat.com>
> ---
>  fs/ceph/super.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/fs/ceph/super.c b/fs/ceph/super.c
> index 609ffc8c2d78..32e5240e33a0 100644
> --- a/fs/ceph/super.c
> +++ b/fs/ceph/super.c
> @@ -1452,6 +1452,14 @@ bool disable_send_metrics = false;
>  module_param_cb(disable_send_metrics, &param_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, &param_ops_mount_syntax, &mount_support, 0444);
> +module_param_cb(mount_syntax_v2, &param_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.
-- 
Jeff Layton <jlayton@redhat.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v5 1/1] ceph: mount syntax module parameter
  2021-11-03  5:00 ` [PATCH v5 1/1] ceph: mount syntax module parameter Venky Shankar
  2021-11-03 10:33   ` Jeff Layton
@ 2021-11-05 10:43   ` Jeff Layton
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Layton @ 2021-11-05 10:43 UTC (permalink / raw)
  To: Venky Shankar, pdonnell, idryomov; +Cc: ceph-devel

On Wed, 2021-11-03 at 10:30 +0530, Venky Shankar wrote:
> 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 <vshankar@redhat.com>
> ---
>  fs/ceph/super.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/fs/ceph/super.c b/fs/ceph/super.c
> index 609ffc8c2d78..32e5240e33a0 100644
> --- a/fs/ceph/super.c
> +++ b/fs/ceph/super.c
> @@ -1452,6 +1452,14 @@ bool disable_send_metrics = false;
>  module_param_cb(disable_send_metrics, &param_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,

> +static const struct kernel_param_ops param_ops_mount_syntax = {
> +	.get = param_get_bool,
> +};
> +module_param_cb(mount_syntax_v1, &param_ops_mount_syntax, &mount_support, 0444);
> +module_param_cb(mount_syntax_v2, &param_ops_mount_syntax, &mount_support, 0444);
> +
>  module_init(init_ceph);
>  module_exit(exit_ceph);
>  

-- 
Jeff Layton <jlayton@redhat.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-05 10:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03  5:00 [PATCH v5 0/1] ceph: add sysfs entries signifying new mount syntax support Venky Shankar
2021-11-03  5:00 ` [PATCH v5 1/1] ceph: mount syntax module parameter Venky Shankar
2021-11-03 10:33   ` Jeff Layton
2021-11-05 10:43   ` Jeff Layton

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).