Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2959759imu; Mon, 19 Nov 2018 08:38:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/WY6IXGW4q03+GVFE9GOWYN5jBdoIuO8qM0YJBH4L79yl3BANoBIwzvLU2pYclh8gW9CgJ9 X-Received: by 2002:a17:902:9b93:: with SMTP id y19mr12594872plp.336.1542645526777; Mon, 19 Nov 2018 08:38:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542645526; cv=none; d=google.com; s=arc-20160816; b=YT+AKZQRfK5QgxFzyCn5LjL4gwkRNWzCdD94auwC3Bn7tgpSlJyPzZ8j+B0Zv9/nC6 2LHFnrb3vlv5dykvP0EJcsG6n6I3JSMjwWTLewQuwoL4i8q5yS3elK/Hvh1svIhbm+IM L8hgzXROnhU/YAGw1B89AC7eB4jtKPFBMbmLtUrwbkyGhKYqxJHjpwooKUekjO4+dUqY yeIgHmkaoPlRwJ7u4tWElX0/3ooA1P+XUjs0q8/GseVG7eAZ5hHwEs7NoazQ/5bL0aVx BJSLypf05hWrBw5KjLYbP2g8nYJgMwjgBTS09UAO2AOowEOGZB1J6Y5+TLADRJtSxYUx yGGg== 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=wdmnpHi7LlJDgTcvifjvkRCuRa6MA0by5bq74kLsQyk=; b=EkPoKVwwecBlM6m3X0eJ/OVg1DBRnM/qBPMB6cKOZJVnfH0XjcZRctvSMq0wFcALtl Ee5kfFTKbhZRLIZUw/oDnedpfodQwl9cPRgr35mKESZjdRufk50SDB5Cp9VkxKwCiE/G 9c8zS3Al3JYLezlxnsSZqR1VjESlmQ8qsDd4RYtFuBEa5NcGEIltNHEpKgGe9REdCTKA 1VG449fQsWz/Hkoq5HMPGrvQyKb0O2WeZEYc4Cj67k/VXLTN+vD3/q8uMBEGsBo6ck7l pbdGSzhpaNAQ8pJvWbX98Fvk31LGlIINQiFgVfgrxKLrwrmI69GOSxpvghqh0rQRv8ry lsHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zLwvcGwr; 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 w22-v6si40327530plp.110.2018.11.19.08.38.31; Mon, 19 Nov 2018 08:38:46 -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=zLwvcGwr; 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 S1732170AbeKTDBa (ORCPT + 99 others); Mon, 19 Nov 2018 22:01:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:33418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730931AbeKTDB3 (ORCPT ); Mon, 19 Nov 2018 22:01:29 -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 2CBC1206BA; Mon, 19 Nov 2018 16:37:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542645440; bh=Lad2L+CXOQSGakWK6PhRkJ+CvE+5Q+8JPVeYXlNkHAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zLwvcGwrKhsPOAUrWu3Q1gmXBrU/MQPDQKbm4ThxLcJusFvXdUlTho/+L6D5hFwkN AzfO0zsw0EpnXdsDQI4d3Pv7q9AfD5GCP3VBoHzVEJ2LKJyCX/TCjfE7lGAGrqz7fM oRYqNM6Pqy+Gv41c/b5OozoY+Dyeng9eOsGYC8kw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andreas Gruenbacher Subject: [PATCH 4.19 163/205] gfs2: Put bitmap buffers in put_super Date: Mon, 19 Nov 2018 17:27:50 +0100 Message-Id: <20181119162639.772110952@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162616.586062722@linuxfoundation.org> References: <20181119162616.586062722@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.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andreas Gruenbacher 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.2+ Signed-off-by: Andreas Gruenbacher Signed-off-by: Greg Kroah-Hartman --- fs/gfs2/rgrp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -725,6 +725,7 @@ void gfs2_clear_rgrpd(struct gfs2_sbd *s if (gl) { glock_clear_object(gl, rgd); + gfs2_rgrp_brelse(rgd); gfs2_glock_put(gl); } @@ -1141,7 +1142,7 @@ static u32 count_unlinked(struct gfs2_rg * @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 */