From patchwork Tue Mar 26 00:22:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13603206 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B65F37E for ; Tue, 26 Mar 2024 00:23:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711412595; cv=none; b=lLFBP2AZhSlfWu+OXT/aoxpHcgiqkuOchxdHlDrphqCRlHsS8HKCZJ06TXiwRrktGXJ0BIVkqHkcDe914jEebnKzG2yhQfjaLO60f64mO7hqHDVVr+efwUMk0QNkbf/9ez8uYNVGixoLRuL1Y/+nfEAqK7u/QUMa/x+TZd3vBf0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711412595; c=relaxed/simple; bh=P2weWB78Qzf2kBfY3TfFoxIJL/HR5ukJLalrHuq6Lis=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FS9MJBEf5D4Zl+1litzFZrXu5a03eQKrXc3MPuWn1o1q6VDxLNR0IXlQF/HVv8l3Nkb5+Km+O3mQlpY8lYBZkAdwl+JsQW9W7Je/LJybmIYL6r4wpCts+iwBXN2F2kmED66pVvnhY371FNf7SXAm3Xzpvb/5trB+g+vRbg0/wlk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=GhSUpv84; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=GhSUpv84; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="GhSUpv84"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="GhSUpv84" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 960805CE27 for ; Tue, 26 Mar 2024 00:23:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1711412591; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nJMxwXQPFbn9M5CBU9oGyRi9pdtjUjKZLxozyqXrwM0=; b=GhSUpv842bMydHtFJG4O+bIPRPKSsZ9DYlcZ6YsNunnVr1bYVZrZ9L3LpXlCrawa4MUF1p 6M/zr25x2QEkFfxqzandNSIxco+7PwHh6b9WeuR6hgQKsuV6+lloaXsXtDIhkYMA55VpDS LoH6MYM1sPz4qgQMsLI9RA44ChqdLKI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1711412591; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nJMxwXQPFbn9M5CBU9oGyRi9pdtjUjKZLxozyqXrwM0=; b=GhSUpv842bMydHtFJG4O+bIPRPKSsZ9DYlcZ6YsNunnVr1bYVZrZ9L3LpXlCrawa4MUF1p 6M/zr25x2QEkFfxqzandNSIxco+7PwHh6b9WeuR6hgQKsuV6+lloaXsXtDIhkYMA55VpDS LoH6MYM1sPz4qgQMsLI9RA44ChqdLKI= Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id A47B413586 for ; Tue, 26 Mar 2024 00:23:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id yBvoFW4VAmbOJAAAn2gu4w (envelope-from ) for ; Tue, 26 Mar 2024 00:23:10 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 1/6] btrfs-progs: remove unused header for tune/main.c Date: Tue, 26 Mar 2024 10:52:41 +1030 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Score: 3.83 X-Spamd-Result: default: False [3.83 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.07)[-0.369]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[32.43%] X-Spam-Level: *** Authentication-Results: smtp-out2.suse.de; none X-Spam-Flag: NO My clangd LSP server reports warning that "common/parse-utils.h" is not utilized at all. Just remove it. Signed-off-by: Qu Wenruo --- tune/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tune/main.c b/tune/main.c index 0fbf37dd4800..aa9f39d987ec 100644 --- a/tune/main.c +++ b/tune/main.c @@ -33,7 +33,6 @@ #include "common/open-utils.h" #include "common/device-scan.h" #include "common/messages.h" -#include "common/parse-utils.h" #include "common/string-utils.h" #include "common/help.h" #include "common/box.h" From patchwork Tue Mar 26 00:22:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13603207 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 025CF173 for ; Tue, 26 Mar 2024 00:23:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711412596; cv=none; b=Ivo5xrp4Gx51c11LKntbFQ6Jw6w30kfm6Y33a2iHJfXr6TLH5Jav1OM8vHTetIJ/9RJrJ+9tuV46f7LavgF0h8R8818Uo4ZbaVIBBU5d4vxfKkL/AASvTw8hv9gktZH6WzqfTDZukIFhylS52tDQEpMKWKBGwYHUjwssbhiKEVk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711412596; c=relaxed/simple; bh=5RjL8I2QRD7HhDPJwAHsBSEXx1BXdgcSyL4p55lIUcs=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E9cV+Xb7/3eSOJYLGaySD9BYnVX6VCTLH8kTd3EKw9p2+K/CyF4GYGj+KiQLx0d/9o1p6nSPywQZaHyXpvE5QM3iu0AESI0GmIIFUrY7tHpf8U+VZDCz23PaaCSc25D8hTjSEiXIm9vh5idTRbrxN0Dcx0GrtFpM4zvsWPyhPOo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=f5aqijCQ; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=f5aqijCQ; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="f5aqijCQ"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="f5aqijCQ" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0F1AB5CE28 for ; Tue, 26 Mar 2024 00:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1711412593; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7eZ5svEWEtzMaa6FcvFfBpA1NZNfT9qxx6JvzO+Y9CM=; b=f5aqijCQjI+z3aR38xw+YkMX6R0jzlLwNOl3O9+3/riwrFMAKZVFoOOD+fc+v5ylgTpyT7 UV70nhLRjOc4v15aDKT0FUwOAHVFCbk8dmg14SA0GKF44w4veJklYoW+O0sRX7j3zqjpIy 09D7jURCW265Mb7WUVgDyp20qY6T0PM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1711412593; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7eZ5svEWEtzMaa6FcvFfBpA1NZNfT9qxx6JvzO+Y9CM=; b=f5aqijCQjI+z3aR38xw+YkMX6R0jzlLwNOl3O9+3/riwrFMAKZVFoOOD+fc+v5ylgTpyT7 UV70nhLRjOc4v15aDKT0FUwOAHVFCbk8dmg14SA0GKF44w4veJklYoW+O0sRX7j3zqjpIy 09D7jURCW265Mb7WUVgDyp20qY6T0PM= Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 3320B13586 for ; Tue, 26 Mar 2024 00:23:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id KAPlNW8VAmbOJAAAn2gu4w (envelope-from ) for ; Tue, 26 Mar 2024 00:23:11 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 2/6] btrfs-progs: tune: add the missing newline for --convert-from-block-group-tree Date: Tue, 26 Mar 2024 10:52:42 +1030 Message-ID: <989f76ff228860f64742c7a6672c5f699fea0c18.1711412540.git.wqu@suse.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: * X-Spamd-Bar: + Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=f5aqijCQ X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [1.34 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-0.995]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-2.15)[95.92%] X-Spam-Score: 1.34 X-Rspamd-Queue-Id: 0F1AB5CE28 X-Spam-Flag: NO There is a missing newline for a successful --convert-from-block-group-tree run, meanwhile --convert-to-block-group-tree has the correct newline. Signed-off-by: Qu Wenruo --- tune/convert-bgt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tune/convert-bgt.c b/tune/convert-bgt.c index dd3a8c750604..1263b147241e 100644 --- a/tune/convert-bgt.c +++ b/tune/convert-bgt.c @@ -270,7 +270,7 @@ iterate_bgs: return ret; } pr_verbose(LOG_DEFAULT, - "Converted filesystem with block-group-tree to extent tree feature"); + "Converted filesystem with block-group-tree to extent tree feature\n"); return 0; error: From patchwork Tue Mar 26 00:22:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13603208 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48D3F1C32 for ; Tue, 26 Mar 2024 00:23:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711412598; cv=none; b=YBgMPxgf5Iwq37Ep9pRYQQrWNDR3Q57HIRlBDEAe4w9ROIOTeObcW0O8r+VOd4VHDr2IWnUg4s9/ZODs7QTAlY/nLcMwRJUz2NoskMlvo/295kfUPV6nmnpTftCWiWG+QbZ0UKpZgT3BHxumivIQuq4NbrOWuuPDxWtG1FLFLgE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711412598; c=relaxed/simple; bh=MlpIsCa5jFcKIuYVY7LL8bDrWcMJbFMIZEPxJs92X7I=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jGy++H7FtAX+MRkIRFN/yEFNcgDJZn4grR6mo2PJwUyibls06EHkkO0bn8XBQrK4+XqKK8THONYmy5Od9KuXGnfT+4pT254s+KNPBK0cNKvE2vFF12UXWZOVkE0p8decehmcekUcJiMAD6xgsBF/ptxHwdY1jJZjxREbj+hjay0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=oOxw7fGv; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=oOxw7fGv; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="oOxw7fGv"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="oOxw7fGv" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5D0C05CE29 for ; Tue, 26 Mar 2024 00:23:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1711412594; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KnQpUzP5gvjlC5TorASiHrgBpUrmdj1oNN2dAjhatTY=; b=oOxw7fGv8GgTc1QIFR9LouhPa4dM9PZVaInriiA6D1BFC+ERxNgS7nmlpma/wkzAySf3ac NZXdJZEbKMqaxMm2KjJ5AL0iIu/zjxGwyOdkjTHqbIoPBe/7Pkr85XbIBl41MOb+mg58nw iezU0s2RtFanrkkzl5pRhRE+Z8nRC20= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1711412594; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KnQpUzP5gvjlC5TorASiHrgBpUrmdj1oNN2dAjhatTY=; b=oOxw7fGv8GgTc1QIFR9LouhPa4dM9PZVaInriiA6D1BFC+ERxNgS7nmlpma/wkzAySf3ac NZXdJZEbKMqaxMm2KjJ5AL0iIu/zjxGwyOdkjTHqbIoPBe/7Pkr85XbIBl41MOb+mg58nw iezU0s2RtFanrkkzl5pRhRE+Z8nRC20= Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 86CEF13586 for ; Tue, 26 Mar 2024 00:23:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 2L99EnEVAmbOJAAAn2gu4w (envelope-from ) for ; Tue, 26 Mar 2024 00:23:13 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 3/6] btrfs-progs: mkfs: use proper zoned compatible write for bgt feature Date: Tue, 26 Mar 2024 10:52:43 +1030 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Score: 0.79 X-Spamd-Result: default: False [0.79 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.11)[-0.572]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Spam-Flag: NO [BUG] There is a bug report that mkfs.btrfs can not specify block-group-tree feature along with zoned devices: # mkfs.btrfs /dev/nullb0 -O block-group-tree,zoned btrfs-progs v6.7.1 See https://btrfs.readthedocs.io for more information. Resetting device zones /dev/nullb0 (40 zones) ... NOTE: several default settings have changed in version 5.15, please make sure this does not affect your deployments: - DUP for metadata (-m dup) - enabled no-holes (-O no-holes) - enabled free-space-tree (-R free-space-tree) ERROR: error during mkfs: Invalid argument [CAUSE] During mkfs, we need to write all the 7 or 8 tree blocks into the metadata zone, and since it's zoned device, we need to fulfill all the requirement for zoned writes, including: - All writes must be in sequential bytenr - Buffer must be aligned to sector size The sequential bytenr requirement is already met by the mkfs design, but the second requirement on memory alignment is never met for metadata, as we put the contents of a leaf in extent_buffer::data[], which is after a lot of small members. Thus metadata IO buffer would never be aligned to sector size (normally 4K). And we require btrfs_pwrite() and btrfs_pread() to handle the memory alignment for us. However in create_block_group_tree() we didn't use btrfs_pwrite(), but plain pwrite() call directly, which would lead to -EINVAL error due to memory alignment problem. [FIX] Just call btrfs_pwrite() instead of the plain pwrite() in create_block_group_tree(). Issue: #765 Signed-off-by: Qu Wenruo --- mkfs/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkfs/common.c b/mkfs/common.c index 5e56b33dda6d..3c48a6c120e7 100644 --- a/mkfs/common.c +++ b/mkfs/common.c @@ -249,8 +249,8 @@ static int create_block_group_tree(int fd, struct btrfs_mkfs_config *cfg, btrfs_set_header_nritems(buf, 1); csum_tree_block_size(buf, btrfs_csum_type_size(cfg->csum_type), 0, cfg->csum_type); - ret = pwrite(fd, buf->data, cfg->nodesize, - cfg->blocks[MKFS_BLOCK_GROUP_TREE]); + ret = btrfs_pwrite(fd, buf->data, cfg->nodesize, + cfg->blocks[MKFS_BLOCK_GROUP_TREE], cfg->zone_size); if (ret != cfg->nodesize) return ret < 0 ? -errno : -EIO; return 0; From patchwork Tue Mar 26 00:22:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13603209 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AB2023B1 for ; Tue, 26 Mar 2024 00:23:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711412599; cv=none; b=TQN4b0WBLakdXSVI/Z1QCSLJt60iBN4zkTxNiY/Epe7uSEr/8J4BKr7pfaTTsDUHVvicPhC4X6+J4vWt7MBj0/8Rh2J8wGLD51e0BXS7X/X8E6jyzVewbCWNVxXoUzGhKCbIkIboXr0cp+FQ9VGX5DLn7NdHtAAyfPGhnaC7V3A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711412599; c=relaxed/simple; bh=TLoZzAJgFtclxdz+bVm4I/xypgDh65k1pLqIZ4rMdiM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VXXJbFWn4cSJyngn0Yosl/gUbLsjCibWmN1R4nyfbwbKA0k6DFhLzhNJqPCuGTHuvcBYLvNYQ0Bb35ViOKzJjbb7V4FEwKwWJ4JdtOJ4zIfXyKUx55Eb5n30AP79s60XyYY22oJfQXt9M5LCh5Ekh++zqSPI32fXIj23CuIZQlk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=iLu9ybSD; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=iLu9ybSD; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="iLu9ybSD"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="iLu9ybSD" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B0B8822590 for ; Tue, 26 Mar 2024 00:23:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1711412595; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yn0I+VPJzKyPgs88lBqX0OtuZejhij5xS0iXaj0iFkA=; b=iLu9ybSDQQsRURjuggMODp65YHOdGjULVIMrC/23/63Kt6uJLkMSU/F+yolV3HKY9xqrnv Wwsm/lIf5e4nWceUNzgwmJzgdFZ7j2S2lTvg+WqPGO+MXotDz1QmZiYYui4FVM/nodAHZC 9I0qCDAEeDHwhxQMMeev1+1VuK1S5CQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1711412595; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yn0I+VPJzKyPgs88lBqX0OtuZejhij5xS0iXaj0iFkA=; b=iLu9ybSDQQsRURjuggMODp65YHOdGjULVIMrC/23/63Kt6uJLkMSU/F+yolV3HKY9xqrnv Wwsm/lIf5e4nWceUNzgwmJzgdFZ7j2S2lTvg+WqPGO+MXotDz1QmZiYYui4FVM/nodAHZC 9I0qCDAEeDHwhxQMMeev1+1VuK1S5CQ= Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id EDE7713586 for ; Tue, 26 Mar 2024 00:23:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id UITWJ3IVAmbOJAAAn2gu4w (envelope-from ) for ; Tue, 26 Mar 2024 00:23:14 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 4/6] btrfs-progs: tune: properly open zoned devices for RW Date: Tue, 26 Mar 2024 10:52:44 +1030 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Score: 3.82 X-Spamd-Result: default: False [3.82 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.08)[-0.400]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[14.73%] X-Spam-Level: *** Authentication-Results: smtp-out1.suse.de; none X-Spam-Flag: NO [BUG] There is a report that, for zoned devices btrfstune is unable to convert it to block group tree. # btrfstune /dev/nullb0 --convert-to-block-group-tree Error reading 1342193664, -1 Error reading 1342193664, -1 ERROR: cannot read chunk root ERROR: open ctree failed [CAUSE] For read-write opened zoned devices, all the read/write has to be aligned to its sector size. However btrfs stores its metadata by extent_buffer::data[], which has all the structures before it, thus never aligned to zoned device sector size. Normally we would require btrfs_pread() and btrfs_pwrite() to do the extra alignment, but during open_ctree(), we are not aware if a device is zoned or not. Thus we rely on if the fd is opened with O_DIRECT flag, if the fd has O_DIRECT, then we would temporarily set fs_info->zoned for chunk tree read. Unforunately not all open_ctree_fd() callers have the flags set properly, and btrfstune is one of the missing call site. This makes all the read not properly aligned and cause read failure. [FIX] Just manually check if the target device is a zoned one, and set O_DIRECT accordingly. Issue: #765 Signed-off-by: Qu Wenruo --- tune/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tune/main.c b/tune/main.c index aa9f39d987ec..397549837c18 100644 --- a/tune/main.c +++ b/tune/main.c @@ -29,6 +29,7 @@ #include "kernel-shared/transaction.h" #include "kernel-shared/volumes.h" #include "kernel-shared/free-space-tree.h" +#include "kernel-shared/zoned.h" #include "common/utils.h" #include "common/open-utils.h" #include "common/device-scan.h" @@ -193,6 +194,7 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) u64 super_flags = 0; int quota = 0; int fd = -1; + int oflags = O_RDWR; btrfs_config_init(); @@ -336,7 +338,9 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) } } - fd = open(device, O_RDWR); + if (zoned_model(device) == ZONED_HOST_MANAGED) + oflags |= O_DIRECT; + fd = open(device, oflags); if (fd < 0) { error("mount check: cannot open %s: %m", device); ret = 1; From patchwork Tue Mar 26 00:22:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13603210 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B23F83233 for ; Tue, 26 Mar 2024 00:23:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711412600; cv=none; b=aGP6MUbtzUm2dvOapIZIzSwxoj2WImnhQtHyDyTC6buTYzMGrmcL6Az/lY7UyKZcc4qzRf28R4rTgga836NxolPMzFS7uHLPWzG6oSGcQndGtUy8aASPV9L27lFz7PwNzafegUH9tIGJeyWesdGVxFVKBHq1sYTRFiufJVCq184= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711412600; c=relaxed/simple; bh=xmktfWVx7hK3fFpN9ZfZaOWSduk9zR+6XX7ljEdNy7o=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P9UxsHpoZ/FLDAvMW5XibCVfRDXeIUke+zy0k9S4kC6+X8tfDBZm4JBh35RgKU1OMXHOS1RR+LekT2xMWk7rnUXevNUu9l8s6IJPJ2SDgGQ32FTkPKS3M/Ipj80cQK9U0WOKpYtwIbQ94bQTW1bwksNkO8wvJd3OVyAxsf6HQt8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=tbs8zcz+; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=tbs8zcz+; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="tbs8zcz+"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="tbs8zcz+" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 248135CE25 for ; Tue, 26 Mar 2024 00:23:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1711412597; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AR0TTEjPd/C61+s6MmilNxXsq0kN/l5UkdS4mSjJKNs=; b=tbs8zcz+BpMiXoaJa5IcHQLtc0R3s00X4xHoz5IVHLQVe6H8xjQyRTQzG6ZOgbGl72kLZH XHnpIG0HIFC7fI4baUEBmXmXnHRuZq1K/t3UbOZ6HIilP1ayWk9E5MfwIKb2gRdU0Mswhx k/STGlGNpdz351yFMLYwvOD86fmck94= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1711412597; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AR0TTEjPd/C61+s6MmilNxXsq0kN/l5UkdS4mSjJKNs=; b=tbs8zcz+BpMiXoaJa5IcHQLtc0R3s00X4xHoz5IVHLQVe6H8xjQyRTQzG6ZOgbGl72kLZH XHnpIG0HIFC7fI4baUEBmXmXnHRuZq1K/t3UbOZ6HIilP1ayWk9E5MfwIKb2gRdU0Mswhx k/STGlGNpdz351yFMLYwvOD86fmck94= Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 3AEAC13586 for ; Tue, 26 Mar 2024 00:23:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id iDeMO3MVAmbOJAAAn2gu4w (envelope-from ) for ; Tue, 26 Mar 2024 00:23:15 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 5/6] btrfs-progs: tests-mkfs: add test case for zoned block group tree feature Date: Tue, 26 Mar 2024 10:52:45 +1030 Message-ID: <4bf6bc80f18c716d1cfd21f8f25c3552064c36a5.1711412540.git.wqu@suse.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=tbs8zcz+ X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [0.49 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-0.996]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Score: 0.49 X-Rspamd-Queue-Id: 248135CE25 X-Spam-Flag: NO Signed-off-by: Qu Wenruo --- tests/mkfs-tests/031-zoned-bgt/test.sh | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 tests/mkfs-tests/031-zoned-bgt/test.sh diff --git a/tests/mkfs-tests/031-zoned-bgt/test.sh b/tests/mkfs-tests/031-zoned-bgt/test.sh new file mode 100755 index 000000000000..91c107cd5a3b --- /dev/null +++ b/tests/mkfs-tests/031-zoned-bgt/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Verify mkfs for zoned devices support block-group-tree feature + +source "$TEST_TOP/common" || exit + +setup_root_helper +prepare_test_dev + +nullb="$TEST_TOP/nullb" +# Create one 128M device with 4M zones, 32 of them +size=128 +zone=4 + +run_mayfail $SUDO_HELPER "$nullb" setup +if [ $? != 0 ]; then + _not_run "cannot setup nullb environment for zoned devices" +fi + +# Record any other pre-existing devices in case creation fails +run_check $SUDO_HELPER "$nullb" ls + +# Last line has the name of the device node path +out=$(run_check_stdout $SUDO_HELPER "$nullb" create -s "$size" -z "$zone") +if [ $? != 0 ]; then + _fail "cannot create nullb zoned device $i" +fi +dev=$(echo "$out" | tail -n 1) +name=$(basename "${dev}") + +run_check $SUDO_HELPER "$nullb" ls + +TEST_DEV="${dev}" +# Use single as it's supported on more kernels +run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -m single -d single -O block-group-tree "${dev}" +run_check_mount_test_dev +run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT"/file bs=1M count=1 +run_check $SUDO_HELPER "$TOP/btrfs" filesystem usage -T "$TEST_MNT" +run_check_umount_test_dev + +run_check $SUDO_HELPER "$nullb" rm "${name}" From patchwork Tue Mar 26 00:22:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13603211 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78178442C for ; Tue, 26 Mar 2024 00:23:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711412602; cv=none; b=tjXHOth2zs5F2/W6ZfAmDR9iNusP+LH6vKEAPxCm3llZcR065wfY/ICyUfiwHmvM22Ur8cYcf4N1wjVndXoNCrArK9/Gq/C5REhra3E/Bk4ZDQ5u49jcFzI+l33RccS0PYNV081zCfg9flU93RQrCQIxFHe0BuzdrvdkR7jalM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711412602; c=relaxed/simple; bh=6qFWotBaRh3xKSe+GspsQt4Z1oIVqAShKghCdIY3YGw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZJ9aas9E1x6WRGHw/Gp8OOporbNuRBCALJzzULQq0JPoPVDtziSy91d/wGRolm3ysTrpFSeskOy7H0RZlI5RrFK6CNU9Oxh+UfhXXmQ+CVMxzjmb8JsZEYnIC963lalRESGDd7sUXUF6CFRy3B9IzPweBSUgxmsaMyr46D2LUzQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=n3cEvXZT; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=n3cEvXZT; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="n3cEvXZT"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="n3cEvXZT" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A7A145CE27 for ; Tue, 26 Mar 2024 00:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1711412598; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JxUTII/S0U5aofQ2nYiUooFyplSuZEkMIVtDfxuvjG8=; b=n3cEvXZTwHo6/FO2KLv0UE66VUt/Eovxb/cEUZz47ElYQwg6wG98vHDy4P7uSRAEPZ84bx KCVSO2nl81EmN4Edzt/haLROgc6ePzd28XupdF+7Tb7JRTCtoRh1fZ9kFb5Rij2tzSUHRR UsuxscGbMqnaT6o6dSV/cFajrs4xodY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1711412598; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JxUTII/S0U5aofQ2nYiUooFyplSuZEkMIVtDfxuvjG8=; b=n3cEvXZTwHo6/FO2KLv0UE66VUt/Eovxb/cEUZz47ElYQwg6wG98vHDy4P7uSRAEPZ84bx KCVSO2nl81EmN4Edzt/haLROgc6ePzd28XupdF+7Tb7JRTCtoRh1fZ9kFb5Rij2tzSUHRR UsuxscGbMqnaT6o6dSV/cFajrs4xodY= Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id B496C13586 for ; Tue, 26 Mar 2024 00:23:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 8IvYGXUVAmbOJAAAn2gu4w (envelope-from ) for ; Tue, 26 Mar 2024 00:23:17 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 6/6] btrfs-progs: tests-misc: add a test case to check zoned bgt conversion Date: Tue, 26 Mar 2024 10:52:46 +1030 Message-ID: <7d908ff898f01f5401cc0f2d9865873c09f884a7.1711412540.git.wqu@suse.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=n3cEvXZT X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [0.49 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-0.996]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Score: 0.49 X-Rspamd-Queue-Id: A7A145CE27 X-Spam-Flag: NO Add a new test case to make sure: - btrfstune can convert a zoned btrfs with extent tree to bgt - btrfstune can convert a zoned btrfs with bgt back to extent tree Signed-off-by: Qu Wenruo --- .../063-btrfstune-zoned-bgt/test.sh | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 tests/misc-tests/063-btrfstune-zoned-bgt/test.sh diff --git a/tests/misc-tests/063-btrfstune-zoned-bgt/test.sh b/tests/misc-tests/063-btrfstune-zoned-bgt/test.sh new file mode 100755 index 000000000000..dc2003cc78ab --- /dev/null +++ b/tests/misc-tests/063-btrfstune-zoned-bgt/test.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# Verify btrfstune for zoned devices with block-group-tree conversion + +source "$TEST_TOP/common" || exit + +setup_root_helper +prepare_test_dev + +nullb="$TEST_TOP/nullb" +# Create one 128M device with 4M zones, 32 of them +size=128 +zone=4 + +run_mayfail $SUDO_HELPER "$nullb" setup +if [ $? != 0 ]; then + _not_run "cannot setup nullb environment for zoned devices" +fi + +# Record any other pre-existing devices in case creation fails +run_check $SUDO_HELPER "$nullb" ls + +# Last line has the name of the device node path +out=$(run_check_stdout $SUDO_HELPER "$nullb" create -s "$size" -z "$zone") +if [ $? != 0 ]; then + _fail "cannot create nullb zoned device $i" +fi +dev=$(echo "$out" | tail -n 1) +name=$(basename "${dev}") + +run_check $SUDO_HELPER "$nullb" ls + +TEST_DEV="${dev}" + +# Create the fs without bgt +run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -m single -d single -O ^block-group-tree "${dev}" +run_check_mount_test_dev +run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT"/file1 bs=1M count=1 +run_check $SUDO_HELPER "$TOP/btrfs" filesystem usage -T "$TEST_MNT" +run_check_umount_test_dev + +# Convert to bgt +run_check $SUDO_HELPER "$TOP/btrfstune" --convert-to-block-group-tree "${dev}" +run_check_mount_test_dev +run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT"/file2 bs=1M count=1 +run_check $SUDO_HELPER "$TOP/btrfs" filesystem usage -T "$TEST_MNT" +run_check_umount_test_dev + +# And convert back to old extent tree +run_check $SUDO_HELPER "$TOP/btrfstune" --convert-from-block-group-tree "${dev}" +run_check_mount_test_dev +run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT"/file3 bs=1M count=1 +run_check $SUDO_HELPER "$TOP/btrfs" filesystem usage -T "$TEST_MNT" +run_check_umount_test_dev + +run_check $SUDO_HELPER "$nullb" rm "${name}"