]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/ceph/messenger.c
Merge tag 'nfs-for-4.10-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
[linux.git] / net / ceph / messenger.c
index a5502898ea33b0e4d74cfa8f12947c1d9466013c..770c52701efa3e08cec85c756fd7b8125f63ac91 100644 (file)
@@ -1393,15 +1393,9 @@ static struct ceph_auth_handshake *get_connect_authorizer(struct ceph_connection
                return NULL;
        }
 
-       /* Can't hold the mutex while getting authorizer */
-       mutex_unlock(&con->mutex);
        auth = con->ops->get_authorizer(con, auth_proto, con->auth_retry);
-       mutex_lock(&con->mutex);
-
        if (IS_ERR(auth))
                return auth;
-       if (con->state != CON_STATE_NEGOTIATING)
-               return ERR_PTR(-EAGAIN);
 
        con->auth_reply_buf = auth->authorizer_reply_buf;
        con->auth_reply_buf_len = auth->authorizer_reply_buf_len;
@@ -2027,6 +2021,19 @@ static int process_connect(struct ceph_connection *con)
 
        dout("process_connect on %p tag %d\n", con, (int)con->in_tag);
 
+       if (con->auth_reply_buf) {
+               /*
+                * Any connection that defines ->get_authorizer()
+                * should also define ->verify_authorizer_reply().
+                * See get_connect_authorizer().
+                */
+               ret = con->ops->verify_authorizer_reply(con);
+               if (ret < 0) {
+                       con->error_msg = "bad authorize reply";
+                       return ret;
+               }
+       }
+
        switch (con->in_reply.tag) {
        case CEPH_MSGR_TAG_FEATURES:
                pr_err("%s%lld %s feature set mismatch,"