From: Venky Shankar Date: Mon, 3 May 2021 10:30:34 +0000 (-0400) Subject: mount: accept monitor host (`mon_host`) mount option X-Git-Tag: v17.1.0~339^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f47b7bcbf83d78164d304cf8e1b19fbc0cb06bb6;p=ceph.git 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 --- diff --git a/src/mount/mount.ceph.c b/src/mount/mount.ceph.c index af3e4389fbf6..061d51071902 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;