From: Vivek Goyal Date: Fri, 9 Mar 2018 20:44:42 +0000 (-0500) Subject: ovl: Do not check for redirect if this is last layer X-Git-Tag: microblaze-v4.18-rc1~53^2~11 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=e9b77f90cc2307f6d2457696d3d76288a5df11fc;p=linux-2.6-microblaze.git ovl: Do not check for redirect if this is last layer 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 Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index 810a333d2221..5287c4bcf14b 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -258,7 +258,10 @@ 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)) { + if (d->last) + goto out; + + if (ovl_is_opaquedir(this)) { d->stop = d->opaque = true; goto out; }