From patchwork Wed Jan 17 09:23:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Su Yue X-Patchwork-Id: 13521519 Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 B6C5514274 for ; Wed, 17 Jan 2024 09:23:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705483409; cv=none; b=ia7gZfuzSriPgCjafIzD5mXzZu400SxK1lXCaz6DGXXIJ4e35omi9tFHMrFaIiSVVp8Z5QtxT6iAwDPuMPIppPQXQT4jNK3+lxaqsmAl82cgj0Z/BYTcgeBszcIOekmMNTqBkvZ5FUfbqDTOrnRS1WmfQKDRCidV/WJKAf7EuDA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705483409; c=relaxed/simple; bh=ZAC0gMTewDsyDKK+KtO6CsLORbCsrw14QrlNvQDIlg8=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; b=kGhFrx1htuCjGqeVwFjFD6NAd9/K/UJ40DJDRk959Fb5iGqRNwwQur2AeDjpfzv8hybHZ1K+NQpvrH4I3k+KJDrgg7sAULWQ+fb4w6DOcPkhDYgrtFMFsIL3XUZzh55qzxtEFVklivxxhkeYDZ7b+F00mfeA5Ib6USjHzw0PsGk= 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 (2048-bit key) header.d=suse.com header.i=@suse.com header.b=ARb1uo4+; arc=none smtp.client-ip=209.85.208.172 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 (2048-bit key) header.d=suse.com header.i=@suse.com header.b="ARb1uo4+" Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2cdeb808889so7163101fa.3 for ; Wed, 17 Jan 2024 01:23:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1705483404; x=1706088204; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=EfI3fIB++8nw+ASq5F8fuLbZ+fGhBjFlMzRTBNAgO5A=; b=ARb1uo4+X1tYggKCAQgz96JkYHnGvXsVXzRaAc2yf9fM6m1Bq/QRYVB9PrwJIxWy05 eIMf//dMrmuSLtwCLxIV/nkvn51qK4qabhZrjBKDXk86+wtavOSSss2QTWpJvdb61vNs tCXLnnRH3dZ/Y+FQpGUFu7uCPn5c0PDuPe6K6psaqT0ac9mQWlmT6pizYFdc0Yzzyb14 VkAHtCvmmcfuwPDgbR+rAvv6TYmHufEEQzEA+IeGDkT6NMv2Q1BUjGaV9r7h9TeKtYzU Vx9yARhfrbFdAPv21aUoNsGoukilaWkm9eRym1k0CZrKotL7i8gv09ABAsYRozEjUVqU 2kbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705483404; x=1706088204; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EfI3fIB++8nw+ASq5F8fuLbZ+fGhBjFlMzRTBNAgO5A=; b=gwdB40jfAsUXl0k/0hUPPRNTJ/nNq9RCst3yPjiHHcDvk4T7AKT8viyZCFEcFDcydF b/W5/D6zJDewWQfqMQa3hbxc/9zqu9gmQ5it0dnSbm9bC04lgt1NWTR9P8MdLmvUUqu/ 4fUGTf2BraaYSO7zxXZYeFOdc8Kt7RIACdA7tc68qRtDNxI/tFdnBxB8kUmgr5Q3PBz0 9p6I9HAhmvvEa9f7tW0cdB/WSUI7eISFWcAIVmX+7te8bw0LZ+JtqMzRGMb4JdzCth1M URfK1ymW2Y2+b1yVNcHoxpjd7A/5VfN0L5QcptG0H1QYoRKu/l3M4o1StcddfW3nNEni NFfg== X-Gm-Message-State: AOJu0Yy6k9Iky+9KG4h33itYIr68zRjScO3VFK4JkV9dgyrJPXS2mrAa 3R7SJtwiBaQlEUs9q6pNFiraDJhhcSBd1dwzpPlzvSVivOY= X-Google-Smtp-Source: AGHT+IFb5xxEErYLOic0etNAPoIwSC6V6gnM1l8IUklYxDo3T2Ka348d5/LCSQzWyh4K+/MHAjHw2A== X-Received: by 2002:a2e:9593:0:b0:2cd:9f94:f93a with SMTP id w19-20020a2e9593000000b002cd9f94f93amr3042130ljh.43.1705483404142; Wed, 17 Jan 2024 01:23:24 -0800 (PST) Received: from localhost.localdomain ([23.247.139.60]) by smtp.gmail.com with ESMTPSA id d3-20020a17090b004300b0028ceeca04a1sm13736472pjt.19.2024.01.17.01.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 01:23:23 -0800 (PST) From: Su Yue To: fstests@vger.kernel.org Cc: linux-bcachefs@vger.kernel.org, l@damenly.org, bfoster@redhat.com, Su Yue Subject: [PATCH v2 1/2] fstests: introduce MKFS_BCACHEFS_PROG for bcachefs Date: Wed, 17 Jan 2024 17:23:08 +0800 Message-ID: <20240117092309.1134595-1-glass.su@suse.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 mkfs.bcachefs supports force overwrite when option '-f' is given: $ mkfs.bcachefs --help | grep force -f, --force There are some tests which call _scratch_mkfs multiple times e.g. tests/generic/171. Without '-f' in MKFS_OPTIONS, these tests just hang in overwrite confirmation. After this commit, MKFS_BCACHEFS_PROG will contains ' -f' so we don't have to add '-f' to MKFS_OPTIONS manually to make these tests pass. It also fixes generic/466 which unsets MKFS_OPTIONS causing that test hangs in mfks.bcachefs waiting for confirmation of the force overwrite. Signed-off-by: Su Yue Reviewed-by: Brian Foster --- changelog: v2: Add more details about why MKFS_BCACHEFS_PROG should contain '-f'. --- common/config | 3 ++- common/rc | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/common/config b/common/config index c9771ff934cb..1f9edceec57a 100644 --- a/common/config +++ b/common/config @@ -105,7 +105,7 @@ set_mkfs_prog_path_with_opts() # Note: mkfs.f2fs doesn't support the --help option yet, but it doesn't # matter since it also prints the help when an invalid option is given. if [ "$p" != "" ] && \ - $p --help |& grep -q "[[:space:]]-f[[:space:]|]"; then + $p --help |& grep -q "[[:space:]]-f[[:space:]|,]"; then echo "$p -f" else echo $p @@ -313,6 +313,7 @@ export MKFS_REISER4_PROG=$(type -P mkfs.reiser4) export E2FSCK_PROG=$(type -P e2fsck) export TUNE2FS_PROG=$(type -P tune2fs) export FSCK_OVERLAY_PROG=$(type -P fsck.overlay) +export MKFS_BCACHEFS_PROG=$(set_mkfs_prog_path_with_opts bcachefs) # SELinux adds extra xattrs which can mess up our expected output. # So, mount with a context, and they won't be created. diff --git a/common/rc b/common/rc index 524ffa02aa6a..31c21d2a8360 100644 --- a/common/rc +++ b/common/rc @@ -611,6 +611,9 @@ _test_mkfs() xfs) $MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV ;; + bcachefs) + $MKFS_BCACHEFS_PROG $MKFS_OPTIONS $* $TEST_DEV > /dev/null + ;; *) yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $TEST_DEV ;; @@ -753,6 +756,10 @@ _scratch_mkfs() mkfs_cmd="yes | $MKFS_PROG -t $FSTYP --" mkfs_filter="grep -v -e ^mkfs\.ocfs2" ;; + bcachefs) + mkfs_cmd="$MKFS_BCACHEFS_PROG" + mkfs_filter="cat" + ;; *) mkfs_cmd="yes | $MKFS_PROG -t $FSTYP --" mkfs_filter="cat" @@ -1044,7 +1051,7 @@ _scratch_mkfs_sized() export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS" ;; bcachefs) - $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS --fs_size=$fssize --block_size=$blocksize $SCRATCH_DEV + $MKFS_BCACHEFS_PROG $MKFS_OPTIONS --fs_size=$fssize --block_size=$blocksize $SCRATCH_DEV ;; *) _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized" @@ -1128,8 +1135,7 @@ _scratch_mkfs_blocksized() -C $blocksize $SCRATCH_DEV ;; bcachefs) - ${MKFS_PROG} -t $FSTYP $MKFS_OPTIONS --block_size=$blocksize \ - $SCRATCH_DEV + _scratch_mkfs --block_size=$blocksize ;; udf) _scratch_mkfs -b $blocksize From patchwork Wed Jan 17 09:23:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Su Yue X-Patchwork-Id: 13521520 Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 4446A13AE0 for ; Wed, 17 Jan 2024 09:23:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705483410; cv=none; b=QPnCRKEGhisUy93NBn22gj0C4uJgD2v5Z5bU/E5Ny50pFC8ODmGIVhenk0Xr8hgusOas6d+irLh/NTo2bAal61zSb3vxLYplKgeVIWoABHA7SdlbtbrHwKdK/HrVJUiE/xX8jxbskQbrWWop9nSGqZAqD1mgvlnjREN8TjON6Zo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705483410; c=relaxed/simple; bh=BDh6mB/SB2Ipz+kXhSEegtCxOz1NHJLe2CHNIpGVoyo=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=FL9CCxqs8Zfk3mB3WiwF2BsIzuVK141V721Vkuzku09s/EL+JYaDSOlUeFjl5x/k/yEG3sHf1frxlfUqaC185d5zlNs32sZ7kXyP6iCdx3Gl8/7+IsGUVmZOMXyR0wZUL+3+j6/ffPE5KBIaZNyknZo7Rh3P+4PKl4j9FuXCykk= 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 (2048-bit key) header.d=suse.com header.i=@suse.com header.b=BhTDOHcL; arc=none smtp.client-ip=209.85.208.171 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 (2048-bit key) header.d=suse.com header.i=@suse.com header.b="BhTDOHcL" Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2cda523725bso40822051fa.3 for ; Wed, 17 Jan 2024 01:23:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1705483406; x=1706088206; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XkxyCEhENPLDVSdogBFfOHO8z8Jg872RrG1kJpGy2eI=; b=BhTDOHcLU3N67f2pxvraB+AMAeBl3HO3xRp2PxqX/1nZyoyEt6u0i7f2dDxff9BNbv eylbz9GyJx7qhA0D57S4aduPZadmYgMwjwPlTJm0x5C3o6LWkHNqceyLZKLjqHFJa4j+ OjJkPzTMfLaGsphckyBfX1lyxHicgQJK0DQzALWGXWmuMBLW1gA+gVGvwafFjptyZdla 6cNtF6Z19QhTN9YZ6UL45nWWK7/6KvPghREC/0LUfZBBAF5sexDuuXHZcJPHdQJNUVSy W2U7VHaWvNrSi3QSvRolXYWheWzIw2Pxm9boJ9dAt7sRTHFNv3k5eFqwf/Qu0SPAHa04 62hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705483406; x=1706088206; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XkxyCEhENPLDVSdogBFfOHO8z8Jg872RrG1kJpGy2eI=; b=JzkxnI5w5zTvTNanKsP3Eo++i7asDOZER1UIz6enhD8KmnzXSBe6bJ0rO8+raxRslo b+SWpTvBrQDmNROdjA/PeYXRIskxUrNGfUvZ1bNM3TZulptjpS3INPMwbtU/eXhkdX6/ I0Q2ESIcSqHwcE2HHaoBxKR+x+osl9Mruuh0G+f6BYsq7sZRlybSqKodzc1/cg3ptFEj QPNJ/o7cqjB8O1ASNNqzwxqDVRKjoKa3/1EZG6Sb8hvDkQTHAsyTyH6CShfkX/Za4v5G MfDyKEFXwO8AyxJWRwd6RBCnkQyfTeddDa8rTXoQg1WHKSe5w4uzYYg5XhjKDKy5Ryeg rEyQ== X-Gm-Message-State: AOJu0YxHOTx3L2jORHv8Fyu4aebh6JJ4aXOaTKPvTrk3lNZZHXLEFR73 asf4b/imTzg/A3DpapgbTz5EbkGxpowe7qDWs8wfrQPaFbs= X-Google-Smtp-Source: AGHT+IFKKQDeBO7Dr8rDB+IcBTSTJ43RzgUtfD6oilk1sO5Ug5Zgs6atHBvJd1+cNqN7u7IYf7+Qpw== X-Received: by 2002:a2e:8447:0:b0:2cd:7f14:9b33 with SMTP id u7-20020a2e8447000000b002cd7f149b33mr2401318ljh.51.1705483406318; Wed, 17 Jan 2024 01:23:26 -0800 (PST) Received: from localhost.localdomain ([23.247.139.60]) by smtp.gmail.com with ESMTPSA id d3-20020a17090b004300b0028ceeca04a1sm13736472pjt.19.2024.01.17.01.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 01:23:25 -0800 (PST) From: Su Yue To: fstests@vger.kernel.org Cc: linux-bcachefs@vger.kernel.org, l@damenly.org, bfoster@redhat.com, Su Yue Subject: [PATCH v2 2/2] common/rc: improve block size support for bcachefs Date: Wed, 17 Jan 2024 17:23:09 +0800 Message-ID: <20240117092309.1134595-2-glass.su@suse.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117092309.1134595-1-glass.su@suse.com> References: <20240117092309.1134595-1-glass.su@suse.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 For bcachefs, def_blksz is never assigned even MKFS_OPTIONS contains option '--block_size'. So block size of bcachefs on scratch dev is always 4096 if _scratch_mkfs_sized is called without second parameter. Add the pattern to set def_blksz if '--block_size' is given in MKFS_OPTIONS. Signed-off-by: Su Yue --- changelog: v2: Born. --- common/rc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/rc b/common/rc index 31c21d2a8360..6a01de69cf05 100644 --- a/common/rc +++ b/common/rc @@ -950,6 +950,9 @@ _scratch_mkfs_sized() jfs) def_blksz=4096 ;; + bcachefs) + def_blksz=`echo $MKFS_OPTIONS | sed -rn 's/.*(--block_size)[ =]?+([0-9]+).*/\2/p'` + ;; esac [ -n "$def_blksz" ] && blocksize=$def_blksz