Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3883681pxb; Tue, 17 Nov 2020 06:09:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxK13Ce+0kBmPF0NjJSPQH45A5lr959wMgSjc9gnIcyqV9aBUT4ZaRJPVhReuk74pybpiK3 X-Received: by 2002:a17:906:82d9:: with SMTP id a25mr19195727ejy.101.1605622179936; Tue, 17 Nov 2020 06:09:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605622179; cv=none; d=google.com; s=arc-20160816; b=tsiKK9oDgq4o+3c85Ko6C/TApVJVUj2TaKtTiWn9JyQpO0F9a/LesiXQTa8RKUsmH3 UZG8mJ31ZdSIVChAt0R8ixWQ9cvTfv1VkQcHnDqQyCh7kNrnlGpbnCbcYLVCgexUAV7a dLjTVqWqZgPzzLQnEFT9Fl1WZK6Ms5//QAFnfsMXsWI3f68kmE9244CCEQ77SK/KOlsP fIYZNPER0KvmHl4OZBtUAHfvY5LHWRDBz+FZ89uqn6++ahkgtCdeOQi3nL2Lp6mAi82h kwzrJG44R6aKqRlKbBlaxAvYsSmogt8vSLGq5aW3w4qGATFr4aPhI9Ze8CxxWKwodtKG lfrA== 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=UPZOgm3bN6o50GXoF4nw+G9QlqRCJvjjiqu0W5N406c=; b=qhu2K9nHDVwhEJYNBXnU1P59Fjz/vm48BRnY2ATMv5CbLNtu5AqB1XCnXrqoth2x5I TotlCj7EXqb3pxcXKgAQp2KG/gRt7oJwgdBHEPK9ZZyiWaxNdVjnYWURK018JfRx6FBL SQRybawyxw/joXEWM/2H5WIhGQnw/fdX9LgJPKtLFvYVtDflcNdBxymWvdUbg8MYflot tDtEGXYQ5ah08avZRKyrGOMgIym+yzWkAEKnxehcBqmvasRUtHrb7DvO6d1ccFhnNzgM QjjD6UKbs7mXcCIPzUlGZLg6G3UwcttVI+SgUwOaW4lwJwDxXtdgbhDKcUoaSN7rtf4U dRsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DFMSo9yQ; 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 a3si14313980ejd.407.2020.11.17.06.09.16; Tue, 17 Nov 2020 06:09:39 -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=DFMSo9yQ; 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 S1732407AbgKQOEc (ORCPT + 99 others); Tue, 17 Nov 2020 09:04:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:39706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729468AbgKQNKZ (ORCPT ); Tue, 17 Nov 2020 08:10:25 -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 6EC852225B; Tue, 17 Nov 2020 13:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605618624; bh=2wvs64zcWjOehOw6+ulkbhTAeef1miK9PtQWMhCo43Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DFMSo9yQBIt8++lQElGINIA7gYxa6t6KujRz4TJLSR9o0iVcZ+gnpbiCzZrGleyfi bGHisS2jzLZBdtCe7lF0qPU2yoBzBV09pIKxsPG1mFG+9xLl9sjaNFudebi7RH3wsj FqA8Mh06F5MY06E9p4t60XrsBz2pD5GDpnzpxnIs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Aring , Andreas Gruenbacher , Sasha Levin Subject: [PATCH 4.9 03/78] gfs2: Wake up when sd_glock_disposal becomes zero Date: Tue, 17 Nov 2020 14:04:29 +0100 Message-Id: <20201117122109.292186369@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122109.116890262@linuxfoundation.org> References: <20201117122109.116890262@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 [ Upstream commit da7d554f7c62d0c17c1ac3cc2586473c2d99f0bd ] 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: Sasha Levin --- fs/gfs2/glock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index efd44d5645d83..f19e49a5d032b 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -758,7 +758,8 @@ again: } 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); *glp = tmp; return ret; -- 2.27.0