From 17f334d83b6ebfae817688b3db6427255d74a644 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Sun, 23 Feb 2020 07:46:34 -0500 Subject: [PATCH] mount.ceph: stop printing warning message for unrecognized mount options This will just give one final debug message for the options are passing to kernel. Fixes: https://tracker.ceph.com/issues/44211 Signed-off-by: Xiubo Li --- src/mount/mount.ceph.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mount/mount.ceph.c b/src/mount/mount.ceph.c index 3e34c8459be..33acafb935d 100644 --- a/src/mount/mount.ceph.c +++ b/src/mount/mount.ceph.c @@ -208,6 +208,9 @@ static int parse_options(const char *data, struct ceph_mount_info *cmi) int name_len = 0; int name_pos = 0; + if (data == EMPTY_STRING) + goto out; + mount_ceph_debug("parsing options: %s\n", data); do { @@ -316,9 +319,8 @@ static int parse_options(const char *data, struct ceph_mount_info *cmi) name = value; skip = false; } else { + /* unrecognized mount options, passing to kernel */ skip = false; - mount_ceph_debug("mount.ceph: unrecognized mount option \"%s\", passing to kernel.\n", - data); } /* Copy (possibly modified) option to out */ @@ -337,10 +339,15 @@ static int parse_options(const char *data, struct ceph_mount_info *cmi) data = next_keyword; } while (data); +out: name_pos = safe_cat(&cmi->cmi_name, &name_len, name_pos, "client."); name_pos = safe_cat(&cmi->cmi_name, &name_len, name_pos, name ? name : CEPH_AUTH_NAME_DEFAULT); + if (cmi->cmi_opts) + mount_ceph_debug("mount.ceph: options \"%s\" will pass to kernel.\n", + cmi->cmi_opts); + if (!cmi->cmi_opts) { cmi->cmi_opts = strdup(EMPTY_STRING); if (!cmi->cmi_opts) -- 2.39.5