Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3200026pxb; Mon, 9 Nov 2020 05:26:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxM0PpwfRAmlRiTEFlvZLPGlt4/5zhlm+fddIA2GD9V+2VTjNPGF6UvV8SyCyObZvoNrc/T X-Received: by 2002:a17:906:2886:: with SMTP id o6mr15723374ejd.259.1604928394455; Mon, 09 Nov 2020 05:26:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604928394; cv=none; d=google.com; s=arc-20160816; b=l6jcVV8AlPwzKc2CoPWmICHPqlGIXYZuhCRkgfuJ14yasJ6DfEKz40AdUBCxWMmJjd hxWl9kCAG26kZqrGBUZXqg/geOcfV6jMpIMyEdrve8TyxoN6Mhm72C8Jiqeu0YbWbu2d 2u+im+i4Jrz/3If5mKHteIwBr8ElKep1H1kN5VBl9BblFuS9zGnkvbrMOwcf2olbV2lX +iFW6Dy54vNbavmhopexqulQWIs5N+907Ya/lIftYRFVdCRePYUHDm2TEC9YA1ajoSU9 0mJZkxAX/iDCTOBiVRwjiEn1j1g263yc8gtlhEkC2ul5zlitPOfuiJi5JSXOeHwcG1Bk AuzQ== 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=xSOhNCW58QVn2VDN7KJt0ar+MWOZEn2/lalqRwljPNw=; b=Hy+Y+4oks2Zyu9AcDHPP8v9AhzgTaVIwYiHe90NlMEnUFX1M0vOufF6fEhd5HtlaPR t+2yW7bf8I/cwmA7IpIH2Mb05WD6r4Rnwpl9tvwbBdmwgw+HFA8nbnZK09ckmLOanki7 9OAyKxHs0/cQ5WntU9pKDL9dldM3Sn1i5llGYlwM4gF8E0MEl9pN9DdJ1KiEAL65uk35 8oii+DfzFGghW6axsTuBYNK2zamSEUUiGjwyL7Q4zv8kDAeH1rY7rL1TAbkVXlnLWxdS nRrlspv17qAKJ0BHK0KlISP3mOgkD3zzk7hKOR8C/EqN7SKm+X9C/huRe82M+9lUVP48 dx0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Sz08jIsv; 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 mb20si6055303ejb.673.2020.11.09.05.26.11; Mon, 09 Nov 2020 05:26:34 -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=Sz08jIsv; 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 S1732971AbgKINSg (ORCPT + 99 others); Mon, 9 Nov 2020 08:18:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:45670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387893AbgKINSU (ORCPT ); Mon, 9 Nov 2020 08:18:20 -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 488952076E; Mon, 9 Nov 2020 13:18:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927899; bh=rzoNltNt4ufuY0GSBCeGhGAsHBqjolnL9fJSUiI27yg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sz08jIsvZD64aO3jLKgoug1uAvay8UeG+CFTEmMh7MM1/mgq7Bk21FHmQo7BsMr5d lnxTeQPt0rtBSLayCN1Pnfn2Xq3fUgNauhrLgUjaDV6+EoQXSoiwhg/Pwj844IDRXL JKiiUvspTDuE3QVb1IY7Bzdl7lv9XEKDm95a3Ca0= 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.9 058/133] gfs2: Wake up when sd_glock_disposal becomes zero Date: Mon, 9 Nov 2020 13:55:20 +0100 Message-Id: <20201109125033.515552505@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125030.706496283@linuxfoundation.org> References: <20201109125030.706496283@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 @@ -1081,7 +1081,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;