summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2018-05-11 11:49:31 -0400
committerMiklos Szeredi <mszeredi@redhat.com>2018-07-20 09:56:13 +0200
commitb8a8824ca011050b590a6353067e722a24a591fb (patch)
tree7f157970f1237f5913c4b12599e3699bc3a7aa25 /fs/overlayfs
parent0618a816edab6cb46d6d456f2fdff6bb325a4c77 (diff)
downloadlinux-b8a8824ca011050b590a6353067e722a24a591fb.tar.gz
linux-b8a8824ca011050b590a6353067e722a24a591fb.tar.bz2
linux-b8a8824ca011050b590a6353067e722a24a591fb.zip
ovl: Check redirects for metacopy files
Right now we rely on path based lookup for data origin of metacopy upper. This will work only if upper has not been renamed. We solved this problem already for merged directories using redirect. Use same logic for metacopy files. This patch just goes on to check redirects for metacopy files. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r--fs/overlayfs/namei.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index e4bbe6ed6a87..eddb80dd0766 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -272,7 +272,8 @@ static int ovl_lookup_single(struct dentry *base, struct ovl_lookup_data *d,
d->metacopy = err;
d->stop = !d->metacopy;
- goto out;
+ if (!d->metacopy || d->last)
+ goto out;
} else {
if (last_element)
d->is_dir = true;
@@ -874,7 +875,6 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
if (upperdentry && !d.is_dir) {
unsigned int origin_ctr = 0;
- BUG_ON(d.redirect);
/*
* Lookup copy up origin by decoding origin file handle.
* We may get a disconnected dentry, which is fine,