From patchwork Thu Jul 19 14:50:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10534703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 64642601D2 for ; Thu, 19 Jul 2018 14:50:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A7FF29CB7 for ; Thu, 19 Jul 2018 14:50:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F66229CC7; Thu, 19 Jul 2018 14:50:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FE5929CB7 for ; Thu, 19 Jul 2018 14:50:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731993AbeGSPeI (ORCPT ); Thu, 19 Jul 2018 11:34:08 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:34277 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731977AbeGSPeH (ORCPT ); Thu, 19 Jul 2018 11:34:07 -0400 Received: by mail-qk0-f194.google.com with SMTP id b66-v6so4411407qkj.1 for ; Thu, 19 Jul 2018 07:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JbPiq0seDWDu/CUnbkzbsXcDYEqRjrbOGCsVmjvcdQc=; b=XxO+jxV5ErhqW2OS3qSTTx2G3YtUkyOPxiEcBvaml3Y+Lfm2edJCuqATAr4qUs1J/I PK6ZI5eSufVi9ctopRKcInbEWYYpeCSbzMDWxkYnz0A76hIlxJzfwGYSgmIHFyEKzZJz +Z6uvxn1s5ydi1EDmQYNXHDPcxwFwzAAV/NPj5ng0+rV0u4b1xTEhqXuZ+DeKY4uimLJ Apx+Shl7WXxUfWgeenDgMi0kdU7oPqQjI+WbtUo/VWbGe9EqkdbQcRCh8m0Jf+u+UW8X cpADm4fCzO5tjEzvEFm3GtLE9Wn7w5gPQH2PFvjzA2qO4y8hCfwbJ/yaZjFho5v7vBD0 42Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JbPiq0seDWDu/CUnbkzbsXcDYEqRjrbOGCsVmjvcdQc=; b=BaLaM2E7LsRUZsXJLAcRBQ7hcIDD4y8nz71R52YBHOGjm0sdl1ECibKOtx8t1nOwN/ tJXQAXz1qr7owPVZM/6XUOlFqXeR6CLeiKhBL/4Xr1NFg9v5/yZzu2/x0SeDtPAdZ2iC +EkLN8UVNfpse5E0fOEY+O38aVjRilH2YuVv7gnaC6wGi5vdw7GuMQ9Ll1D6eKxk/d6X YU/rUj53Le0mB0svQId+ghWJubebJrxUNpoOXAKeyKWbvGWskTJ0bOo96cyVsqEqaZV1 efaHcm20hiETcRdJipbEoNd0gtK4w9bIhESwgjU0iu72FUQ9dVu1ZhPNH0bcqNjGp5Tv 4CIQ== X-Gm-Message-State: AOUpUlEVaOycu04GdHQFA2QAf0Tw8LFFuPbLHZFg+sew55MQNuE/baD3 cmfIU2NKfpGOdIScS7ZQopPu52wN7NY= X-Google-Smtp-Source: AAOMgpf1+bUp/SRakcWCAnYpn+wtHucPM7v2ocEvSUJOYnjItwQH1FWCn5u5MV65T9zPpFJr2D02mQ== X-Received: by 2002:ae9:ef42:: with SMTP id d63-v6mr9043486qkg.99.1532011836178; Thu, 19 Jul 2018 07:50:36 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id v88-v6sm6176704qkv.63.2018.07.19.07.50.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jul 2018 07:50:35 -0700 (PDT) From: Josef Bacik To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Cc: Josef Bacik Subject: [PATCH 21/22] btrfs: reset max_extent_size on clear in a bitmap Date: Thu, 19 Jul 2018 10:50:05 -0400 Message-Id: <20180719145006.17532-21-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180719145006.17532-1-josef@toxicpanda.com> References: <20180719145006.17532-1-josef@toxicpanda.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Bacik 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. Signed-off-by: Josef Bacik --- fs/btrfs/free-space-cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 92e1c30356b9..0feb735a78a8 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -1691,6 +1691,8 @@ static inline void __bitmap_clear_bits(struct btrfs_free_space_ctl *ctl, 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,