Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3194616pxb; Mon, 9 Nov 2020 05:18:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+0HZrsIh9zOCC0Mu0EWfAjUWuZ0K2XUDcby8gJY4yL/OXBrhz0BCD7hLSrxLNZ2Hq+NHV X-Received: by 2002:a05:6402:94f:: with SMTP id h15mr11130535edz.177.1604927933251; Mon, 09 Nov 2020 05:18:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604927933; cv=none; d=google.com; s=arc-20160816; b=lcaI6yofUtpir77p3msCROifuhR2RCP3gAHHTHgrFIzRSJ0c4IujUWIAWwSDxDIBnK /VdOWbsaiW0ptcDpSp+0qMbe+jIQRNlLIYKNwuttwDtlNg/l/Vav75rUliO+oB7XRXDx UvL/jD1jKWHPsXebZUUYR2Cok7wnN0/cFeohxt7i1IUl171HyMBOPLqbMdxZ/Nmj5xsk QGLC0SFrMyLboIxmh0b6flBim7SOIz8Zrl1zl/kMXi849+4Zd6Mcz4f8gH3IdQtYyFrF 9+Qy7Zly8j+QueoFyH44fVqWjLyakr/gqjz/qzUnOdVCKAAOpWesv3t/hnL/jyNJjFBP GQ2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IxRroxtUD6UxRdSn4/4dKgpPTAb8LMVckLktvjSSvcI=; b=dZgLb3mSTTvDdbJRChMABVtP2zHMrUf7J7qze4Y2jqcMSRUqpdfItkFgoFlvkgUGI8 0RtgsZMu3f0rL7dhBA/+DnivCK24zALeSevUbuF4v60AAJFLus1TaaiJp7vHgCNC0oQn Nh15a0LIjzN+Q0OOas3lc0/5bHeWHFbkOaiSUu5Sz3GUoJVZD11s3ufrNRCMyw1tO4Hi K/F3EzGKmcZZieSpOTJF1z96eYfbUDHEqlUVby7hOyJny9phhA6rAlCmNDS2AeGOCWYu r85MyRxLNnDrD+ZthmvidhK2Br71jlaf+BR1qVlbaYQmlC7Txu0/Ji825IrXd050Tag5 VI5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VBZNqSzr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kt22si1047842ejb.384.2020.11.09.05.18.28; Mon, 09 Nov 2020 05:18:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VBZNqSzr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731445AbgKINOV (ORCPT + 99 others); Mon, 9 Nov 2020 08:14:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:40598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733112AbgKINOT (ORCPT ); Mon, 9 Nov 2020 08:14:19 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 BA205208FE; Mon, 9 Nov 2020 13:14:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927659; bh=DpH6Zl8NC2Hf5I8h7XivIKwIo/+UNMm/LDKzUfcQhDI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VBZNqSzrq8htXCDdh1b3lLnlzrCGVQS+Zf4o82T+M9NEDL6dK4tb358oBrHGIccm5 XiuA9zJPvYIaEarEtJqt1gvD8tjZYETJVUOUJldD4pZHnMELZTgKOZw2Dzl48t2hav OVTaOPy6wnQ8iMYVSlraIJEnbFjbxSqen9Quyh6U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Aring , Andreas Gruenbacher Subject: [PATCH 5.4 33/85] gfs2: Wake up when sd_glock_disposal becomes zero Date: Mon, 9 Nov 2020 13:55:30 +0100 Message-Id: <20201109125024.178032482@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125022.614792961@linuxfoundation.org> References: <20201109125022.614792961@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Aring commit da7d554f7c62d0c17c1ac3cc2586473c2d99f0bd upstream. Commit fc0e38dae645 ("GFS2: Fix glock deallocation race") fixed a sd_glock_disposal accounting bug by adding a missing atomic_dec statement, but it failed to wake up sd_glock_wait when that decrement causes sd_glock_disposal to reach zero. As a consequence, gfs2_gl_hash_clear can now run into a 10-minute timeout instead of being woken up. Add the missing wakeup. Fixes: fc0e38dae645 ("GFS2: Fix glock deallocation race") Cc: stable@vger.kernel.org # v2.6.39+ Signed-off-by: Alexander Aring Signed-off-by: Andreas Gruenbacher Signed-off-by: Greg Kroah-Hartman --- fs/gfs2/glock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -873,7 +873,8 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, out_free: kfree(gl->gl_lksb.sb_lvbptr); kmem_cache_free(cachep, gl); - atomic_dec(&sdp->sd_glock_disposal); + if (atomic_dec_and_test(&sdp->sd_glock_disposal)) + wake_up(&sdp->sd_glock_wait); out: return ret;