From: Eryu Guan <guaneryu@gmail.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jeffle Xu <jefflexu@linux.alibaba.com>,
fstests <fstests@vger.kernel.org>,
"Darrick J. Wong" <darrick.wong@oracle.com>,
Chengguang Xu <cgxu519@gmx.com>
Subject: Re: [PATCH] generic/530: fix shutdown failure of generic/530 in overlay
Date: Fri, 10 May 2019 13:05:06 +0800 [thread overview]
Message-ID: <20190510050506.GE15846@desktop> (raw)
In-Reply-To: <CAOQ4uxjaBQR63pWY7+M9YD5qV3wBkeRBZxv7nW0AW==BR=nDjg@mail.gmail.com>
On Thu, May 09, 2019 at 11:59:31AM +0300, Amir Goldstein wrote:
> On Thu, May 9, 2019 at 8:29 AM Jeffle Xu <jefflexu@linux.alibaba.com> wrote:
> >
> > We got "shutdown: Inappropriate ioctl for device" when running
> > "./check -overlay generic/530". The error message is due to the
> > XFS_IOC_GOINGDOWN ioctl used in generic/530.
> >
> > Though _require_scratch_shutdown() is called to test whether the
> > tested filesystem supports XFS_IOC_GOINGDOWN ioctl or not, a piece
> > of C code snippet in src/t_open_tmpfiles.c is used to shutdown the
> > filesysetm, rather than calling the corresponding helper function
> > _scratch_shutdown().
> >
> > Let me explain it clearly:
> >
> > 1. suppose the config is
> >
> > ```
> > export TEST_DEV=/dev/vdb
> > export TEST_DIR=/mnt/test
> > export SCRATCH_DEV=/dev/vdc
> > export SCRATCH_MNT=/mnt/scratch
> > ```
> >
> > 2. When running "./check -overlay generic/530", the scratch device,
> > /dev/vdc is mounted on /mnt/scratch, and the overlay filesystem is
> > mounted on /mnt/scratch/mnt using the follwing command
> >
> > ```
> > mount -t overlay -o lowerdir=/mnt/scratch/ovl-lower \
> > -o upperdir=/mnt/scratch/ovl-upper/ -o workdir=/mnt/scratch/ovl-work/ \
> > overlay /mnt/scratch/ovl-mnt
> > ```
> >
> > 3. In this case, _require_scratch_shutdown() will inspect whether the
> > underlying upper system, that is **/mnt/scratch/**, supports shutdown
> > feature or not. In my test, the underlying system of overlay (that is
> > /dev/vdc) is ext4, and thus it passes the _require_scratch_shutdown
> > test.
> >
> > 4. However, the C code executing the shutdown action in t_open_tmpfiles.c
> > actually execute XFS_IOC_GOINGDOWN ioctl on the mount point of overlay
> > filesystem, that is **/mnt/scratch/ovl-mnt**. Since overlay doesn't support
> > XFS_IOC_GOINGDOWN ioctl, it fails naturally.
> >
> > 5. So we should use _scratch_shutdown() to shutdown if we have used
> > _require_scratch_shutdown
> >
> > As for the solution to fix the failure, I temporarily move the shutdown
> > action from t_open_tmpfiles into generic/530 as the workaround. How would
> > you think @Darrick? Maybe there is a better solution but I'm not sure.
> >
>
> I think this is the correct solution (and not a workaround)
> FWIW there are other operations (e.g. umount) when done directly and
> not via common helpers would not have the same result when running
> check -overlay.
I agreed.
>
> I suggest that you remove the option 'shutdown' from t_open_tmpfiles
> if shutdown can be done by test, so future tests won't use it.
>
> There are 2 generic tests that use src/godown directly and not via
> common shutdown helper. Those tests are skipped with -overlay due
> to other unmet requirements, but as a general practice, using src/godown
> directly should be avoided if possible.
Yeah, makes sense to me, thanks!
Eryu
next prev parent reply other threads:[~2019-05-10 5:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-09 5:26 [PATCH] generic/530: fix shutdown failure of generic/530 in overlay Jeffle Xu
2019-05-09 5:44 ` Darrick J. Wong
2019-05-09 9:07 ` Amir Goldstein
2019-05-09 9:09 ` Amir Goldstein
2019-05-09 8:59 ` Amir Goldstein
2019-05-10 5:05 ` Eryu Guan [this message]
2019-05-10 3:17 ` [PATCH v2] " Jeffle Xu
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=20190510050506.GE15846@desktop \
--to=guaneryu@gmail.com \
--cc=amir73il@gmail.com \
--cc=cgxu519@gmx.com \
--cc=darrick.wong@oracle.com \
--cc=fstests@vger.kernel.org \
--cc=jefflexu@linux.alibaba.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.