From: Vivek Goyal <vgoyal@redhat.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: overlayfs <linux-unionfs@vger.kernel.org>,
Miklos Szeredi <miklos@szeredi.hu>
Subject: Re: [PATCH 3/3] ovl: set d->is_dir and d->opaque for last path element
Date: Fri, 9 Mar 2018 11:44:16 -0500 [thread overview]
Message-ID: <20180309164416.GD4596@redhat.com> (raw)
In-Reply-To: <CAOQ4uxjBN7gF2SGaWjN6jT-njrQmMwCZh4FO-ncUU5X+v=7QwQ@mail.gmail.com>
On Fri, Mar 09, 2018 at 06:38:34PM +0200, Amir Goldstein wrote:
> On Fri, Mar 9, 2018 at 6:30 PM, Vivek Goyal <vgoyal@redhat.com> wrote:
> > On Fri, Mar 09, 2018 at 05:20:30PM +0200, Amir Goldstein wrote:
> >> On Fri, Mar 9, 2018 at 4:44 PM, Vivek Goyal <vgoyal@redhat.com> wrote:
> >> > On Fri, Mar 09, 2018 at 12:34:57AM +0200, Amir Goldstein wrote:
> >> >> On Fri, Mar 9, 2018 at 12:18 AM, Vivek Goyal <vgoyal@redhat.com> wrote:
> >> >> > Certain properties in ovl_lookup_data should be set only for the last
> >> >> > element of the path. IOW, of we are calling ovl_lookup_single() for an
> >> >> > absolute redirect, then d->is_dir and d->opaque do not make much sense
> >> >> > for intermediate path elements. Instead set them only if dentry being
> >> >> > lookup is last path element.
> >> >>
> >> >> Yeh, that's what I said, but I realized later that this is not accurate.
> >> >> it's true for d->is_dir, but not true for d->opaque.
> >> >> opaqueness of path elements *can* determine that the redirect result is
> >> >> opaque, for example when redirecting to /a/b/c and /a is opaque, then
> >> >> the resolved redirection is opaque *unless* either /a/b or /a/b/c has
> >> >> an absolute redirect to escape the opaqueness of /a.
> >> >
> >> > Hi Amir,
> >> >
> >> > I am not sure I understand this argument about "opaque". Why opaqueness
> >> > of parent matters to child. Can you please give an example.
> >> >
> >>
> >> upper: /redirect (redirect=/a/b/c)
> >> lower1: /a/[b]/c ([b] is opaque)
> >> lower0: /a/b/c/foo
> >>
> >> upper /redirect was created by 'mv /mnt/a/b/c/ /mnt/redirect'
> >> before rename /mnt/a/b/c did not contain 'foo' because /mnt/a/b
> >> is not a merge dir and therefore neither is /mnt/a/b/c.
> >> after rename /redirect should not contain 'foo' as well.
> >> This is handles by ovl_lookup_layer() when iterating absolute
> >> redirect element [b] d->opaque is set in the lookup state.
> >>
> >> The fix I sent for the case where /a/[b]/c is again an absolute
> >> redirect (say to /a/b/c in lower0) and that *should* results in
> >> the merge dir containing 'foo'.
> >>
> >> Not easy...
> >
> > Aha.., I get it now. So I have couple of observations.
> >
> > - d->opaque is still seems to be the property of last element we are
> > searching in the path. It is d->stop which should get set for
> > intermediate elements if we find an opaque dir in the path.
> >
> > In fact, ovl_lookup() does not even look at d->opaque until and unless
> > it is set on upperdentry. Right?
> >
> > So if we don't set d->opaque on a lower dentry, looks like nobody will
> > care as of now. But just to define semantics right, we can say d->opaque
> > represents the property of last element of the path.
> >
> > - And apply your patch on top which will just reset d->stop = false if
> > an absolute redirect was found in the path and leave d->opaque
> > untouched.
> >
> > Does it make sense?
> >
>
> Yeh, ok. I guess d->stop is sufficient.
>
> You may take my patch and modify it if you like.
Ok, I will take your patch and modify it to drop d->opaque = false and put
it in the series.
Thanks
Vivek
prev parent reply other threads:[~2018-03-09 16:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-08 22:18 [RFC PATCH 0/3] Misc ovl_lookup() related fixes Vivek Goyal
2018-03-08 22:18 ` [PATCH 1/3] ovl: Set d->last properly during lookup Vivek Goyal
2018-03-08 22:25 ` Amir Goldstein
2018-03-09 14:08 ` Vivek Goyal
2018-03-08 22:18 ` [PATCH 2/3] ovl: Do not check for redirect if this is last layer Vivek Goyal
2018-03-08 22:27 ` Amir Goldstein
2018-03-09 14:18 ` Vivek Goyal
2018-03-08 22:18 ` [PATCH 3/3] ovl: set d->is_dir and d->opaque for last path element Vivek Goyal
2018-03-08 22:34 ` Amir Goldstein
2018-03-09 14:44 ` Vivek Goyal
2018-03-09 15:20 ` Amir Goldstein
2018-03-09 16:30 ` Vivek Goyal
2018-03-09 16:38 ` Amir Goldstein
2018-03-09 16:44 ` Vivek Goyal [this message]
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=20180309164416.GD4596@redhat.com \
--to=vgoyal@redhat.com \
--cc=amir73il@gmail.com \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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