From nobody Sun Feb 8 00:12:46 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7270C54EE9 for ; Tue, 13 Sep 2022 17:27:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233023AbiIMR13 (ORCPT ); Tue, 13 Sep 2022 13:27:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231384AbiIMR0z (ORCPT ); Tue, 13 Sep 2022 13:26:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30D1A6457; Tue, 13 Sep 2022 09:15:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 79602B8100E; Tue, 13 Sep 2022 14:35:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E50FCC433C1; Tue, 13 Sep 2022 14:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663079750; bh=ZyUgIjdNLSUYrx8Fp9Kntz2SmFYPsYZBQCZEtISl5IE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m8l56xHwZLceRyJMZDBoLw99MFtJXAGq5FlY1qHEleEOodrE3PNZAqFJA0z7DFHiE 3604kJyAM4hOG1e8OLV5LoQlb9mfYGe200q1zKPGbVBE4PNStLy8PNmwPU3ZveoEHA /H36PxCgkm4JfBhwWEXG+K8FtHCTN/LCzy2wRmTU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, NeilBrown , Eugeniu Rosca Subject: [PATCH 4.14 61/61] SUNRPC: use _bh spinlocking on ->transport_lock Date: Tue, 13 Sep 2022 16:08:03 +0200 Message-Id: <20220913140349.494726420@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140346.422813036@linuxfoundation.org> References: <20220913140346.422813036@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: "NeilBrown" Prior to Linux 5.3, ->transport_lock in sunrpc required the _bh style spinlocks (when not called from a bottom-half handler). When upstream 3848e96edf4788f772d83990022fa7023a233d83 was backported to stable kernels, the spin_lock/unlock calls should have been changed to the _bh version, but this wasn't noted in the patch and didn't happen. So convert these lock/unlock calls to the _bh versions. This patch is required for any stable kernel prior to 5.3 to which the above mentioned patch was backported. Namely 4.9.y, 4.14.y, 4.19.y. Signed-off-by: NeilBrown Reported-by: Eugeniu Rosca Reviewed-by: Eugeniu Rosca Tested-by: Eugeniu Rosca --- net/sunrpc/xprt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1525,9 +1525,9 @@ static void xprt_destroy(struct rpc_xprt * is cleared. We use ->transport_lock to ensure the mod_timer() * can only run *before* del_time_sync(), never after. */ - spin_lock(&xprt->transport_lock); + spin_lock_bh(&xprt->transport_lock); del_timer_sync(&xprt->timer); - spin_unlock(&xprt->transport_lock); + spin_unlock_bh(&xprt->transport_lock); =20 /* * Destroy sockets etc from the system workqueue so they can