Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp648501imu; Fri, 11 Jan 2019 06:46:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN6iy5k+WHK5Ia33JAFW18UeZxGSwpQoAH3lS0tjGAxdIYV7Idz8oSfOeOVM6pU/OJBczokH X-Received: by 2002:a17:902:b68d:: with SMTP id c13mr14967665pls.102.1547218017396; Fri, 11 Jan 2019 06:46:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547218017; cv=none; d=google.com; s=arc-20160816; b=t51laD9gNy86VG/HnGE0v/t418o9h6cKzCat17LoFcwr+d7AdhuvG/eO5F2k6fEoDQ kdlSGwi0p33Ug+i+JpA7itsPKuFF0ShU3a8gkOQUrBXZRgx4tvbBiPne0Q7IUYFsBGhR IpkNBuwkMqx/bopnKZ0zmDJjUxw63TJ3MxN9FiblxqfTKaQm0VPyNv07jGFIJCHGhbJZ FZcs4aUCA3yiQGSUYuXkOizspxBUrqmEHpfqRDYjQloMvvdnJhG0YmVrAx5Hlaw57imZ W53lDdNcIX97Ro3BE+ChG6eMDSodQMZ1EfnQWTG9hXsHR+I2C9/2rsoM/8TEnsChU7Ck 8yIw== 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=tvEUBvbvydgvTDX1FOkhS+rFkpPhFpVMo2nT4hjoiDw=; b=zdakQH3i3NP7C5UFy4UzRgAL98QPJHwEbFPqy/I49SDZZN82+hQAxXeBWrVG35DbRw wP63JJ03tZ0jSXjxdl8Yc/DKjUn/l2RaunnB6dbImQmlcu6EgtKF1Lajzhy0YFPmni+p TwSGLfT93Hcv2HoYEbj/FCcH2rTkK+28DbmceTLtOXv4n/040bLGYDUT0qW2I1BK2XsW u++3ttM0PWkYC31Z6JSxu2buplm2REoPCkcVlLuy4KNKxfgcpIwCKVewJQyWrdQkjOO3 07ne3iHjZLYCqgaD3ULDNz07ACfBlmiolu7o1Ei4QTGmH/i7ZuaceKZ9SAFQKtNYkZKi KaPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xgsts8GL; 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 o10si21809831pgg.373.2019.01.11.06.46.42; Fri, 11 Jan 2019 06:46:57 -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=xgsts8GL; 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 S2404545AbfAKOoH (ORCPT + 99 others); Fri, 11 Jan 2019 09:44:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:37002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404527AbfAKOoC (ORCPT ); Fri, 11 Jan 2019 09:44:02 -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 E4B052063F; Fri, 11 Jan 2019 14:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547217842; bh=p0HcT2UTNZVTQY7pTc8FF5T6l2SMhd3UKSaZhQZN4E8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xgsts8GLRwCapOMF+1L7doZHY3wQuHQA+ao5BJqKpzVMGn01sRq4y+RIC02rjk+ys 6vMzYqGQ9wSnUpuigRYx2oczTKCTc9xkJZeyU1BEKuVaZo7aq5JyPmGrIf++H64pZ+ UhSJ1WXA2BgB87s7LcfP4gHWapuDGqIN3GFJZj5k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andreas Gruenbacher , Bob Peterson Subject: [PATCH 4.20 34/65] gfs2: Fix loop in gfs2_rbm_find Date: Fri, 11 Jan 2019 15:15:20 +0100 Message-Id: <20190111131101.050023821@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131055.331350141@linuxfoundation.org> References: <20190111131055.331350141@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andreas Gruenbacher commit 2d29f6b96d8f80322ed2dd895bca590491c38d34 upstream. Fix the resource group wrap-around logic in gfs2_rbm_find that commit e579ed4f44 broke. The bug can lead to unnecessary repeated scanning of the same bitmaps; there is a risk that future changes will turn this into an endless loop. Fixes: e579ed4f44 ("GFS2: Introduce rbm field bii") Cc: stable@vger.kernel.org # v3.13+ Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson Signed-off-by: Greg Kroah-Hartman --- fs/gfs2/rgrp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -1780,9 +1780,9 @@ static int gfs2_rbm_find(struct gfs2_rbm goto next_iter; } if (ret == -E2BIG) { + n += rbm->bii - initial_bii; rbm->bii = 0; rbm->offset = 0; - n += (rbm->bii - initial_bii); goto res_covered_end_of_rgrp; } return ret;