Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3427036imu; Sun, 11 Nov 2018 14:51:19 -0800 (PST) X-Google-Smtp-Source: AJdET5fO7rRX1wiSJG2pI+EDCJG0htqfZSIfnZC3YwGqknUYd7ja9u//Gdj3YB2Icp6hEmckKmmZ X-Received: by 2002:a17:902:6b87:: with SMTP id p7-v6mr17958650plk.282.1541976679319; Sun, 11 Nov 2018 14:51:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541976679; cv=none; d=google.com; s=arc-20160816; b=FBLISKK7uJfZ3cezI8i7gyOJmjDOsLcKm1QrmzOtfgpCGnLYEi2NW+W5BZyrYBiUzI NUJGHVjSmC7LCgQxjdulQrdSOnFcZQuLzqAFEvpv8w6Bktv2NZXT42AT1BjRkkmXBeW5 GAnaWT0S6Nz9vGQ409V3DteimozDTAfjhSOPWhGLEU8nBav/C3ubomzRTlN2UoJCEqsg EQEel93dJTfpLVDMezTsT0gaTLVe9GpiUznp2nYv/wWElPKN9bF3JPsIgxpBWZZq0RmS Gc+QoHxqhHWhI9Sl2GncAFJyuJn7cWWJQWRte9Nc2ig3rB9YL5RmtQZ61hPb6DI6415l XEdg== 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=vm9KCU49X12q+46z7m9ACngMHOaPD6ILFIUodVSqc8M=; b=eFnV9d1XrxKEpShKHXiwfrqqKljUNv56NC7eEAq1u4drSeTys8tC++9r8jnPlosbiy WspdbesF9tjWkmgrBOXkCA4Wxg3XasCdlHojCCFl4/0ZEMF55VpKKcSUyL09TKLcjDQp aJcyRgOy8zzr+SKLSav+BWy96UhnV1FgTCOi2EbFVAm7Ds6vzJ9sG3P5nBMyh4xXFe3n ewzBA8tRnDQ/oGXn+I4YxM+Ft6Pqb32TeSv62cKNlsCYpTHKS1dUsKg2+u6LzpwBSqT/ 1brJQYvnInA3zl2lIP0sgD7La49nQQNVFh6Bn9OW59KaFhJSGy93geUrTmnvJ/FipHIq PZbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JDYFWYD1; 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 d3-v6si18215210pln.204.2018.11.11.14.51.04; Sun, 11 Nov 2018 14:51:19 -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=JDYFWYD1; 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 S2390993AbeKLIkq (ORCPT + 99 others); Mon, 12 Nov 2018 03:40:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:55530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404206AbeKLIXJ (ORCPT ); Mon, 12 Nov 2018 03:23:09 -0500 Received: from localhost (unknown [206.108.79.134]) (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 3BBD8223DD; Sun, 11 Nov 2018 22:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975592; bh=i3KjRKDLE0I+87vBD8iJuuJyZQT0dfJXx4tz4WTURpg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JDYFWYD1GVyRt12qFMJg/mbTOswei6X6VlGYphfiLIXxFPd8dh+q73Rq0UuWp38pD soefPe6wdYTPN29G0C1TguY99NGQNMFDPHoGi3gLGlHol6YUeO6jzD9XXnwKJjCqU2 xoJEilLOTb+ZIYypZFBIDc0PPfhSduqILL3jpSX8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liu Bo , Josef Bacik , David Sterba Subject: [PATCH 4.14 206/222] btrfs: reset max_extent_size on clear in a bitmap Date: Sun, 11 Nov 2018 14:25:03 -0800 Message-Id: <20181111221705.082892977@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Josef Bacik commit 553cceb49681d60975d00892877d4c871bf220f9 upstream. We need to clear the max_extent_size when we clear bits from a bitmap since it could have been from the range that contains the max_extent_size. CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Liu Bo Signed-off-by: Josef Bacik Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/free-space-cache.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -1710,6 +1710,8 @@ static inline void __bitmap_clear_bits(s bitmap_clear(info->bitmap, start, count); info->bytes -= bytes; + if (info->max_extent_size > ctl->unit) + info->max_extent_size = 0; } static void bitmap_clear_bits(struct btrfs_free_space_ctl *ctl,