Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2458292imd; Fri, 2 Nov 2018 11:45:12 -0700 (PDT) X-Google-Smtp-Source: AJdET5dGSsVjdMV9nysohzmewT3frmm+rqVCoK3zg2BV1d7E9+jsKlLCMJNgxIRb7j6Hx+a0qJX/ X-Received: by 2002:a63:164d:: with SMTP id 13-v6mr11918363pgw.103.1541184312766; Fri, 02 Nov 2018 11:45:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184312; cv=none; d=google.com; s=arc-20160816; b=slXQgkY6Wa/HDz5d3rr3BVl1kVB73bV6QFTV0bakUlzyIp/cjFVDprcAjZuTt/kmnO v2VDNw5utvzNmIuprN0fvKrFdf/hZfiGwB4p1OsqeMB0G7GpxP3atB/7A+5qWGDsL7f5 tDzzj+UFLjTTEngsjawq1PnUGJFGGqBF6f7dlV2tV4fTOIRRTVxlJwqs7nnISKsiHSL6 LKUA8AHvvuzlqq2FYI2vYRYzQXhSwMehA8SnHpdik0F2DcY1RAq/ZVEWYpQuI1a4UnMj XOs+GKUPIiMfCR8MfmnIYB+PHssi/5HZpDKtrgUYVBoIBgM4es30Ym9THdL55eTHoLXU A4BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WBdhum7PNYxR8vSZiyWfNKY9QQL1KJJFDDJuf2PL9RQ=; b=lrXAR7XO9V6FGQlL7oV2UNBtdskks66o7igpp1Ryn5oJx0yq8Qu2eakCaylz1nmoWo ZnIlUH1bj9ZN/uj0ygaY/7vz0XYpRfAd8vD6QAuxiP3qfq0ePj02bcKiOOtNVAhjsweh /t9/aUbKMgFFGzg5NRfQu1e3L7HeJcjN3ecdR/gLrJE0Mt36VkN5x6MCIAMna9tjVeNc KRpGLfgBdIGlNH9FL59fftciK2PYaHCYZhW7lysNagFMZ3gniwlarBFEhTwUkUHe7nAQ LfncHe0mM9C53+nXqdpHKOq2gDKLhSW6vp51twjY9qOriW6RLZSCiSWmp9O/wdsvyJVX r7zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=F+Fx3Xe2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi6-v6si22102032plb.348.2018.11.02.11.44.58; Fri, 02 Nov 2018 11:45:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=F+Fx3Xe2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729970AbeKCDwE (ORCPT + 99 others); Fri, 2 Nov 2018 23:52:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:47300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728565AbeKCDwE (ORCPT ); Fri, 2 Nov 2018 23:52:04 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9BDA020854; Fri, 2 Nov 2018 18:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184231; bh=P79rj0hN0MtIOh+Dqs0wpOEfGPMC1We9rHekZIe5Jcw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F+Fx3Xe2Tw0NApAhlONGewYyFkEC+fkU5WiDddD+Zt1GVgCQq5Z0E7YhomjLKKXj2 GBZSLGemnomjf73jh0lrpqklOjMqDeXCBo1cPviBdg6mrJwcS4e7LRNSmFGVNhQqpQ ZURWO2CTFEe2k0kl+krNYKPVGbL5uGUinAxNPS2s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Sasha Levin Subject: [PATCH 4.18 084/150] rxrpc: Carry call state out of locked section in rxrpc_rotate_tx_window() Date: Fri, 2 Nov 2018 19:34:06 +0100 Message-Id: <20181102182909.382656762@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit dfe995224693798e554ab4770f6d8a096afc60cd ] Carry the call state out of the locked section in rxrpc_rotate_tx_window() rather than sampling it afterwards. This is only used to select tracepoint data, but could have changed by the time we do the tracepoint. Signed-off-by: David Howells Signed-off-by: Sasha Levin --- net/rxrpc/input.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c index 5e180a3c2d01..fe1cf206d12a 100644 --- a/net/rxrpc/input.c +++ b/net/rxrpc/input.c @@ -278,23 +278,26 @@ static bool rxrpc_rotate_tx_window(struct rxrpc_call *call, rxrpc_seq_t to, static bool rxrpc_end_tx_phase(struct rxrpc_call *call, bool reply_begun, const char *abort_why) { + unsigned int state; ASSERT(test_bit(RXRPC_CALL_TX_LAST, &call->flags)); write_lock(&call->state_lock); - switch (call->state) { + state = call->state; + switch (state) { case RXRPC_CALL_CLIENT_SEND_REQUEST: case RXRPC_CALL_CLIENT_AWAIT_REPLY: if (reply_begun) - call->state = RXRPC_CALL_CLIENT_RECV_REPLY; + call->state = state = RXRPC_CALL_CLIENT_RECV_REPLY; else - call->state = RXRPC_CALL_CLIENT_AWAIT_REPLY; + call->state = state = RXRPC_CALL_CLIENT_AWAIT_REPLY; break; case RXRPC_CALL_SERVER_AWAIT_ACK: __rxrpc_call_completed(call); rxrpc_notify_socket(call); + state = call->state; break; default: @@ -302,11 +305,10 @@ static bool rxrpc_end_tx_phase(struct rxrpc_call *call, bool reply_begun, } write_unlock(&call->state_lock); - if (call->state == RXRPC_CALL_CLIENT_AWAIT_REPLY) { + if (state == RXRPC_CALL_CLIENT_AWAIT_REPLY) trace_rxrpc_transmit(call, rxrpc_transmit_await_reply); - } else { + else trace_rxrpc_transmit(call, rxrpc_transmit_end); - } _leave(" = ok"); return true; -- 2.17.1