Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87D2AC43217 for ; Mon, 11 Oct 2021 14:07:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 766DA60EB1 for ; Mon, 11 Oct 2021 14:07:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239453AbhJKOJp (ORCPT ); Mon, 11 Oct 2021 10:09:45 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:48864 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238614AbhJKOHm (ORCPT ); Mon, 11 Oct 2021 10:07:42 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 4C51422095; Mon, 11 Oct 2021 14:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1633961141; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WvlLUOJ73GL9GdTuw6Gd9XKUwbSGm9DROY5AkJkRFKI=; b=i4utq5ztkWYL+Rcpcz/CrxQBnA0HIA+I6UziEvKda2rpJohxENE2ykiWnRo6HvsCAgiSfC gIl8tPLHnWGnfPnZ10mZx9L/dJR5XXcr8xIJ2tLl06UpQeu/cKpAyxNCJWO6hJoBKQcTQa Ns7+FIyg7xKNVRwQJ5Z9xHLgUvCICCA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1633961141; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WvlLUOJ73GL9GdTuw6Gd9XKUwbSGm9DROY5AkJkRFKI=; b=OLcl6D77jBQBKyAvRYREKl8ire1IDkTpIctJGnV0hDibAZJEcLKcipWWN+en1Fw6tvVWc3 k7o19FMu2gVq8ZBQ== Received: from ds.suse.cz (ds.suse.cz [10.100.12.205]) by relay2.suse.de (Postfix) with ESMTP id 44E1BA3C69; Mon, 11 Oct 2021 14:05:41 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 3F129DA781; Mon, 11 Oct 2021 16:05:18 +0200 (CEST) Date: Mon, 11 Oct 2021 16:05:18 +0200 From: David Sterba To: Qu Wenruo Cc: linux-btrfs@vger.kernel.org Subject: Re: [PATCH v2 0/3] btrfs-progs: mkfs: make sure we can clean up all temporary chunks Message-ID: <20211011140517.GI9286@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Qu Wenruo , linux-btrfs@vger.kernel.org References: <20211011120650.179017-1-wqu@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211011120650.179017-1-wqu@suse.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Mon, Oct 11, 2021 at 08:06:47PM +0800, Qu Wenruo wrote: > There is a bug report that with certain mkfs options, mkfs.btrfs may > fail to cleanup some temporary chunks, leading to "btrfs filesystem df" > warning about multiple profiles: > > WARNING: Multiple block group profiles detected, see 'man btrfs(5)'. > WARNING: Metadata: single, raid1 > > The easiest way to reproduce is "mkfs.btrfs -f -R free-space-tree -m dup > -d dup". > > It turns out that, the old _recow_root() can not handle tree levels > 0, > while with newer free space tree creation timing, the free space tree > can reach level 1 or higher. > > To fix the problem, Patch 2 will do the proper full tree re-CoW, with > extra transaction commitment to make sure all free space tree get > re-CoWed. The extra commit breaks assumptions of test misc/038 that looks up the backup roots in particular slot(s). I already had to fix it once due to the additional commit with free space tree. Now it broke again, the test is too fragle, I'm not sure we want to keep doing the whack-a-mole.