From patchwork Tue May 25 22:19:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 12280279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 704CAC47086 for ; Tue, 25 May 2021 22:20:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 515F161409 for ; Tue, 25 May 2021 22:20:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230110AbhEYWVg (ORCPT ); Tue, 25 May 2021 18:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbhEYWVf (ORCPT ); Tue, 25 May 2021 18:21:35 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DE0DC061574; Tue, 25 May 2021 15:20:04 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id v4so24326227qtp.1; Tue, 25 May 2021 15:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Mn8Q53wlifLTa0WvkY7Jksh0Xjl0mA8Gm4pP8e3OZQI=; b=kv954D00tM6ek/CV5hyl++Pe3kYvM31zUGDlgw+djtqQqz5GqWSwUthM42LfzJ6PCK dsjXhYSeWFOvSf9npa0hf1ZwGsCiiHa+7+asH66OUEdq3df23UC7usxIjzw9L2pNExmy WVm1C7ZyDYzdlOwoNyWHW2myj2FIosn0Y7vQsOz6S5nu9qkb0LpoM7OSzjA9qct7GiJH e1xMPQ29JHBIUUZD/s9K3zSw3ZA49mw1AR4a3dD3H3UiYUoCAaomcMExIqVWhW7yDUbf GrSRZvv8/l2flynbwNWpEzkCHAheGcZYFDTLzGkOQlQaErD2zeejJyxXAzmSvLEqoRjt C57A== 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:mime-version :content-transfer-encoding; bh=Mn8Q53wlifLTa0WvkY7Jksh0Xjl0mA8Gm4pP8e3OZQI=; b=C80wSqiImR8Batl82E3hYBXWrJRn+lstURQWkzppz8GN2n6o6+1m23GDFdrGcXctDT s9qEJQzxFcDg30P+iNp4u8FL6IxshRMOu+9LVBvcCjoAx2Frd6Pf3PygNVYmUpnvx/mg jYYSMvcnZk0ZwGJmhc9kAthuKV/p1Le3URi6TD5IyX4wLCzfvkS22ulsV3j9xi2ODzuw 2WkkWHy6TE+CrhcyWX9LCPl4THAe71AUX6qvJ+09zQPVS2r1ohZcpBMRyjKpDeeztt0s 0R4RyrKzHKWDaGtpwwZq408pOU/mCsPtVVyVQDGZVhrOBTdkLx81JUd2XkkU5jvUwwlu ofLg== X-Gm-Message-State: AOAM532LIfHqYOHoqai7qOyQQjMnAbpX5Fx6/o+v7BV9mJG/tRT1V9Yz oGHCOxt8ESZ0xTLJPhd4/VyU6wlkCwP7 X-Google-Smtp-Source: ABdhPJwSTTViOlyf6jZmOmnl7d9rxE6TwqKX1N89bydicuBo7MMOOrlJlXCgaOputn3BvZwrH4c2cQ== X-Received: by 2002:ac8:7ed2:: with SMTP id x18mr33538716qtj.26.1621981203430; Tue, 25 May 2021 15:20:03 -0700 (PDT) Received: from moria.home.lan (c-73-219-103-14.hsd1.vt.comcast.net. [73.219.103.14]) by smtp.gmail.com with ESMTPSA id m10sm333445qkk.113.2021.05.25.15.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 15:20:03 -0700 (PDT) From: Kent Overstreet To: fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org Cc: Kent Overstreet Subject: [PATCH 1/4] Improved .gitignore Date: Tue, 25 May 2021 18:19:48 -0400 Message-Id: <20210525221955.265524-1-kent.overstreet@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Ignore dotfiles, tags, and verifier state. Signed-off-by: Kent Overstreet --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 4cc9c80724..64e4ed253f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ .dep .libs .ltdep +.* +*.state +tags /local.config /results From patchwork Tue May 25 22:19:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 12280281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 533AEC4707F for ; Tue, 25 May 2021 22:20:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 326766140B for ; Tue, 25 May 2021 22:20:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230262AbhEYWVh (ORCPT ); Tue, 25 May 2021 18:21:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230191AbhEYWVg (ORCPT ); Tue, 25 May 2021 18:21:36 -0400 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AF60C061756; Tue, 25 May 2021 15:20:05 -0700 (PDT) Received: by mail-qk1-x72b.google.com with SMTP id h20so16606535qko.11; Tue, 25 May 2021 15:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u2BiTeXky6V2PqfyD5Afd5g5sd0MTSBoPrFa0V/c9TY=; b=sHYg/jsb6l6q8Jiz76XqCKtj80Tm20E9SJ0FhXFLPLmLUxYtFo85QFh4hLxxS8OVal FvIdR8OZsG2s++EVBSO+DYb3sVbKP/KK9NXUb/fyQ09RTUlIe6sadJsv4kvxFKCAWYFD 4xGCXJpKjJQVoY7jIMzAZl0fuG6JWwfHwQLSt628d1TooxW8eDzLzys4S3r3i+lAP1L0 Q43tZ0y2sbJqrY6xJMgoOnaSko/QWotoCs8Q9ykpcMhq3V7zjEAhe9/kz0hJvEvYVrNM h6KQ8btNFJLp2FA96IUmm2mg+Gp6YPOFvfzRm4eIV64BsI7OFWY1xmW6trBk479yCNmT DAVA== 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:mime-version:content-transfer-encoding; bh=u2BiTeXky6V2PqfyD5Afd5g5sd0MTSBoPrFa0V/c9TY=; b=hZuHBUKWGeIsUWfdg05kaOa5FeFAr29LoQu9Dcu/cIuuTy+Rauzh0wyh5IUYJGsdoL RIpKx5GYlYEveumalG9+vZfHYrHWe0XK8gp9ZQLcCp/gO5AMsUaeWnQY5LCqfzYsKzqh NMkeysIqcGt3VRKO29XkaNROU28cPshR7w+5YSEK+mTNmqYNDtNgKhSyvrbrKqS7D2ht ICDYS/TxeaAmX/j7dqi4HvOwQBNRK62AfMcHqwvcwxpxdRh7K6kkskFsL//jsTAClVOd OO8BTOkS4nFAxwCwVpE+7PCyobsLYku4Ky8rW7V1HUnNnTs0KoHSQV6QCFyJym3zUxc0 Ne/g== X-Gm-Message-State: AOAM531WAqdVws0YzhmpJADFDVB2HA63dSSbuom1PELh/Du8fhfm0TNz SyDAa4vjI+p13fcuSg/m0jkcTgnwLAjb X-Google-Smtp-Source: ABdhPJwjKXHfGUMTJOYusoujfxokOXhqK4vqSqdCUogHhldq3GgoejPOlvliVVWo59d9NgLY+pPz/w== X-Received: by 2002:a37:7fc5:: with SMTP id a188mr36404178qkd.279.1621981204208; Tue, 25 May 2021 15:20:04 -0700 (PDT) Received: from moria.home.lan (c-73-219-103-14.hsd1.vt.comcast.net. [73.219.103.14]) by smtp.gmail.com with ESMTPSA id m10sm333445qkk.113.2021.05.25.15.20.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 15:20:03 -0700 (PDT) From: Kent Overstreet To: fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org Cc: Kent Overstreet Subject: [PATCH 2/4] Initial bcachefs support Date: Tue, 25 May 2021 18:19:49 -0400 Message-Id: <20210525221955.265524-2-kent.overstreet@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525221955.265524-1-kent.overstreet@gmail.com> References: <20210525221955.265524-1-kent.overstreet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org To get started, you'll need to get bcachefs from the kernel repository https://evilpiepirate.org/git/bcachefs.git/ and tools from https://evilpiepirate.org/git/bcache-tools.git/ Build kernel as normal, enabling CONFIG_BCACHEFS_FS (and probably CONFIG_BCACHEFS_DEBUG), and build and install tools. Then running fstests is exactly the same as other local filesystems - just set FSTYP=bcachefs Also see https://evilpiepirate.org/git/ktest.git/ for a tool for conveniently building kernel and running fstests inside a qemu VM. This patch also updates generic/441 to run the more thorough test on bcachefs, and generic/425 to not run on bcachefs (since bcachefs does not store xattrs in blocks) Signed-off-by: Kent Overstreet --- common/attr | 6 ++++++ common/config | 3 +++ common/quota | 4 ++-- common/rc | 11 +++++++++++ tests/generic/425 | 3 +++ tests/generic/441 | 2 +- 6 files changed, 26 insertions(+), 3 deletions(-) diff --git a/common/attr b/common/attr index 669909d600..42ceab9233 100644 --- a/common/attr +++ b/common/attr @@ -33,6 +33,9 @@ _acl_get_max() echo 506 fi ;; + bcachefs) + echo 251 + ;; *) echo 0 ;; @@ -273,6 +276,9 @@ pvfs2) 9p|ceph|nfs) MAX_ATTRVAL_SIZE=65536 ;; +bcachefs) + MAX_ATTRVAL_SIZE=1024 + ;; *) # Assume max ~1 block of attrs BLOCK_SIZE=`_get_block_size $TEST_DIR` diff --git a/common/config b/common/config index 1a26934985..ad1c9eb092 100644 --- a/common/config +++ b/common/config @@ -416,6 +416,9 @@ _mkfs_opts() btrfs) export MKFS_OPTIONS="$BTRFS_MKFS_OPTIONS" ;; + bcachefs) + export MKFS_OPTIONS=$BCACHEFS_MKFS_OPTIONS + ;; *) ;; esac diff --git a/common/quota b/common/quota index 32a9a55593..883a28a20d 100644 --- a/common/quota +++ b/common/quota @@ -17,7 +17,7 @@ _require_quota() _notrun "Installed kernel does not support quotas" fi ;; - gfs2|ocfs2) + gfs2|ocfs2|bcachefs) ;; xfs) if [ ! -f /proc/fs/xfs/xqmstat ]; then @@ -278,7 +278,7 @@ _check_quota_usage() VFS_QUOTA=0 case $FSTYP in - ext2|ext3|ext4|ext4dev|f2fs|reiserfs|gfs2) + ext2|ext3|ext4|ext4dev|f2fs|reiserfs|gfs2|bcachefs) VFS_QUOTA=1 quotaon -f -u -g $SCRATCH_MNT 2>/dev/null ;; diff --git a/common/rc b/common/rc index b18cf61e8a..a0aa7300dc 100644 --- a/common/rc +++ b/common/rc @@ -1065,6 +1065,9 @@ _scratch_mkfs_sized() fi export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS" ;; + bcachefs) + $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS --fs_size=$fssize --block_size=$blocksize $SCRATCH_DEV + ;; *) _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized" ;; @@ -1133,6 +1136,9 @@ _scratch_mkfs_blocksized() ocfs2) yes | ${MKFS_PROG} -t $FSTYP -F $MKFS_OPTIONS -b $blocksize -C $blocksize $SCRATCH_DEV ;; + bcachefs) + ${MKFS_PROG} -t $FSTYP $MKFS_OPTIONS --block_size=$blocksize $SCRATCH_DEV + ;; *) _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_blocksized" ;; @@ -1179,6 +1185,11 @@ _repair_scratch_fs() fi return $res ;; + bcachefs) + # With bcachefs, if fsck detects any errors we consider it a bug and we + # want the test to fail: + _check_scratch_fs + ;; *) local dev=$SCRATCH_DEV local fstyp=$FSTYP diff --git a/tests/generic/425 b/tests/generic/425 index 51cbe1c67d..be2bc1b02e 100755 --- a/tests/generic/425 +++ b/tests/generic/425 @@ -30,6 +30,9 @@ _cleanup() # real QA test starts here _supported_fs generic + +[ $FSTYP = bcachefs ] && _notrun "bcachefs does not store xattrs in blocks" + _require_scratch _require_attrs _require_xfs_io_command "fiemap" "-a" diff --git a/tests/generic/441 b/tests/generic/441 index bedbcb0817..814387b2a9 100755 --- a/tests/generic/441 +++ b/tests/generic/441 @@ -40,7 +40,7 @@ case $FSTYP in btrfs) _notrun "btrfs has a specialized test for this" ;; - ext3|ext4|xfs) + ext3|ext4|xfs|bcachefs) # Do the more thorough test if we have a logdev _has_logdev && sflag='' ;; From patchwork Tue May 25 22:19:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 12280283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D23A5C4708A for ; Tue, 25 May 2021 22:20:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B401A61404 for ; Tue, 25 May 2021 22:20:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230191AbhEYWVi (ORCPT ); Tue, 25 May 2021 18:21:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbhEYWVh (ORCPT ); Tue, 25 May 2021 18:21:37 -0400 Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DECBC06175F; Tue, 25 May 2021 15:20:06 -0700 (PDT) Received: by mail-qk1-x735.google.com with SMTP id f18so32094367qko.7; Tue, 25 May 2021 15:20:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d9a11YZ/p1awTBwVbz3YzCFeSTuy6nImBmPUHPega8M=; b=XX0Uvnr2luYU/EOjFVeTq8gxUKKhmykyff/2yFv8fP1A8ym6dWZv+tsaX5S7Z9LVHJ qH+sJn/XDHilLxEeMDdrISB1W5PGWetEaGhbT/UY2V5tRD4PrZ+32DHv6EzPcFsis7kf 0jy5jnbAVEPzFwzttwjUg792CKDbx+KigZt50ftPD2kNcN0SCfVGCnNS9LNPQuzTmePj 5ddpt3F5KIMrTW8VIuNule7p54Pnl3Q6WmhrL6LueX9mMfxJrssbmsNmCU9Cevsz+8nl 7cgnq0bixOwtn7BKN9hqXte4OVmA9vrQvHMvk4LM/RQ8y8It1utq+efpndlD+oov7PvN rztQ== 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:mime-version:content-transfer-encoding; bh=d9a11YZ/p1awTBwVbz3YzCFeSTuy6nImBmPUHPega8M=; b=jryrNRx3KC1asqAZc2Iqir+RXNH9AAd/BGFOHiH/rV+N9xDczgUny2zD2LNd80s3AW GQASeGGvXvgkG6IXllF4Ioq9NPLzrK0qZjwZ66eXo/UHFbMdclvHkIvIA+xJnjbk0Yot b59A5m3nm/ScNFJt5fHmB53zzwIC3LOd4kVAnnj02uwTTs3Ao5kzrKdBVgyQD6SV2fQX fdekobLqIgzg/jBUuCXAnVpWEWh0v/KjJK+z5CTpd/prxiSWLpj+a3OtOQqmovHws7QY iEH2H9I3sCvnnbA72EJBxNcWf9NBU8Y98QAkgnVhJdHfsNIqL7eg5qBJDIeCBPYa9P+c XoFQ== X-Gm-Message-State: AOAM530LiKHgVfiw/nb1IY15LNT880KBZM+5xV4E7mDCoDc116XkxNOS GwpJwtgGseLt8olzQs2Cneu4W2fSu+c9 X-Google-Smtp-Source: ABdhPJzreItQbekpelo4f7bZiXM6Bnpr5GTWokRklhms9dvhT+gpm0gyKZryv/cWHl9knkQETQfv7Q== X-Received: by 2002:a05:620a:745:: with SMTP id i5mr27173408qki.324.1621981205119; Tue, 25 May 2021 15:20:05 -0700 (PDT) Received: from moria.home.lan (c-73-219-103-14.hsd1.vt.comcast.net. [73.219.103.14]) by smtp.gmail.com with ESMTPSA id m10sm333445qkk.113.2021.05.25.15.20.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 15:20:04 -0700 (PDT) From: Kent Overstreet To: fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org Cc: Kent Overstreet Subject: [PATCH 3/4] generic/{455,457,482}: make dmlogwrites tests work on bcachefs Date: Tue, 25 May 2021 18:19:50 -0400 Message-Id: <20210525221955.265524-3-kent.overstreet@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525221955.265524-1-kent.overstreet@gmail.com> References: <20210525221955.265524-1-kent.overstreet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org bcachefs has log structured btree nodes, in addition to a regular journal, which means that unless we replay to markers in the log in the same order that they happened and are careful to avoid writing in between replaying to different events - we need to wipe and start fresh each time. Signed-off-by: Kent Overstreet --- tests/generic/455 | 14 ++++++++++++++ tests/generic/457 | 14 ++++++++++++++ tests/generic/482 | 27 ++++++++++++++++++++------- 3 files changed, 48 insertions(+), 7 deletions(-) diff --git a/tests/generic/455 b/tests/generic/455 index 5b4b242e74..6dc46c3c72 100755 --- a/tests/generic/455 +++ b/tests/generic/455 @@ -35,6 +35,17 @@ _require_dm_target thin-pool rm -f $seqres.full +_reset_dmthin() +{ + # With bcachefs, we need to wipe and start fresh every time we replay to a + # different point in time - if we see metadata from a future point in time, + # or an unrelated mount, bcachefs will get confused: + if [ "$FSTYP" = "bcachefs" ]; then + _dmthin_cleanup + _dmthin_init $devsize $devsize $csize $lowspace + fi +} + check_files() { local name=$1 @@ -44,6 +55,7 @@ check_files() local filename=$(basename $i) local mark="${filename##*.}" echo "checking $filename" >> $seqres.full + _reset_dmthin _log_writes_replay_log $filename $DMTHIN_VOL_DEV _dmthin_mount local expected_md5=$(_md5_checksum $i) @@ -101,6 +113,7 @@ _dmthin_check_fs # check pre umount echo "checking pre umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log last $DMTHIN_VOL_DEV _dmthin_mount _dmthin_check_fs @@ -111,6 +124,7 @@ done # Check the end echo "checking post umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log end $DMTHIN_VOL_DEV _dmthin_mount for j in `seq 0 $((NUM_FILES-1))`; do diff --git a/tests/generic/457 b/tests/generic/457 index ddbd90cf0c..f17d4e4430 100755 --- a/tests/generic/457 +++ b/tests/generic/457 @@ -37,6 +37,17 @@ _require_dm_target thin-pool rm -f $seqres.full +_reset_dmthin() +{ + # With bcachefs, we need to wipe and start fresh every time we replay to a + # different point in time - if we see metadata from a future point in time, + # or an unrelated mount, bcachefs will get confused: + if [ "$FSTYP" = "bcachefs" ]; then + _dmthin_cleanup + _dmthin_init $devsize $devsize $csize $lowspace + fi +} + check_files() { local name=$1 @@ -46,6 +57,7 @@ check_files() local filename=$(basename $i) local mark="${filename##*.}" echo "checking $filename" >> $seqres.full + _reset_dmthin _log_writes_replay_log $filename $DMTHIN_VOL_DEV _dmthin_mount local expected_md5=$(_md5_checksum $i) @@ -105,6 +117,7 @@ _dmthin_check_fs # check pre umount echo "checking pre umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log last $DMTHIN_VOL_DEV _dmthin_mount _dmthin_check_fs @@ -115,6 +128,7 @@ done # Check the end echo "checking post umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log end $DMTHIN_VOL_DEV _dmthin_mount for j in `seq 0 $((NUM_FILES-1))`; do diff --git a/tests/generic/482 b/tests/generic/482 index 86941e8468..3cbe187f2e 100755 --- a/tests/generic/482 +++ b/tests/generic/482 @@ -77,16 +77,29 @@ prev=$(_log_writes_mark_to_entry_number mkfs) cur=$(_log_writes_find_next_fua $prev) [ -z "$cur" ] && _fail "failed to locate next FUA write" +if [ "$FSTYP" = "bcachefs" ]; then + _dmthin_cleanup + _dmthin_init $devsize $devsize $csize $lowspace +fi + while [ ! -z "$cur" ]; do _log_writes_replay_log_range $cur $DMTHIN_VOL_DEV >> $seqres.full - # Here we need extra mount to replay the log, mainly for journal based - # fs, as their fsck will report dirty log as error. - # We don't care to preserve any data on the replay dev, as we can replay - # back to the point we need, and in fact sometimes creating/deleting - # snapshots repeatedly can be slower than replaying the log. - _dmthin_mount - _dmthin_check_fs + if [ "$FSTYP" = "bcachefs" ]; then + # bcachefs will get confused if fsck does writes to replay the log, + # but then we replay writes from an earlier point in time on the + # same fs - but fsck in -n mode won't do any writes: + _check_scratch_fs -n $DMTHIN_VOL_DEV + else + # Here we need extra mount to replay the log, mainly for journal based + # fs, as their fsck will report dirty log as error. + # We don't care to preserve any data on the replay dev, as we can replay + # back to the point we need, and in fact sometimes creating/deleting + # snapshots repeatedly can be slower than replaying the log. + + _dmthin_mount + _dmthin_check_fs + fi prev=$cur cur=$(_log_writes_find_next_fua $(($cur + 1))) From patchwork Tue May 25 22:19:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 12280285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C22DC47086 for ; Tue, 25 May 2021 22:20:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3D1886142C for ; Tue, 25 May 2021 22:20:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230103AbhEYWVi (ORCPT ); Tue, 25 May 2021 18:21:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230478AbhEYWVi (ORCPT ); Tue, 25 May 2021 18:21:38 -0400 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00F69C061574; Tue, 25 May 2021 15:20:07 -0700 (PDT) Received: by mail-qk1-x72d.google.com with SMTP id h20so16606657qko.11; Tue, 25 May 2021 15:20:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9JiBQCwU7hV4K3nb6UTd0Cu6Uln8EMlvZ5BxClGNXEY=; b=ckhSJyxQ0oS0M4xWbL55/v6lFaIp9ouApYY4jAWO+oI/fH3Of/lYDOKM4CURCHwxMD mMiEx3+pEFYncIZSGL+4rNgoPV8M1bxdqBM+/mDMJUOUjyvYbNEdGaMk4CTeKpkDmnnR 5sB1OEVRhjhLlXxNBVikJhBiSJk7Jov9kt/I/pXgoCw6d19/XbezOe2ZPfAKlNdwE2w0 m6BGS9PS/jCeofbdAWlKcA6NsIJHMUsIQH8Cop+VY4UbzwOosa3HVhj9HTOR6O+TCGMK BekQkW3u9IpoTWpuAoAc3z/fQZMpYM9RwhJ91LqYaufrMqF/V6ZyFifYCnlH4UshgN7V DJYQ== 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:mime-version:content-transfer-encoding; bh=9JiBQCwU7hV4K3nb6UTd0Cu6Uln8EMlvZ5BxClGNXEY=; b=dY6nuTIdoy244fcVKfBQA+4Fhnv5sBYbqfoVEdt6DEl307g+nJGCNiq3bzoJd1NQte IiMDzqXEc7t00PK5SQ6Z3C9VUm8nbbsjvhRQPCYRMuQ2S10BWwf0bA90AsduMU1VkOuf OwDw9gjqORav3PBoC8CnLetzo08WHQsgI954V5S7g38VT5ZL4zQC/AmHYOh1QIkaFJ1X 8LW0L+SjRnI0QQFBUm1NcBOw3lpcCAa1er8ShOhD8GWV3JCWRP5tRvnSQwdtKDIdpc54 Ij3u20JiggkfMKNo0Q5siexE3XQ4nKbzSXakB7FjNJ8XJXp/gPNP82FBa936fSy2PAze wqBw== X-Gm-Message-State: AOAM532dMRQ8M82oO5uWzByJI6io8SUd6FLaUrlxVyaZXzsAr5fLXiWs qXMo3EjCsp9HrEObCcWuY6awW90dvQrW X-Google-Smtp-Source: ABdhPJwmcUDdx+4YnLmTgW8GsjACMjxqKYdX62W+gzx8nRtSoqsQI3xXbZ3HKf1OH9ZxCPgMaE/JGg== X-Received: by 2002:a05:620a:b1b:: with SMTP id t27mr37666383qkg.42.1621981205975; Tue, 25 May 2021 15:20:05 -0700 (PDT) Received: from moria.home.lan (c-73-219-103-14.hsd1.vt.comcast.net. [73.219.103.14]) by smtp.gmail.com with ESMTPSA id m10sm333445qkk.113.2021.05.25.15.20.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 15:20:05 -0700 (PDT) From: Kent Overstreet To: fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org Cc: Kent Overstreet Subject: [PATCH 4/4] generic/269: add _check_scratch_fs Date: Tue, 25 May 2021 18:19:51 -0400 Message-Id: <20210525221955.265524-4-kent.overstreet@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525221955.265524-1-kent.overstreet@gmail.com> References: <20210525221955.265524-1-kent.overstreet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org This probably should be in every test that uses the scratch device. Signed-off-by: Kent Overstreet --- tests/generic/269 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/generic/269 b/tests/generic/269 index aec573c06a..484a26f89f 100755 --- a/tests/generic/269 +++ b/tests/generic/269 @@ -63,5 +63,7 @@ if ! _scratch_unmount; then status=1 exit fi + +_check_scratch_fs status=0 exit