public inbox for linux-unionfs@vger.kernel.org
 help / color / mirror / Atom feed
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 2/3] ovl: Do not check for redirect if this is last layer
Date: Fri, 9 Mar 2018 09:18:34 -0500	[thread overview]
Message-ID: <20180309141834.GB4596@redhat.com> (raw)
In-Reply-To: <CAOQ4uxgubChWBGWOk-V-0+2OZcUYYRnyrt8OELhY+gZKO3PnLA@mail.gmail.com>

On Fri, Mar 09, 2018 at 12:27:21AM +0200, Amir Goldstein wrote:
> On Fri, Mar 9, 2018 at 12:18 AM, Vivek Goyal <vgoyal@redhat.com> wrote:
> > If we are looking in last layer, then there should not be any need to
> > process redirect. redirect information is used only for lookup in next
> > lower layer and there is no more lower layer to look into. So no need
> > to process redirects.
> >
> > IOW, ignore redirects on lowest layer.
> >
> > Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> 
> Reviewed-by: Amir Goldstein <amir73il@gmail.com>
> 
> > ---
> >  fs/overlayfs/namei.c | 15 +++++++++------
> >  1 file changed, 9 insertions(+), 6 deletions(-)
> >
> > diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
> > index 2e173cfbda0e..32d1d96f80b6 100644
> > --- a/fs/overlayfs/namei.c
> > +++ b/fs/overlayfs/namei.c
> > @@ -248,13 +248,16 @@ static int ovl_lookup_single(struct dentry *base, struct ovl_lookup_data *d,
> >                 goto out;
> >         }
> >         d->is_dir = true;
> > -       if (!d->last && ovl_is_opaquedir(this)) {
> > -               d->stop = d->opaque = true;
> > -               goto out;
> 
> I preferred to go with if (d->last) goto out; I like to avoid nesting
> when possible.
> but choose whichever you like.

I liked your version better as well. :-). Will do if (d->last) goto out;

Vivek

> 
> > +       if (!d->last) {
> > +               if (ovl_is_opaquedir(this)) {
> > +                       d->stop = d->opaque = true;
> > +                       goto out;
> > +               }
> > +
> > +               err = ovl_check_redirect(this, d, prelen, post);
> > +               if (err)
> > +                       goto out_err;
> >         }
> > -       err = ovl_check_redirect(this, d, prelen, post);
> > -       if (err)
> > -               goto out_err;
> >  out:
> >         *ret = this;
> >         return 0;
> > --
> > 2.13.6
> >

  reply	other threads:[~2018-03-09 14:18 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 [this message]
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

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=20180309141834.GB4596@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