public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Eryu Guan <eguan@redhat.com>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>, fstests@vger.kernel.org
Subject: Re: [RFC PATCH] check: try to fix the test device if it gets corrupted
Date: Tue, 18 Jul 2017 13:30:09 -0400	[thread overview]
Message-ID: <20170718173009.r5i73dztecop5tfr@thunk.org> (raw)
In-Reply-To: <20170718050507.GU2478@eguan.usersys.redhat.com>

On Tue, Jul 18, 2017 at 01:05:07PM +0800, Eryu Guan wrote:
> > >  	if [ -f ${RESULT_DIR}/require_test ]; then
> > > -		_check_test_fs || err=true
> > > +		if ! _check_test_fs ; then
> > > +			err=true
> > > +			echo "Trying to repair broken TEST_DEV file system"
> > > +			_repair_test_fs
> 
> Should we stop running if _repair_test_fs failed to fix TEST_DEV? I
> think that was what Darrick first suggested. And I think unfixable
> errors will cause subsequent tests to fail too.

Seems reasonable to me.  I'll take a look at it.

> > > +_repair_test_fs()
> > > +{
> > > +	case $FSTYP in
> > > +	xfs)
> > > +		_repair_xfs_test_fs "$@" >$tmp.repair 2>&1
> > > +		res=$?
> 
> Better to declare res as a local variable. I know this was copied from
> _repair_scratch_fs, but better to get it improved in new code :)

Ack.

> > Structurally this all looks ok, but it's a little weird that we have
> > _scratch_xfs_repair for the scratch device (object-verb) but
> > _repair_test_fs (verb-object) for the test device.
> 
> My best guess is that _repair_scratch_fs and _repair_test_fs are helpers
> in a higher level, and are defined in common/rc, they deal with all
> filesystem types.
> 
> _scratch_xfs_repair is xfs specific, and defined in common/xfs, it only
> deals with xfs. So the naming schema is different but they are also in
> different "namespace"s, which looks fine to me :)

I also didn't like _test_repair_fs because it's not clear whether
"test" is a verb or a noun.

So one thing we could do is _xfs_scratch_repair and _xfs_test_repair?

The other thing is how much of the cleanup in common/xfs should be
segregated into a separate commit (and I'm not sure how competent I'm
going to be ate doing that cleanup, but I'm willing to give it a go).

      	    	      	   	    	- Ted

  reply	other threads:[~2017-07-18 17:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02 23:20 [RFC PATCH] check: try to fix the test device if it gets corrupted Theodore Ts'o
2017-03-03  9:03 ` Eryu Guan
2017-03-03 17:21   ` Darrick J. Wong
2017-03-03 23:01     ` Theodore Ts'o
2017-03-27  1:48       ` Theodore Ts'o
2017-03-27  8:51         ` Eryu Guan
2017-07-16  1:30           ` Theodore Ts'o
2017-07-17 23:45             ` Darrick J. Wong
2017-07-18  5:05               ` Eryu Guan
2017-07-18 17:30                 ` Theodore Ts'o [this message]
2017-07-19  9:40                   ` Eryu Guan
2017-07-19 14:53                     ` Theodore Ts'o
2017-07-19 15:02                       ` Eryu Guan
2017-07-19 16:13                         ` Darrick J. Wong

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=20170718173009.r5i73dztecop5tfr@thunk.org \
    --to=tytso@mit.edu \
    --cc=darrick.wong@oracle.com \
    --cc=eguan@redhat.com \
    --cc=fstests@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