From patchwork Tue May 29 14:46:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10435811 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 587F960327 for ; Tue, 29 May 2018 14:53:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 451D42864E for ; Tue, 29 May 2018 14:53:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39E4E2267B; Tue, 29 May 2018 14:53:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E62612864E for ; Tue, 29 May 2018 14:53:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936466AbeE2Ovg (ORCPT ); Tue, 29 May 2018 10:51:36 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:39665 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935708AbeE2Oqi (ORCPT ); Tue, 29 May 2018 10:46:38 -0400 Received: by mail-wm0-f52.google.com with SMTP id f8-v6so41464779wmc.4 for ; Tue, 29 May 2018 07:46:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xQMyeTYMDehYeJYrwxxlvtlPUGd+eKwSrAnrKxA0i5Q=; b=fvhaxcnCAB8JObK2rKXuQy88jFmw/Zj7MXY/jaDSZB9vCygC/5XNlGQv7YVZSSkRJr rbpAqPqJ3KTnXBdNkfQhmRXEuDVpFSN3e6EiqEQh6z5EzXZ+/F8Riyuu9/M9a5ppWU3K ewHlWGkLUndHKxqiCmPOMKloYPs6bl1MAiDVTOAFxR/7sQH2NZUYJSVKq8r5tEB/n+jm GI8MmtcigXfenV9pW5xwzhRWKcF5hTc7Kc7GGGXCoYQ8Mg+jHRJh7GOraE2XfLHrzrpc /LLfPp3jSFWFhHTe4bpcoNbQ9kgtrK5Eq8eRwgdK+oho6HctY3AF/wsFdYKdtG8zALUJ zj4w== X-Gm-Message-State: ALKqPweDEyhM4YHB0n/nFmlQRi1HDKjP6bU5VRmopuN49OW3FUTB929Q b0BsIiXUYG+F44sj37oklaVpA+7aCCE= X-Google-Smtp-Source: ADUXVKKzNyhohHh8NqQst/Bq2V9YmKrnEOkKrzhUAtBVucc6qixMBDvMw8mGK64Z+gTnbCkmK1QSlQ== X-Received: by 2002:a1c:8ec1:: with SMTP id q184-v6mr1323307wmd.48.1527605197498; Tue, 29 May 2018 07:46:37 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-176-63-54-97.catv.broadband.hu. [176.63.54.97]) by smtp.gmail.com with ESMTPSA id n71-v6sm20942227wmi.14.2018.05.29.07.46.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 07:46:36 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/28] ovl: Check redirects for metacopy files Date: Tue, 29 May 2018 16:46:02 +0200 Message-Id: <20180529144612.16675-19-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180529144612.16675-1-mszeredi@redhat.com> References: <20180529144612.16675-1-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vivek Goyal 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 Signed-off-by: Miklos Szeredi --- 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 451cd6effcf6..e38fa61e08df 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,