Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1251384pxx; Tue, 27 Oct 2020 11:51:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGQqoRozEffrp0poLs0bmGjKZHObktt2E0aZvgB4Ml/7kvQRjaMYGYwUBxaR1RwJGOkUiX X-Received: by 2002:a17:906:715a:: with SMTP id z26mr3834533ejj.300.1603824716641; Tue, 27 Oct 2020 11:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603824716; cv=none; d=google.com; s=arc-20160816; b=BFK9l5f3nEJW7Kln+pw7qOATF1Sh2Uy9hUvqidggIkEV81VaL9YX+TS1jp4jeoZ0E4 3ksHFBk7aP6xFlR9IIi9joAUPmMpGB5RZAThSLGuoQiDBhN7JrNsiRH56DlL/O2te1P0 8X7lx4nhTEmk3v3H0bXRmzMpms3W0ZkCTRdV5efAxGX60DyCrUuz13RFufSZETL8qLP1 yeCgkiGuG6R5Zs9oKcjqsTtKfrx2SKNQwvujPIwNhGhPrDnPO7ijtYISEs7zkaGes9bv 0eEgbk0BpX6YOodUIZCjapKFNUSOVvBHlMFZgPqrc7knSx/lr/CO8Sduj52YTvjahfLV Q/gA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=y02dri02kYQPeAMRUwPLjy0MnE4kXXzL1fVbi4QaVFA=; b=LkYY0VwoS+GCeYuipJRDTIe26/Oivqh5L78qBb3ky0XSCgD2I1iFSg7kaiDr7Kpnvr Q9C/k1mhbYxyDcW3lZ6EHs8WfQWEKAgR4MUvhfMEKRb5jp1WFAJ/X8tMhepWuUfJUVW5 Pw7R43IzQVZ/HxVbDpdVHeTbUOfKAJzGKVxD3PXrnLs/IYDey8JaxFnVvU8N351C/aTf AvsPqcLW/7X8GcAEZSJewGtT31ZTXLYLa6p++3h0egHmJSbLNxX3+y+QSZri4pYEceQd /98TeXtocqbdVURnBLv5fiIF8NRcPoAnQC5U/4Eh+i0FH5erg5/8hoPD7+LGbqWYXpoz r8rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="v/Hi1kbx"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t27si1741237eji.224.2020.10.27.11.51.34; Tue, 27 Oct 2020 11:51:56 -0700 (PDT) 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="v/Hi1kbx"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2443808AbgJ0Abw (ORCPT + 99 others); Mon, 26 Oct 2020 20:31:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:52566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409470AbgJZXvg (ORCPT ); Mon, 26 Oct 2020 19:51:36 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A56F821BE5; Mon, 26 Oct 2020 23:51:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603756296; bh=M9F62+T2D+Vko2emsXaJiqrfHkqPHC7PmlJ13Y5L0zk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v/Hi1kbx4MDFSX6P2BLuRPgvHH6muOhfUJiF2JcSseSIlMyFTMsNdHxZXbLi182IE 81EE2MT+emF1a+gEVafmOekfUm+BU6ocKFEPf82wWjJE0CpIDFokehZcVFr59jivU4 nLoDbA1EaIX2tt2kmLdlnACp4D2aDcvpnNZCrIwg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Bob Peterson , Andreas Gruenbacher , Sasha Levin , cluster-devel@redhat.com Subject: [PATCH AUTOSEL 5.9 123/147] gfs2: call truncate_inode_pages_final for address space glocks Date: Mon, 26 Oct 2020 19:48:41 -0400 Message-Id: <20201026234905.1022767-123-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026234905.1022767-1-sashal@kernel.org> References: <20201026234905.1022767-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bob Peterson [ Upstream commit ee1e2c773e4f4ce2213f9d77cc703b669ca6fa3f ] Before this patch, we were not calling truncate_inode_pages_final for the address space for glocks, which left the possibility of a leak. We now take care of the problem instead of complaining, and we do it during glock tear-down.. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher Signed-off-by: Sasha Levin --- fs/gfs2/glock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index f13b136654cae..3554e71be06ec 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -270,7 +270,12 @@ static void __gfs2_glock_put(struct gfs2_glock *gl) gfs2_glock_remove_from_lru(gl); spin_unlock(&gl->gl_lockref.lock); GLOCK_BUG_ON(gl, !list_empty(&gl->gl_holders)); - GLOCK_BUG_ON(gl, mapping && mapping->nrpages && !gfs2_withdrawn(sdp)); + if (mapping) { + truncate_inode_pages_final(mapping); + if (!gfs2_withdrawn(sdp)) + GLOCK_BUG_ON(gl, mapping->nrpages || + mapping->nrexceptional); + } trace_gfs2_glock_put(gl); sdp->sd_lockstruct.ls_ops->lm_put_lock(gl); } -- 2.25.1