Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp892228imu; Fri, 11 Jan 2019 10:55:13 -0800 (PST) X-Google-Smtp-Source: ALg8bN66vUg/ZeU8yHzk1iZqPst0k4lmkHNR9I9q6W6NqigWC7Lh23moPMMy7tTTjAMAXUuhOdiW X-Received: by 2002:a17:902:4d46:: with SMTP id o6mr15070255plh.302.1547232913589; Fri, 11 Jan 2019 10:55:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547232913; cv=none; d=google.com; s=arc-20160816; b=BpWnXCEVrJ1saRrW7rpZYbjVd94PBYZ8K9oJ06/uRBGPlBQIiMpjpzO1/Xzi7rk/Is F7I/PHfyVtyXBS2z2rOTmNHgUQUN+3KTOr4fQRInwriFttepTJvauOOGVNwf7ZLSN1kX gEZsme/1pKc7X1kc+OGhHiRSnb8fYuy2KBM0nAOBNwqM/8eulVfITEy7zlSCbBCKQoUJ F74i6Dm7o/quEy5ntH/2CyCHlXHioLD5VlStfJcM5hkmYsZo5LIkzCK8Je9GJ0+zdT3D Yg9gpmdILyF95dbZp8eIIKj4GHPXVnKj5Vb576qV5fKlXrHiX5HTZ5IhGRrwfOTcwOkj 1kWg== 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=jtdhojOw0z6TM38/0iRdDer9OeJem1h2IGWr/UmhePc=; b=0CV5tUob49S+/ETTIqMsCl3F+P2bl0oZWX+nI7bFbPysACu6EAeG62Jjm0S1Sbm2Ri TY2Bn/O+aFH43Z/KKGDWDQqjAecJkC2QlvbP0Hs2qHX3uOt/CRMlggYddgIKjschAMm3 lWQoRDuNWqusKZl24SbPGPnZmMOlA7VxYTY4Gtp4ITgbkCx2xrYGjIYqpXtBEGXk46Lv zIYC67K97f0bxH3xLFusGumTE2gGj3BUfAyxkZ0E03Pg9WKvcbyrJdvODqpp+Eh4F845 hiIgU8+HyyJmrjVYh29HX0t1BSScZCq9OR/vE480oOQBvFmFi5XWn9CLnT2iXPKTku88 6rxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gLE1o7x6; 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 e1si1588062pln.55.2019.01.11.10.54.57; Fri, 11 Jan 2019 10:55: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=gLE1o7x6; 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 S1732559AbfAKOTw (ORCPT + 99 others); Fri, 11 Jan 2019 09:19:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:37046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732470AbfAKOTr (ORCPT ); Fri, 11 Jan 2019 09:19:47 -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 A1CE821783; Fri, 11 Jan 2019 14:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547216387; bh=wYsmSn2ouCW37Wts34VwFxpgEAybPpet+HuvSvQPf/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gLE1o7x6zBj099sjN/3HD3EM99F7vu15j9LQLqIc044B7s/6dnQqp7t1cJGxkMMdh LrcQZSSaf6L2Sr7fGeZIT+YGZGNrakx2UKUxykliGWfz1VfUiCno83fjUsfUxT+b1N vLWu+WiikFbUyD88E1SPaQOLhZPTSlT5qqPIKxg8= 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.4 80/88] gfs2: Fix loop in gfs2_rbm_find Date: Fri, 11 Jan 2019 15:08:49 +0100 Message-Id: <20190111131059.165494874@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131045.137499039@linuxfoundation.org> References: <20190111131045.137499039@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.4-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 @@ -1720,9 +1720,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;