From patchwork Wed Mar 22 10:27:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13183837 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1CF9C6FD1F for ; Wed, 22 Mar 2023 10:27:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230163AbjCVK1s (ORCPT ); Wed, 22 Mar 2023 06:27:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230248AbjCVK1o (ORCPT ); Wed, 22 Mar 2023 06:27:44 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CED760D68 for ; Wed, 22 Mar 2023 03:27:26 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AC29520C6C for ; Wed, 22 Mar 2023 10:27:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679480843; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sllq+v05JhcYygqJWx6y68B2NyXrHnYMJsuu/be8WpE=; b=abwAVKMmsFKYhAPYZ3yGN171LII3bRVZr0a8yJ0XROIsu5YvQKf3f1+y/lDPYKUlpppFnt tgr3v+xKRVdjcutEr3lPJ3QT0txg9vFm2d9OUjPmSYOR+TKX2/6R56YmoOCqkOvMiieohw pbkR75mQ00nb7xbHHSC7flYBUFqywrE= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 19DEB138E9 for ; Wed, 22 Mar 2023 10:27:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6pN5NgrYGmRyEgAAMHmgww (envelope-from ) for ; Wed, 22 Mar 2023 10:27:22 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 0/2] btrfs-progs: convert: follow default v2 cache setting Date: Wed, 22 Mar 2023 18:27:03 +0800 Message-Id: X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Although btrfs-convert has followed the new default setting in v5.15 release, it doesn't work. The problem is the convert workflow itself (making an temporary btrfs first, then sync the inodes) doesn't really create the free space tree nor the needed super block flags. And during the inodes sync phase, we generate v1 cache, causing the result btrfs to be v1 cache populated, and cause test case failure for subpage testing. This patchset would fix the converted btrfs at the final stage, by clearing the existing v1 cache first, then create and populate a valid free space tree, with needed super block flags. There seems to be a behavior change in mkfs.ext4 (e2fsprogs 1.47), that would create an orphan inode (with fixed ino number 12), and btrfs-convert would follow the ext4 to create an orphan in btrfs too, causing btrfs check to complain. So for now, I can not do convert testing due to the newly updated e2fsprogs... Qu Wenruo (2): btrfs-progs: make check/clear-cache.c to be separate from check/main.c btrfs-progs: convert: follow the default free space tree setting Makefile | 2 +- check/clear-cache.c | 84 ++++++++++++++++++++++++--------------------- check/clear-cache.h | 8 +++-- check/main.c | 6 ++-- convert/main.c | 23 +++++++++++++ 5 files changed, 76 insertions(+), 47 deletions(-) Reviewed-by: Neal Gompa