]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mount: accept monitor host (`mon_host`) mount option
authorVenky Shankar <vshankar@redhat.com>
Mon, 3 May 2021 10:30:34 +0000 (06:30 -0400)
committerVenky Shankar <vshankar@redhat.com>
Tue, 30 Nov 2021 06:13:34 +0000 (01:13 -0500)
With new mount device syntax monitor host(s) can be passed
during mount as option parameter. This option is not mandatory
as it can be fetched from the cluster configuration file if
available.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
src/mount/mount.ceph.c

index af3e4389fbf6bb5d0ec61c86a830498dcf54b828..061d51071902df300eac1f8bfbc907fe0a081fcf 100644 (file)
@@ -327,6 +327,15 @@ static int parse_options(const char *data, struct ceph_mount_info *cmi)
                        /* Only legacy ms_mode needs v1 addrs */
                        v2_addrs = strcmp(value, "legacy");
                        skip = false;
+               } else if (strcmp(data, "mon_host") == 0) {
+                       /* monitor address to use for mounting */
+                       if (!value || !*value) {
+                               fprintf(stderr, "mount option mon_host requires a value.\n");
+                               return -EINVAL;
+                       }
+                       cmi->cmi_mons = strdup(value);
+                       if (!cmi->cmi_mons)
+                               return -ENOMEM;
                } else {
                        /* unrecognized mount options, passing to kernel */
                        skip = false;