linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Zorro Lang <zlang@redhat.com>
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org,
	tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 3/3] common/ext4: provide custom ext4 scratch fs options
Date: Wed, 3 Aug 2022 11:52:37 -0700	[thread overview]
Message-ID: <YurD9cItB/yvfvL9@magnolia> (raw)
In-Reply-To: <20220803182843.mznuba2z7mbti4co@zlang-mailbox>

On Thu, Aug 04, 2022 at 02:28:43AM +0800, Zorro Lang wrote:
> On Tue, Aug 02, 2022 at 09:21:57PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > 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 <djwong@kernel.org>
> > ---
> >  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"
> 
> In _scratch_mkfs_ext4, it deals with mkfs with SCRATCH_LOGDEV:
> 
>   [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
>      $mkfs_cmd -O journal_dev $MKFS_OPTIONS $SCRATCH_LOGDEV && \
>      mkfs_cmd="$mkfs_cmd -J device=$SCRATCH_LOGDEV"
> 
> So is there a conflict or duplication?

Nope, I simply missed that.  I'll respin the patch.

--D

> > +	;;
> > +    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
> >  }
> >  
> > 
> 

  reply	other threads:[~2022-08-03 18:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-03  4:21 [PATCHSET 0/3] fstests: refactor ext4-specific code Darrick J. Wong
2022-08-03  4:21 ` [PATCH 1/3] common/rc: move ext4-specific helpers into a separate common/ext4 file Darrick J. Wong
2022-08-03  4:21 ` [PATCH 2/3] common/rc: move XFS-specific parts of _scratch_options into common/xfs Darrick J. Wong
2022-08-03  4:21 ` [PATCH 3/3] common/ext4: provide custom ext4 scratch fs options Darrick J. Wong
2022-08-03 18:28   ` Zorro Lang
2022-08-03 18:52     ` Darrick J. Wong [this message]
2022-08-04  0:25   ` [PATCH v1.2 " Darrick J. Wong
2022-08-04  5:03     ` Darrick J. Wong
2022-08-04 16:29   ` [PATCH v1.3 " Darrick J. Wong
2022-08-05 17:08     ` Zorro Lang
2022-08-06 14:36 ` [PATCHSET 0/3] fstests: refactor ext4-specific code Zorro Lang
2022-08-07 16:30   ` Darrick J. Wong
2022-08-08 15:13     ` Zorro Lang
  -- strict thread matches above, loose matches on Subject: below --
2022-08-09 21:00 [PATCHSET v2 " Darrick J. Wong
2022-08-09 21:00 ` [PATCH 3/3] common/ext4: provide custom ext4 scratch fs options Darrick J. Wong
2022-08-11 12:32   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YurD9cItB/yvfvL9@magnolia \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=zlang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).