]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mount.ceph: stop printing warning message for unrecognized mount options
authorXiubo Li <xiubli@redhat.com>
Sun, 23 Feb 2020 12:46:34 +0000 (07:46 -0500)
committerXiubo Li <xiubli@redhat.com>
Mon, 9 Mar 2020 08:03:03 +0000 (04:03 -0400)
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 <xiubli@redhat.com>
src/mount/mount.ceph.c

index 3e34c8459be14a7d154a0e3c7244afb011ddb15c..33acafb935db9ae682c4ee6f810c62e6f4c6e4e1 100644 (file)
@@ -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)