From patchwork Mon Dec 12 20:49:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 9471309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 80886607D3 for ; Mon, 12 Dec 2016 20:50:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76EC828518 for ; Mon, 12 Dec 2016 20:50:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C0F42851B; Mon, 12 Dec 2016 20:50:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6275A28518 for ; Mon, 12 Dec 2016 20:50:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752956AbcLLUuU (ORCPT ); Mon, 12 Dec 2016 15:50:20 -0500 Received: from mail-wj0-f193.google.com ([209.85.210.193]:34800 "EHLO mail-wj0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932495AbcLLUuS (ORCPT ); Mon, 12 Dec 2016 15:50:18 -0500 Received: by mail-wj0-f193.google.com with SMTP id xy5so13486332wjc.1 for ; Mon, 12 Dec 2016 12:50:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=lDtmy1r5WeUrygeIxBrHIZGyNl4h8BnrqgiBWjaJErI=; b=aloklz1WKxMjnNCb3dxN3orYgO0vrrN97xT0DOKwJSy1JHORDnots7b6Eq1iEv7zAN t3BJoXk4DKWtl9mw1pis6jQCSfBdQH8DINy6FiiYpKfl6JYohzPDiryi8iiokb9tUJ/W hTFZzmvx7I0GMay+fAzPV/wn/BSKNacphGzFSdzX+PmKAdPPfTGMbV+qEbeO4K/U8pog XSzUDDaG8PZOvisUdWUQtIT/AasmbhAiP7FtlbjL/2z3H2zZNsd1AqPEppNsGQr8UlwC byUxFPFDdqShDG/v1GZ9DSGsixbgNyUsMz4VRYKaZRHmJo/qvcFeuEFzx63Hf01mPYOo d0sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=lDtmy1r5WeUrygeIxBrHIZGyNl4h8BnrqgiBWjaJErI=; b=HzO0yFgAZQtssRWllKDo6SCmjo6d4sM8uF2IRGuXh70imtPEu6GMbHUWl7RodJHd1D qFNqeX1ocl7vkFyJXRuKWw1mJwQfCVD1/7U7FuKTYR6KFIFqUi1z5N0qEqiUZaFS2Zt/ 96Rh36vlkS3rJ3eCJsACuKJPrD4wljRRAVSF24wAL3J6a1OpMF3zSMncFkkg6GSUdBaw T2bPrIdJ+tcMU86tHyEz3WsREp40tujs+2T3h399pdtW9suzhILb6RkB19rF5M7CUJFN Cvd1zbknMqzWgy4JmOU5NPt9GcHMHt7gEPZNmuA2eh6CKQJfiM7dlUOwHi1Sr0JiO1gx GwpQ== X-Gm-Message-State: AKaTC03Ex1jeYS66g9WGsNuy3VC2dfKYqAXCVSfgGlJOSD43sDTQz83O35uJqEnez9PVCg== X-Received: by 10.194.120.226 with SMTP id lf2mr81490688wjb.130.1481575816361; Mon, 12 Dec 2016 12:50:16 -0800 (PST) Received: from dhcp-1-105.brq.redhat.com ([213.175.37.12]) by smtp.gmail.com with ESMTPSA id 135sm37201887wmh.14.2016.12.12.12.50.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Dec 2016 12:50:15 -0800 (PST) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Subject: [PATCH 15/15] libceph: no need to drop con->mutex for ->get_authorizer() Date: Mon, 12 Dec 2016 21:49:00 +0100 Message-Id: <1481575740-1834-16-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1481575740-1834-1-git-send-email-idryomov@gmail.com> References: <1481575740-1834-1-git-send-email-idryomov@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ->get_authorizer(), ->verify_authorizer_reply(), ->sign_message() and ->check_message_signature() shouldn't be doing anything with or on the connection (like closing it or sending messages). Signed-off-by: Ilya Dryomov --- net/ceph/messenger.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index dba380429a05..770c52701efa 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -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;