linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Josef Bacik <josef@toxicpanda.com>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] fstests: generic/204: fail if the mkfs fails
Date: Thu, 29 Jul 2021 23:52:26 -0400	[thread overview]
Message-ID: <YQN3enkt+icpfG0e@mit.edu> (raw)
In-Reply-To: <fe1cd52ce8954e5aee1fc0a4baf5c75ef7d2635a.1627590942.git.josef@toxicpanda.com>

On Thu, Jul 29, 2021 at 04:35:53PM -0400, Josef Bacik wrote:
> My nightly fstests runs on my Raspberry Pi got stuck trying to run
> generic/204.  This boiled down to mkfs failing to make the scratch
> device that small with the subpage blocksize support, and thus trying to
> fill a 1tib drive with tiny files.  On one hand I'd like to make
> _scratch_mkfs failures automatically fail the test, but I worry about
> cases where a test may be checking for an option and need to do
> something different with failures, so for now simply fail if we can't
> make our tiny-fs in generic/204.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

FWIW, I'm carrying the following patch in my local xfstests tree:

commit cb8e8d44de5bbb1d6163dfeb2b77e8f003a564da
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Mon Jul 3 01:29:21 2017 -0400

    common: kill the test if mkfs.ext4 in _scratch_mkfs_sized fails
    
    If the file system size specified by test is incompatible with the
    mkfs options used in the test configuration, make sure the test stops
    at that point instad of doing something undefined.
    
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>

diff --git a/common/rc b/common/rc
index 332e18b7..1dcad4a3 100644
--- a/common/rc
+++ b/common/rc
@@ -1034,7 +1034,9 @@ _scratch_mkfs_sized()
 		fi
 		;;
 	ext2|ext3|ext4|ext4dev)
-		${MKFS_PROG} -t $FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
+		echo "${MKFS_PROG} -t $FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks"
+		${MKFS_PROG} -t $FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks || \
+		    _die "${MKFS_PROG}.$FSTYP failed!"
 		;;
 	gfs2)
 		# mkfs.gfs2 doesn't automatically shrink journal files on small



I tried getting this upstream, but apparently there was pushback where
when the mkfs failed, it was considered a *feature* that the test
would run on some random scratch file system that was previously there
from before.

I didn't appreciate wasting time trying to run down test failures
caused by some completely inappropriate file system being used for a
test after _scratch_mkfs_sized failed, so I've just been carrying the
patch locally....

						- Ted

  reply	other threads:[~2021-07-30  3:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 20:35 [PATCH] fstests: generic/204: fail if the mkfs fails Josef Bacik
2021-07-30  3:52 ` Theodore Ts'o [this message]
2021-08-01 12:42 ` Eryu Guan
2021-08-01 12:53   ` Eryu Guan
2021-08-01 15:57     ` Theodore Ts'o

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=YQN3enkt+icpfG0e@mit.edu \
    --to=tytso@mit.edu \
    --cc=fstests@vger.kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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).