From e9b77f90cc2307f6d2457696d3d76288a5df11fc Mon Sep 17 00:00:00 2001 From: Vivek Goyal Date: Fri, 9 Mar 2018 15:44:42 -0500 Subject: 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 --- fs/overlayfs/namei.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'fs') 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; } -- cgit v1.2.3-58-ga151