Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2465895imm; Mon, 24 Sep 2018 05:00:44 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZsyBuetCMwi3RwjNp1v5DYxqcoxogOlCATK2l+ef7nH1gU4OJccgGFdGIBltXKmIVKfzUo X-Received: by 2002:a62:1016:: with SMTP id y22-v6mr10098159pfi.109.1537790444926; Mon, 24 Sep 2018 05:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537790444; cv=none; d=google.com; s=arc-20160816; b=ZX+LuQBiA9/Kj892YydsRXMAC6rD87uxUNBbAkDaeYqxqRwjMsIRU7hLkBGgEroZ1j 41o8pEMiqX2lHGm/uUaoC9A/CqqGl1887LlXm2FshSjPBUxkR4sTUlkuLErHLOGhUKlg 3FtFUXVh73foRjevPpCbzXo3ne3hoXvSaAwRMZKvNWQemZ+RP+NNUR8piM+GDkfaMSDU trO29qaek5HuVagd8jyNvuox8m4BoivrfaLN3OeMWaQxzCpaGwMLRkLw0ZtrR4flq+ej BJS/syl6fXVZ96d7HZMGUNWPR91tc0GR7VD57KYxGbxtpWN3L1daT+DCSHSXf71kfH5N hJeQ== 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; bh=8lKBqhpk/fTYR/4a6kT9N9Km9dAsJMIQbFujnX1Vsvg=; b=XkkDa5vIUpNCIDh+g0XjsO1rnzVPC2Nr9G/cyESbtlksQ2onCkZ+I3V3a4WV3uHC7w smOXdzRvcyUobodRdU+FoiReUfx7VTaVOyhDkocCdQfPzKrpVP4pl7CM6aRxFdEygw73 +ap7TITEhjitROzV1FGMlSkPUvpfP4fGVQHQxImnKNkVEYZcToNSKPUI8EFxajNgZ/Sq kvuPiHtIc6xRDj0w4drrAeENAXxIXx4p3ZAaUwwEKm/2lC0cn6wIsfgWpdzOJNyNjAdC x7+La+10Rwt31VI4xLSxv8n66jgLKwHtx2EF4+oFsjQ3BDnrwoCTKzJdSsG+4B2IIcd1 RHQg== ARC-Authentication-Results: i=1; mx.google.com; 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 m141-v6si37499746pfd.310.2018.09.24.05.00.29; Mon, 24 Sep 2018 05:00:44 -0700 (PDT) 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; 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 S1730551AbeIXSB3 (ORCPT + 99 others); Mon, 24 Sep 2018 14:01:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52558 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730210AbeIXSB3 (ORCPT ); Mon, 24 Sep 2018 14:01:29 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 374401076; Mon, 24 Sep 2018 11:59:43 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bob Peterson , Andreas Gruenbacher , Sasha Levin Subject: [PATCH 4.9 020/111] gfs2: Dont reject a supposedly full bitmap if we have blocks reserved Date: Mon, 24 Sep 2018 13:51:47 +0200 Message-Id: <20180924113106.368256456@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.337261320@linuxfoundation.org> References: <20180924113103.337261320@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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bob Peterson [ Upstream commit e79e0e1428188b24c3b57309ffa54a33c4ae40c4 ] Before this patch, you could get into situations like this: 1. Process 1 searches for X free blocks, finds them, makes a reservation 2. Process 2 searches for free blocks in the same rgrp, but now the bitmap is full because process 1's reservation is skipped over. So it marks the bitmap as GBF_FULL. 3. Process 1 tries to allocate blocks from its own reservation, but since the GBF_FULL bit is set, it skips over the rgrp and searches elsewhere, thus not using its own reservation. This patch adds an additional check to allow processes to use their own reservations. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher Signed-off-by: Sasha Levin 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 @@ -1675,7 +1675,8 @@ static int gfs2_rbm_find(struct gfs2_rbm while(1) { bi = rbm_bi(rbm); - if (test_bit(GBF_FULL, &bi->bi_flags) && + if ((ip == NULL || !gfs2_rs_active(&ip->i_res)) && + test_bit(GBF_FULL, &bi->bi_flags) && (state == GFS2_BLKST_FREE)) goto next_bitmap;