From f47b7bcbf83d78164d304cf8e1b19fbc0cb06bb6 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Mon, 3 May 2021 06:30:34 -0400 Subject: [PATCH] mount: accept monitor host (`mon_host`) mount option 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 --- src/mount/mount.ceph.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mount/mount.ceph.c b/src/mount/mount.ceph.c index af3e4389fbf6b..061d51071902d 100644 --- a/src/mount/mount.ceph.c +++ b/src/mount/mount.ceph.c @@ -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; -- 2.39.5