Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2501936imm; Mon, 24 Sep 2018 05:33:22 -0700 (PDT) X-Google-Smtp-Source: ACcGV60xmIdZ/zZOTFg05h0RRBbwaSGzVMIoK0hdD+aJN5CrY/Dsa3c1JsG2/fuCK9dfC8G6REnB X-Received: by 2002:a63:df4e:: with SMTP id h14-v6mr9276279pgj.300.1537792402276; Mon, 24 Sep 2018 05:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792402; cv=none; d=google.com; s=arc-20160816; b=Rl1iZ7QNjRqDbPTgSGpSoaO3Ic7zBKg483m1EiVgJCxKl7MKxdW3PvxBhfxT7VnHsZ AS2C8wZ63q8e8EjDBLQpGkLNRenCUHAKMu4yIVPIncS0BGhDtwrPRLohgn7QucI0H5Xq eK4L/lNTH06x0nmSicfsvydl/k2DMZEXt/1o5t7P4UQMvpp5GipI1OzHEM54N9K0uq/c +gCIXYbZ4vuaIlco3rmoQ9VK+ZIREJD+7JT1eEslAeIqttP9JXiljY00OYUkN+uBGi37 EaaT9WB7Kb3M+0yhJlwwadd+twIssMo4qR3+8h7GpbDeze3EzBASBKWLNHTjr2xwP0RA D6Xw== 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=IhKorupNiHhi7hHCFDSF4rw+Nx5FCzaNf4P2kRD1eME=; b=ellS6Fr4xKzI5vwwPS7XXqTEnK0I2pQrRrw1HVzRysP+E3pEhI8RhY0OCQBkotOz9/ 34kvcXae03wGE5HWYN3FnzLhHFDQzaGGfgXvNhMuIL37H6EEzEPx8roihnOHXNAoKZNG 0z0fH6fd+MqJRHtgPG7oR3iIOYc6S+oq+u2clHwSZeqedtHyFP0nzfnOZZvwrmAcyYMI 3wTurBtJNbVB//uscC+wtEUhb9iopcUWhbfDiZiEsLNamcosVaMEwrcIr8bB34wkWBhO ybSj8z8XoQLfLpnC5/JEuG+PZ4RdE3rs2wNiPs/VoZZAz1eY2VX02yOCh0hENV+vEqC5 Bejw== 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 186-v6si3490412pfv.101.2018.09.24.05.33.06; Mon, 24 Sep 2018 05:33:22 -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 S2388087AbeIXSd4 (ORCPT + 99 others); Mon, 24 Sep 2018 14:33:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58050 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730184AbeIXSdz (ORCPT ); Mon, 24 Sep 2018 14:33:55 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D1ED11099; Mon, 24 Sep 2018 12:31:59 +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.18 046/235] gfs2: Dont reject a supposedly full bitmap if we have blocks reserved Date: Mon, 24 Sep 2018 13:50:32 +0200 Message-Id: <20180924113109.854450823@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@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.18-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 @@ -1686,7 +1686,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;