Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp777943ybc; Sat, 16 Nov 2019 08:31:14 -0800 (PST) X-Google-Smtp-Source: APXvYqy3Z2DrbG/dzPNQq3rqhJG/TjohfgX2kakV1rHNGedsRUVA2QcAt1pwbjcmfCLnoMmuQnTD X-Received: by 2002:a1c:453:: with SMTP id 80mr21314683wme.5.1573921873889; Sat, 16 Nov 2019 08:31:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573921873; cv=none; d=google.com; s=arc-20160816; b=CDdnm/68f9pDfkLXfFB1vMbmt3QMclzQTOnYCW9OqKGq38Z7kUC8Xz6+Lh9BNIKtWI 0zoq1xwo0E/oedtF/X7cjRWEwyGYw2YsGdXJXbjdgeQO2W0kAcrIbJTJgTCIJZsHl3Xg 8iAi7/i/O2LmZ0CKCWuAdyG1OLBdbYtDuUn8q/jz+Q0G/hvNeBdwn/Y/uRTzEGJFqgXM ePdOzCtHvMLDqSsZZKf7QCxvsoG4yPNJk+wbJdNArDqt7P1vNt2sJyhVCb2iSjzD/004 oEcPsGlBlMbYxAigyLhX2pjVbXZdP6fEuElYZeGb5oDoPZ7xxMBEt4dOPtSXTOAA2hy3 88RQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5vjeQUTQPgpxcyNlSQ4SEyrGZ+uX43l9xwlKfdo0Ems=; b=ikWlU0rNm1+LtXgiBSfuBmSBdz8AsDclqqjHey3Qlrdf5XZxFO1B/3TXbrD3ovcT3a Hgox6bOelvXvFD/TDYSNCQbsH1q+k6IOL/A4WLzQzphTKAUp7IhWVqsoDukSxnHxC48o 2fgRjN2LmbP3wJtyDbwwBKFCzeJRinxSGM6m2eWKLiCVRSZe4zRyyBK7nVPyAk4p63Uv s7Vr+tqaQLcM5qjpUwfLomrtqGW9NnviAvQkUhPuP9u9Xk5MwwendWjS/epJE1SahSnU YkvRBVdDIG2zpultDpk3gq1KAifeYcy+uohkoqjNlRgQU1Lxg4pQxAs2X06wl+vc/wZa XG6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="dW/pch07"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si5543675edy.215.2019.11.16.08.30.49; Sat, 16 Nov 2019 08:31:13 -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="dW/pch07"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730303AbfKPQ2c (ORCPT + 99 others); Sat, 16 Nov 2019 11:28:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:44284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727787AbfKPPlS (ORCPT ); Sat, 16 Nov 2019 10:41:18 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (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 D29B020718; Sat, 16 Nov 2019 15:41:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573918878; bh=cZn4iXRC8XXC1A2GT+r24CctYFg2qOugN2UwjcApNOY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dW/pch07ARbmHZsA5imR4fXxKr9eo5+qwJXiuyKd1PfkA8P4BnaUtkhdW9iKiezSB pKMHyj6pfqNL5qnDYAtPn0jZjL5vzXoPZAM1K9XaF+jROufiPjc7y1GMKbBLx3evE0 9BIdl2QBqHhWiFY9Ht2B9FXJZveZyRdwvVIVhVIA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andreas Gruenbacher , Bob Peterson , Steven Whitehouse , Sasha Levin , cluster-devel@redhat.com Subject: [PATCH AUTOSEL 4.19 007/237] gfs2: Fix marking bitmaps non-full Date: Sat, 16 Nov 2019 10:37:22 -0500 Message-Id: <20191116154113.7417-7-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andreas Gruenbacher [ Upstream commit ec23df2b0cf3e1620f5db77972b7fb735f267eff ] Reservations in gfs can span multiple gfs2_bitmaps (but they won't span multiple resource groups). When removing a reservation, we want to clear the GBF_FULL flags of all involved gfs2_bitmaps, not just that of the first bitmap. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson Reviewed-by: Steven Whitehouse Signed-off-by: Sasha Levin --- fs/gfs2/rgrp.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 449d0cb45a845..e37b40ec3f761 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -642,7 +642,10 @@ static void __rs_deltree(struct gfs2_blkreserv *rs) RB_CLEAR_NODE(&rs->rs_node); if (rs->rs_free) { - struct gfs2_bitmap *bi = rbm_bi(&rs->rs_rbm); + u64 last_block = gfs2_rbm_to_block(&rs->rs_rbm) + + rs->rs_free - 1; + struct gfs2_rbm last_rbm = { .rgd = rs->rs_rbm.rgd, }; + struct gfs2_bitmap *start, *last; /* return reserved blocks to the rgrp */ BUG_ON(rs->rs_rbm.rgd->rd_reserved < rs->rs_free); @@ -653,7 +656,13 @@ static void __rs_deltree(struct gfs2_blkreserv *rs) it will force the number to be recalculated later. */ rgd->rd_extfail_pt += rs->rs_free; rs->rs_free = 0; - clear_bit(GBF_FULL, &bi->bi_flags); + if (gfs2_rbm_from_block(&last_rbm, last_block)) + return; + start = rbm_bi(&rs->rs_rbm); + last = rbm_bi(&last_rbm); + do + clear_bit(GBF_FULL, &start->bi_flags); + while (start++ != last); } } -- 2.20.1