Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp141479imn; Tue, 2 Aug 2022 21:23:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR6DfGLJvE7lzxWAM8sqrDIUabEhuJ2B5sN0SGn7bFsJBfculUp2dRO71YrxjaZcAnOIy04/ X-Received: by 2002:a17:90a:4291:b0:1f2:2a19:fc95 with SMTP id p17-20020a17090a429100b001f22a19fc95mr2951860pjg.29.1659500585853; Tue, 02 Aug 2022 21:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659500585; cv=none; d=google.com; s=arc-20160816; b=NDjXyBxKYxUHn5cLVCr8TykPKrniuY6MpEhBe84WGOFbWbJyAiiL5lbotn6zuQYFKT bzHefd0+Qm0yxFsN4GgN6HZU6IhoCQyD6vpcumEYIjkeMqd7LQZ12CDNR4C33vZrOhJn HiaksEfUFWap4yltkqjoYzSKawcDVbXdtnAt7TsYHjyGaqhTCj/hg6eU07SFFMetgesA pG6/zID1y9/TTdeDvU/ZJtThBpU0CzNiu5Xov9aRhElznKnqMSThLeaWyS8Uv52BxsUP mMazZJt9XTbgUY944WnFK2qbqBHYhrWRr4t0WEQBu9Bnsuj0r+rowyBCCKADPt29Fkjn Fp8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature; bh=bxrcOTiGPZNiZ3RBv2ItRvlH2L/zI/tcIsD9gGq8RJM=; b=g/WATG71Gzmelaia+kBFpWijibDDpam+J559Xa5QtP+2hMQgnzrjvAPWTSidD84XQK J2ckNC2R40WNeZalg0TGUnpJvEJYex2Ff5/99Ld7s1mlh75rdp+3EgNHDDPDmSlH+yjJ 35Umi2DuGWcGkBY01OLEPb1OAbW8f8tMB1cjOK2Yl33BIwhF7Ox3kghogOkrNVNsM9mD aakwo15+aCkPsLyHdOFDAChDWurBH1+yjIdSnhdu3ArGM/quA2U4Q18uFtaxZuGL/EhA vvrfveGuz6erONHN2aluAHTMa/CMo0dyiskMWqv/1LN5mlAzG6ysWSOYs+n+PjmeGmwg CnSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dmMVwjjC; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s11-20020a63924b000000b0041a0a9d7ca0si18718461pgn.646.2022.08.02.21.22.50; Tue, 02 Aug 2022 21:23:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dmMVwjjC; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235407AbiHCEWC (ORCPT + 99 others); Wed, 3 Aug 2022 00:22:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235444AbiHCEV7 (ORCPT ); Wed, 3 Aug 2022 00:21:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2DA95466A; Tue, 2 Aug 2022 21:21:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7F97661248; Wed, 3 Aug 2022 04:21:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D93A1C433C1; Wed, 3 Aug 2022 04:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659500517; bh=3uAwmeySBlqJ5bpC+m+eSKAg6CfcTUSV/7/H5638fxw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=dmMVwjjCZibKyIF8mJ4hj3V53X6V1M1RTAT9PJaLZo9LUAeuQ5LeMrdM8NPrn67sv TkLxCZNzuKElvzMehS/nQL+DhoI5/fftXi1PDeDDvi7D9CO6kGaLYsva3lY4RH0c04 Ck+jvJvZPlBuJ7qrBU/66SYDGnv1VgfVIwS0MRv5hoy8ZLOO98fektyDG6qZImEhqN U6SN/KDIcKxV9u6Jg+k0LFXZduw+AT+OAXqRyBGJQEsAuu9e3b1NcsIA3lzPftVAVJ iIiVX1mZ59sppwTukaxpzcvEqIaaKbEACAMI4ZZqqd1JHtwXpwvkqL1X96I2oJleXd D04Ormtvwa2RQ== Subject: [PATCH 3/3] common/ext4: provide custom ext4 scratch fs options From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, tytso@mit.edu, linux-ext4@vger.kernel.org Date: Tue, 02 Aug 2022 21:21:57 -0700 Message-ID: <165950051745.198922.6487109955066878945.stgit@magnolia> In-Reply-To: <165950050051.198922.13423077997881086438.stgit@magnolia> References: <165950050051.198922.13423077997881086438.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Darrick J. Wong Create a _scratch_options backend for ext* so that we can inject pathnames to external log devices into the scratch fs mount options. This enables common/dm* to install block device filters, e.g. dm-error for stress testing. Signed-off-by: Darrick J. Wong --- common/ext4 | 20 ++++++++++++++++++++ common/rc | 3 +++ 2 files changed, 23 insertions(+) diff --git a/common/ext4 b/common/ext4 index 287705af..819f9786 100644 --- a/common/ext4 +++ b/common/ext4 @@ -154,3 +154,23 @@ _require_scratch_richacl_ext4() || _notrun "kernel doesn't support richacl feature on $FSTYP" _scratch_unmount } + +_scratch_ext4_options() +{ + local type=$1 + local log_opt="" + + case $type in + mkfs) + log_opt="-J device=$SCRATCH_LOGDEV" + ;; + mount) + # As of kernel 5.19, the kernel mount option path parser only accepts + # direct paths to block devices--the final path component cannot be a + # symlink. + log_opt="-o journal_path=$(realpath $SCRATCH_LOGDEV)" + ;; + esac + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + SCRATCH_OPTIONS="$SCRATCH_OPTIONS ${log_opt}" +} diff --git a/common/rc b/common/rc index dc1d65c3..b82bb36b 100644 --- a/common/rc +++ b/common/rc @@ -178,6 +178,9 @@ _scratch_options() "xfs") _scratch_xfs_options "$@" ;; + ext2|ext3|ext4|ext4dev) + _scratch_ext4_options "$@" + ;; esac }