summaryrefslogtreecommitdiff
path: root/net/ceph/auth.c
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2021-06-21 12:53:38 +0300
committerIlya Dryomov <idryomov@gmail.com>2021-06-24 22:03:16 +0300
commit3c0d0894320cc517fda657c69939cd0313d0b4e2 (patch)
tree461605c1079ae14df53653e4e424357456bb222c /net/ceph/auth.c
parent7a971e2c0767b6fc9a77c4108eceff0509c61cdb (diff)
downloadlinux-3c0d0894320cc517fda657c69939cd0313d0b4e2.tar.xz
libceph: don't pass result into ac->ops->handle_reply()
There is no result to pass in msgr2 case because authentication failures are reported through auth_bad_method frame and in MAuth case an error is returned immediately. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Jeff Layton <jlayton@kernel.org>
Diffstat (limited to 'net/ceph/auth.c')
-rw-r--r--net/ceph/auth.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/net/ceph/auth.c b/net/ceph/auth.c
index de407e8feb97..3a9d44eee941 100644
--- a/net/ceph/auth.c
+++ b/net/ceph/auth.c
@@ -260,14 +260,19 @@ int ceph_handle_auth_reply(struct ceph_auth_client *ac,
ac->negotiating = false;
}
- ret = ac->ops->handle_reply(ac, result, payload, payload_end,
+ if (result) {
+ pr_err("auth protocol '%s' mauth authentication failed: %d\n",
+ ceph_auth_proto_name(ac->protocol), result);
+ ret = result;
+ goto out;
+ }
+
+ ret = ac->ops->handle_reply(ac, payload, payload_end,
NULL, NULL, NULL, NULL);
if (ret == -EAGAIN) {
ret = build_request(ac, true, reply_buf, reply_len);
goto out;
} else if (ret) {
- pr_err("auth protocol '%s' mauth authentication failed: %d\n",
- ceph_auth_proto_name(ac->protocol), result);
goto out;
}
@@ -480,7 +485,7 @@ int ceph_auth_handle_reply_more(struct ceph_auth_client *ac, void *reply,
int ret;
mutex_lock(&ac->mutex);
- ret = ac->ops->handle_reply(ac, 0, reply, reply + reply_len,
+ ret = ac->ops->handle_reply(ac, reply, reply + reply_len,
NULL, NULL, NULL, NULL);
if (ret == -EAGAIN)
ret = build_request(ac, false, buf, buf_len);
@@ -498,7 +503,7 @@ int ceph_auth_handle_reply_done(struct ceph_auth_client *ac,
int ret;
mutex_lock(&ac->mutex);
- ret = ac->ops->handle_reply(ac, 0, reply, reply + reply_len,
+ ret = ac->ops->handle_reply(ac, reply, reply + reply_len,
session_key, session_key_len,
con_secret, con_secret_len);
if (!ret)