All of lore.kernel.org
 help / color / mirror / Atom feed
From: zhangyi <yizhang089@gmail.com>
To: Amir Goldstein <amir73il@gmail.com>, "zhangyi (F)" <yi.zhang@huawei.com>
Cc: fstests <fstests@vger.kernel.org>, Eryu Guan <guaneryu@gmail.com>,
	Miklos Szeredi <miklos@szeredi.hu>, Miao Xie <miaoxie@huawei.com>,
	overlayfs <linux-unionfs@vger.kernel.org>
Subject: Re: [PATCH v2 1/4] overlay: correct fsck.overlay exit code
Date: Fri, 19 Oct 2018 00:22:53 +0800	[thread overview]
Message-ID: <66460ae9-3552-5730-9970-70f229475a5e@gmail.com> (raw)
In-Reply-To: <CAOQ4uxjrf8mcUtcxwmhpg4Y4m3u0PXC2QNc+s3tkUiPN3anzvw@mail.gmail.com>

On 2018/10/18 12:37, Amir Goldstein Wrote:

> On Thu, Oct 18, 2018 at 5:37 AM zhangyi (F) <yi.zhang@huawei.com> wrote:
>> On 2018/10/16 17:45, Amir Goldstein Wrote:
>>> On Tue, Oct 16, 2018 at 10:32 AM zhangyi (F) <yi.zhang@huawei.com> wrote:
> [...]
>>> Please consider the name _overlay_repair_dirs() with reference to
>>> _repair_scratch_fs(), which is used for roughly the same purpose.
>>>
>> _run_check_fsck() is helper used to test fsck and may expect to return
>> "error" exit code when we do exception tests(see patch 4), but
>> _repair_scratch_fs() always want to return "correct" exit code.
>>
> Right. so perhaps we need _overlay_repair_dirs() as a convenience
> helper for things like the stress test and also related to another
> comment about expecting return 0 is too fragile.
>
>>> BTW, the tests generic/330 generic/332 when run with -overlay
>>> over xfs with reflink support seem to call _repair_scratch_fs() which does:
>>>          # Let's hope fsck -y suffices...
>>>          fsck -t $FSTYP -y $SCRATCH_DEV 2>&1
>>>          local res=$?
>>>          case $res in
>>>          0|1|2)
>>>                  res=0
>>>                  ;;
>>>          *)
>>>                  _dump_err2 "fsck.$FSTYP failed, err=$res"
>>>
>>> How come fsck.overlay is not complaining about missing arguments??
>>>
>>> The rest of the generic tests that call _repair_scratch_fs() have
>>> _require_dm_target() which _require_block_device(), so don't run with overlay.
>>>
>>> If you do sort this out and add overlay support to
>>> _repair_scratch_fs() its probably
>>> worth replacing 0|1|2) with FSCK_ constants.
>>>
>> Thanks for pointing this out, I think we do something like below can fix
>> this problem, what do you think?
> I am puzzled about why those tests do NOT fail when fsck.overlay is given
> incorrect args??
>
Oh, it's _dump_err2() helper's fault, it should be

--- a/common/rc
+++ b/common/rc
@@ -98,7 +98,7 @@ _dump_err_cont()
  _dump_err2()
  {
      _err_msg="$*"
-    >2& echo "$_err_msg"
+    >&2 echo "$_err_msg"
  }

Thanks,
Yi.

  reply	other threads:[~2018-10-18 16:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-16  7:45 [PATCH v2 0/4] overlay: enhance fsck.overlay test cases zhangyi (F)
2018-10-16  7:45 ` [PATCH v2 1/4] overlay: correct fsck.overlay exit code zhangyi (F)
2018-10-16  9:45   ` Amir Goldstein
2018-10-18  2:37     ` zhangyi (F)
2018-10-18  4:37       ` Amir Goldstein
2018-10-18 16:22         ` zhangyi [this message]
2018-10-18  4:54   ` Amir Goldstein
2018-10-16  7:45 ` [PATCH v2 2/4] overlay: fix exit code for some fsck.overlay valid cases zhangyi (F)
2018-10-16  9:26   ` Amir Goldstein
2018-10-18  3:42     ` zhangyi (F)
2018-10-18  4:44       ` Amir Goldstein
2018-10-19 12:36         ` zhangyi (F)
2018-10-19 14:00           ` Amir Goldstein
2018-10-16  7:45 ` [PATCH v2 3/4] overlay: add fsck.overlay stress test zhangyi (F)
2018-10-16 10:07   ` Amir Goldstein
2018-10-18  3:48     ` zhangyi (F)
2018-10-16  7:45 ` [PATCH v2 4/4] overlay: add fsck.overlay exception tests zhangyi (F)
2018-10-16 13:29   ` Amir Goldstein
2018-10-16  9:27 ` [PATCH v2 0/4] overlay: enhance fsck.overlay test cases Amir Goldstein
2018-10-16 12:39   ` Amir Goldstein
2018-10-18  3:50     ` zhangyi (F)

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=66460ae9-3552-5730-9970-70f229475a5e@gmail.com \
    --to=yizhang089@gmail.com \
    --cc=amir73il@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miaoxie@huawei.com \
    --cc=miklos@szeredi.hu \
    --cc=yi.zhang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.