Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5609814imu; Mon, 26 Nov 2018 02:58:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/UjUNnB2zkd1WCKHBKINIsl/ddfm40LFb0C8Ml+7+c+PEGoA+RrSdjBJITnyl9VeLRHIDrb X-Received: by 2002:a17:902:64c1:: with SMTP id y1mr26834145pli.64.1543229916456; Mon, 26 Nov 2018 02:58:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543229916; cv=none; d=google.com; s=arc-20160816; b=CZcMLNpP2IQ15a8ViGQzKP/S/tYi+qr5V/LM0iRxkdApH1AmPZHhIqbR3fjOW3n6IK xeydnG10fSjPfATBsMM7Ocls8EiAls8DcHM6Zpny6i86v6XvSEdx8wgta9IlONP1mlVh K2Hb6cJ/GVM/MYwSEfL+jdogMZI3CnDMzJRbULKFelc+37q8mMNpdnTcQAVqmxq8+Lyr /tgNpZhr5Ky4xx3TbEY6EoB89NUea9ac2sST4HBNBBQKvNyl6dgYlkRskXNusI8YfitX yw+SqYZgDlk/GwmTLQQNAbxXEK0rJjzSf7u8GwbJfIkJXRsaCyfH7Lgvn3xJzutZKz+9 bw+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+9q1UYc0Pa30MPkmWCD1y/6zfbLqJTszpIoG0H28HXE=; b=tDmqakUmHvMquCOTJB2RrSe7GviRTPcwEhpQQQg+MwaKRtWL6WhMLTh+blnfm3AXvW mtMTK4Jq4B+sdFwdlUmCykfRFoi/Krx9RRlLhA881iuxFH5AHUxJ4RouBHU+haVeMcm+ wO7E7ZXFQqjRXXmrxNWetDNpSw4+/DPmq32/ZA+2DaaIIXT7cJHm5Lute4BMs8LfxEyW OqCOxNPYQ74e7jIJfXA3Xi1rlHy/YLVribJivOvLe+48gMrL+7wT0fFoZALuVlI4hCau ebb7ydpPoUtrZojjqqkoB9oCYXoclbS6IoZbdO5p5xwjOosmcd704BFqAXsVgYdoP4jc ccKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d2XBgXup; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e63si59560721pgc.239.2018.11.26.02.58.21; Mon, 26 Nov 2018 02:58:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d2XBgXup; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728090AbeKZVt1 (ORCPT + 99 others); Mon, 26 Nov 2018 16:49:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:58390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726561AbeKZVt0 (ORCPT ); Mon, 26 Nov 2018 16:49:26 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 D316A21104; Mon, 26 Nov 2018 10:55:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543229742; bh=rgz6VxmopRl6iM4RsUTfbrvTpZJumKyIa/+OenMB5v8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d2XBgXup3e8kiaq+Be+Aum1h12qv0ETzlNCI08hk/u1JpzB+RpHWuiQoo7DH93xNI HDC6xpivQFwGJaJYDcMXj+wM90NoWaARFZ3XM81XnivzPGYrA5HxnFRGJr2TCftYWG EKT255DHTZFHCmhjFGZAy011hqXqt7vSI6sLWkXQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andreas Gruenbacher , Sasha Levin Subject: [PATCH 4.4 56/70] gfs2: Put bitmap buffers in put_super Date: Mon, 26 Nov 2018 11:51:11 +0100 Message-Id: <20181126105052.184442981@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105046.722096341@linuxfoundation.org> References: <20181126105046.722096341@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ commit 10283ea525d30f2e99828978fd04d8427876a7ad upstream. gfs2_put_super calls gfs2_clear_rgrpd to destroy the gfs2_rgrpd objects attached to the resource group glocks. That function should release the buffers attached to the gfs2_bitmap objects (bi_bh), but the call to gfs2_rgrp_brelse for doing that is missing. When gfs2_releasepage later runs across these buffers which are still referenced, it refuses to free them. This causes the pages the buffers are attached to to remain referenced as well. With enough mount/unmount cycles, the system will eventually run out of memory. Fix this by adding the missing call to gfs2_rgrp_brelse in gfs2_clear_rgrpd. (Also fix a gfs2_rgrp_relse -> gfs2_rgrp_brelse typo in a comment.) Fixes: 39b0f1e92908 ("GFS2: Don't brelse rgrp buffer_heads every allocation") Cc: stable@vger.kernel.org # v4.4 Signed-off-by: Andreas Gruenbacher Signed-off-by: Sasha Levin --- fs/gfs2/rgrp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index c134c0462cee..ef24894edecc 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -732,6 +732,7 @@ void gfs2_clear_rgrpd(struct gfs2_sbd *sdp) spin_lock(&gl->gl_lockref.lock); gl->gl_object = NULL; spin_unlock(&gl->gl_lockref.lock); + gfs2_rgrp_brelse(rgd); gfs2_glock_add_to_lru(gl); gfs2_glock_put(gl); } @@ -1139,7 +1140,7 @@ static u32 count_unlinked(struct gfs2_rgrpd *rgd) * @rgd: the struct gfs2_rgrpd describing the RG to read in * * Read in all of a Resource Group's header and bitmap blocks. - * Caller must eventually call gfs2_rgrp_relse() to free the bitmaps. + * Caller must eventually call gfs2_rgrp_brelse() to free the bitmaps. * * Returns: errno */ -- 2.17.1