]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ceph: include auth method in error messages
authorSage Weil <sage@newdream.net>
Fri, 14 May 2010 16:55:18 +0000 (09:55 -0700)
committerSage Weil <sage@newdream.net>
Mon, 17 May 2010 22:25:23 +0000 (15:25 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/auth.c
fs/ceph/auth.h
fs/ceph/auth_none.c
fs/ceph/auth_x.c

index 818afe72e6c75dd0c6ce36b55107a07f780be510..9f46de2ba7a7d58214fc63d457b0087108632c43 100644 (file)
@@ -150,7 +150,8 @@ int ceph_build_auth_request(struct ceph_auth_client *ac,
 
        ret = ac->ops->build_request(ac, p + sizeof(u32), end);
        if (ret < 0) {
-               pr_err("error %d building request\n", ret);
+               pr_err("error %d building auth method %s request\n", ret,
+                      ac->ops->name);
                return ret;
        }
        dout(" built request %d bytes\n", ret);
@@ -216,8 +217,8 @@ int ceph_handle_auth_reply(struct ceph_auth_client *ac,
                if (ac->protocol != protocol) {
                        ret = ceph_auth_init_protocol(ac, protocol);
                        if (ret) {
-                               pr_err("error %d on auth protocol %d init\n",
-                                      ret, protocol);
+                               pr_err("error %d on auth method %s init\n",
+                                      ret, ac->ops->name);
                                goto out;
                        }
                }
@@ -229,7 +230,7 @@ int ceph_handle_auth_reply(struct ceph_auth_client *ac,
        if (ret == -EAGAIN) {
                return ceph_build_auth_request(ac, reply_buf, reply_len);
        } else if (ret) {
-               pr_err("authentication error %d\n", ret);
+               pr_err("auth method '%s' error %d\n", ac->ops->name, ret);
                return ret;
        }
        return 0;
index ca4f57cfb26776fc1fba826fb629bec2a060f45b..4429a707c021b34daa857f73697094c1118a5556 100644 (file)
@@ -15,6 +15,8 @@ struct ceph_auth_client;
 struct ceph_authorizer;
 
 struct ceph_auth_client_ops {
+       const char *name;
+
        /*
         * true if we are authenticated and can connect to
         * services.
index 8cd9e3af07f7f8df750b2a3ec5ad27a0fbe8ec96..24407c1192915c25b06b1b04f4bdb2aa82f5dbd4 100644 (file)
@@ -94,6 +94,7 @@ static void ceph_auth_none_destroy_authorizer(struct ceph_auth_client *ac,
 }
 
 static const struct ceph_auth_client_ops ceph_auth_none_ops = {
+       .name = "none",
        .reset = reset,
        .destroy = destroy,
        .is_authenticated = is_authenticated,
index fee5a08da8818d5abd7d3996e7bfb9e1e0e6e0bb..18c1a1de554704a5d92872e4e23bebae8d616b67 100644 (file)
@@ -618,6 +618,7 @@ static void ceph_x_invalidate_authorizer(struct ceph_auth_client *ac,
 
 
 static const struct ceph_auth_client_ops ceph_x_ops = {
+       .name = "x",
        .is_authenticated = ceph_x_is_authenticated,
        .build_request = ceph_x_build_request,
        .handle_reply = ceph_x_handle_reply,