FS/XFS testing framework
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Anand Jain <anand.jain@oracle.com>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, zlang@redhat.com
Subject: Re: [PATCH v1] fstests: add configuration option for executing post mkfs commands
Date: Fri, 15 Sep 2023 11:59:50 +1000	[thread overview]
Message-ID: <ZQO6lmjasMPY8wOQ@dread.disaster.area> (raw)
In-Reply-To: <9c6d36835c04f18a59005a8994ba128970bac20a.1690446808.git.anand.jain@oracle.com>

On Thu, Sep 14, 2023 at 11:07:43PM +0800, Anand Jain wrote:
> This patch introduces a new configuration file parameter, POST_MKFS_CMD,
> which, when set, will run immediately it after the mkfs command for the
> FSTYP btrfs.
> 
> 	For example:
> 	POST_MKFS_CMD="btrfstune -m"
> 
> Currently, only btrfstune's '-m' option is tested. However, there may be
> more btrfstune options, so having this parameter as a config makes sense.
> Additionally, there can be other commands besides btrfstune.
> 
> The mkfs helper functions in common/rc passes the SCRATCH_DEV as an argument
> to the set POST_MKFS_CMD, which may not be compatible with other configurable
> commands in the future. However, as of now, since those usecases are still
> unknown, we can modify it later.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

In general, we've put filesystem specific post-mkfs commands inside
the filesystem specific mkfs function.

See _scratch_mkfs_xfs() for example. If we want to test TB scale
scratch filesystems without requiring ENOSPC tests to fill TBs of
disk space, we set LARGE_SCRATCH_DEV. This causes the mkfs function
to do the post-mkfs creation of a hidden file that consumes all but
50GB of space via fallocate (by calling _setup_large_xfs_fs()).
Hence filesystem filling tests don't spend forever filling the
filesystem, and no code outside of XFS specific functions need to
care that this hidden file exists....

Given that the use case here is to issue filesystem specific
commands rather than generic setup commands needed for all
filesystems, I think it would be better to encapsulate it inside the
btrfs specific mkfs implementation....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2023-09-15  1:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27  9:04 [PATCH RFC] fstests: add configuration option for executing post mkfs commands Anand Jain
2023-09-14 15:07 ` [PATCH v1] " Anand Jain
2023-09-15  1:59 ` Dave Chinner [this message]
2023-09-17 11:58   ` Anand Jain
2023-09-18  1:18     ` Dave Chinner
2023-09-28  5:19       ` Anand Jain

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=ZQO6lmjasMPY8wOQ@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=anand.jain@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --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