All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: "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>
Subject: Re: [PATCH v2 2/4] overlay: fix exit code for some fsck.overlay valid cases
Date: Thu, 18 Oct 2018 07:44:07 +0300	[thread overview]
Message-ID: <CAOQ4uxgZCWFR5qr-6z4DH=UrtqX+Q2aY=XiX2bEpFNpeDvN2OA@mail.gmail.com> (raw)
In-Reply-To: <c3b4ba3b-001d-ad70-445f-f0c1ce5d17f0@huawei.com>

On Thu, Oct 18, 2018 at 6:43 AM zhangyi (F) <yi.zhang@huawei.com> wrote:
>
> On 2018/10/16 17:26, Amir Goldstein Wrote:
> > On Tue, Oct 16, 2018 at 10:32 AM zhangyi (F) <yi.zhang@huawei.com> wrote:
> >>
> >> Some valid test cases about fsck.overlay may be not valid enough now,
> >> they lose the impure xattr on the parent directory of the simluated
> >> redirect directory, and lose the whiteout which use to cover the origin
> >> lower object. Then fsck.overlay will fix these two inconsistency which
> >> are not those test cases want to cover, thus it will lead to
> >> fsck.overlay return FSCK_NONDESTRUCT instead of FSCK_OK. Fix these by
> >> complement the missing overlay related features.
> >>
> >> Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
> >> ---
> >
> > Ok. I think it's fine if we merge this fix now, but this way it is going
> > to be quite hard to maintain this test.
> >
> > Imagine every time that you add another feature to fsck.overlay,
> > say "add overlay features xattr", fsck will start returning FSCK_NONDESTRUCT
> > and break this test.
> >
> > Perhaps it would have been better to construct the test cases by:
> > - mount overlay
> > - create some copied up/ redirected  dirs and whiteouts
> > - umount overlay
> > - make minor modifications to upper/lower layer
> > - run fsck
> >
> > Then you wouldn't need to worry about things like impure parent dir
> > and future overlay features.
> >
> > I will leave it to you to decide if you want to fix this now or the
> > next time around...
> >
>
> Indeed, I thought about this choice. If we create overlay on-disk features
> (xattrs,whiteouts...) through overlayfs, the fsck tests results becomes
> non-independent. It will depends on the kernel (overlayfs module) user are
> running the test. Imaging if user want to test the latest fsck.overlay
> on the old kernel which contains a compatible feature xattr fsck.overlay
> know but the kernel don't, we will get the unexpected result. Or maybe
> we can add some _require_xxx_feature() helper to enforce user doing test
> on the kernel which supports the specified feature?
>

I think the only sane choice is for this test to relax the expectation of 0
exit code to "correct" exit code (i.e. _overlay_repair_dirs()) for the "Valid"
test cases.

Maybe the only fsck run that we are fine with expecting 0 exit code is
-n run. As you can see this is common practice for e2fsck:
e2fsck -fn "${SCRATCH_DEV}" >> $seqres.full 2>&1 || _fail "fsck should not fail"

Thanks,
Amir.

  reply	other threads:[~2018-10-18 12:43 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
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 [this message]
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='CAOQ4uxgZCWFR5qr-6z4DH=UrtqX+Q2aY=XiX2bEpFNpeDvN2OA@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --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.