Return-Path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39596 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752519AbeEGRlM (ORCPT ); Mon, 7 May 2018 13:41:12 -0400 From: Vivek Goyal Subject: [PATCH v15 20/30] ovl: Check redirects for metacopy files Date: Mon, 7 May 2018 13:40:52 -0400 Message-Id: <20180507174102.24086-21-vgoyal@redhat.com> In-Reply-To: <20180507174102.24086-1-vgoyal@redhat.com> References: <20180507174102.24086-1-vgoyal@redhat.com> Sender: linux-unionfs-owner@vger.kernel.org To: linux-unionfs@vger.kernel.org Cc: miklos@szeredi.hu, amir73il@gmail.com, vgoyal@redhat.com List-ID: 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 Reviewed-by: Amir Goldstein --- fs/overlayfs/namei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index 51e5c1bc5678..cd06e7ff9fd1 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -268,7 +268,8 @@ static int ovl_lookup_single(struct dentry *base, struct ovl_lookup_data *d, goto out_err; d->stop = !err; d->metacopy = !!err; - goto out; + if (!d->metacopy || d->last) + goto out; } else { if (last_element) { if (d->metacopy) { @@ -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, -- 2.13.6