Skip to content

Commit

Permalink
ovl: Do not check for redirect if this is last layer
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
  • Loading branch information
Vivek Goyal authored and Miklos Szeredi committed Apr 12, 2018
1 parent 8b58924 commit e9b77f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/overlayfs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e9b77f9

Please sign in to comment.