Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+15 -12
+1 -1
include/linux/ceph/auth.h
··· 50 50 * another request. 51 51 */ 52 52 int (*build_request)(struct ceph_auth_client *ac, void *buf, void *end); 53 - int (*handle_reply)(struct ceph_auth_client *ac, int result, 53 + int (*handle_reply)(struct ceph_auth_client *ac, 54 54 void *buf, void *end, u8 *session_key, 55 55 int *session_key_len, u8 *con_secret, 56 56 int *con_secret_len);
+10 -5
net/ceph/auth.c
··· 260 260 ac->negotiating = false; 261 261 } 262 262 263 - ret = ac->ops->handle_reply(ac, result, payload, payload_end, 263 + if (result) { 264 + pr_err("auth protocol '%s' mauth authentication failed: %d\n", 265 + ceph_auth_proto_name(ac->protocol), result); 266 + ret = result; 267 + goto out; 268 + } 269 + 270 + ret = ac->ops->handle_reply(ac, payload, payload_end, 264 271 NULL, NULL, NULL, NULL); 265 272 if (ret == -EAGAIN) { 266 273 ret = build_request(ac, true, reply_buf, reply_len); 267 274 goto out; 268 275 } else if (ret) { 269 - pr_err("auth protocol '%s' mauth authentication failed: %d\n", 270 - ceph_auth_proto_name(ac->protocol), result); 271 276 goto out; 272 277 } 273 278 ··· 485 480 int ret; 486 481 487 482 mutex_lock(&ac->mutex); 488 - ret = ac->ops->handle_reply(ac, 0, reply, reply + reply_len, 483 + ret = ac->ops->handle_reply(ac, reply, reply + reply_len, 489 484 NULL, NULL, NULL, NULL); 490 485 if (ret == -EAGAIN) 491 486 ret = build_request(ac, false, buf, buf_len); ··· 503 498 int ret; 504 499 505 500 mutex_lock(&ac->mutex); 506 - ret = ac->ops->handle_reply(ac, 0, reply, reply + reply_len, 501 + ret = ac->ops->handle_reply(ac, reply, reply + reply_len, 507 502 session_key, session_key_len, 508 503 con_secret, con_secret_len); 509 504 if (!ret)
+2 -2
net/ceph/auth_none.c
··· 69 69 * the generic auth code decode the global_id, and we carry no actual 70 70 * authenticate state, so nothing happens here. 71 71 */ 72 - static int handle_reply(struct ceph_auth_client *ac, int result, 72 + static int handle_reply(struct ceph_auth_client *ac, 73 73 void *buf, void *end, u8 *session_key, 74 74 int *session_key_len, u8 *con_secret, 75 75 int *con_secret_len) ··· 77 77 struct ceph_auth_none_info *xi = ac->private; 78 78 79 79 xi->starting = false; 80 - return result; 80 + return 0; 81 81 } 82 82 83 83 static void ceph_auth_none_destroy_authorizer(struct ceph_authorizer *a)
+2 -4
net/ceph/auth_x.c
··· 661 661 return -EINVAL; 662 662 } 663 663 664 - static int ceph_x_handle_reply(struct ceph_auth_client *ac, int result, 664 + static int ceph_x_handle_reply(struct ceph_auth_client *ac, 665 665 void *buf, void *end, 666 666 u8 *session_key, int *session_key_len, 667 667 u8 *con_secret, int *con_secret_len) ··· 669 669 struct ceph_x_info *xi = ac->private; 670 670 struct ceph_x_ticket_handler *th; 671 671 int len = end - buf; 672 + int result; 672 673 void *p; 673 674 int op; 674 675 int ret; 675 - 676 - if (result) 677 - return result; /* XXX hmm? */ 678 676 679 677 if (xi->starting) { 680 678 /* it's a hello */