From patchwork Tue May 29 14:46:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10435787 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 4BE88602BF for ; Tue, 29 May 2018 14:51:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C3A6286F5 for ; Tue, 29 May 2018 14:51:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AA9A287AA; Tue, 29 May 2018 14:51: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=ham 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 55FE628761 for ; Tue, 29 May 2018 14:51:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964871AbeE2Oui (ORCPT ); Tue, 29 May 2018 10:50:38 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40398 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936633AbeE2Oqj (ORCPT ); Tue, 29 May 2018 10:46:39 -0400 Received: by mail-wm0-f68.google.com with SMTP id x2-v6so33971741wmh.5 for ; Tue, 29 May 2018 07:46:39 -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=2FJD4FVMNZyj4+zku4PRxgxKsyyTUvCMBBNHA2j/fw4=; b=VMfnSU5TvDeYbEoZI1wKPd9Htkmvey8QUQtMlyop6ILEN7skUCPwDqNHkfge8k0BPP rLKAukjHmQN4pFBKWXuqDNtYNl5i36BzJB3q/6jYv1ZLk/4uUIiiFf9XK6aSRvMek3nk O4i4zLrZr4WLYGWf7WDsIhiuUQYPOcNsPx8rAT/K6+YbpSMQyDv7NOnQurpfCgu5YBP9 vvRL2nEkl5SM69s6tqLUlO+1cMyCaABmzGsgALCaunpg2s6ahAQioCCBFdtwQwg8UEax zvM6BHiID4+s3EkSpUJeVGNvzt+t4IU+B/S0nToYMu9E4dXUqPxRfSf4pZxRuKSj7WBP jzmw== X-Gm-Message-State: ALKqPwd9bpzZxZefAqmTSNRtBcA3Jatyxav/PxvS6qMbeOEYRsRlpUYo Ggm65OUk9i/VAXaS5s3vDCpXMG6otNo= X-Google-Smtp-Source: ADUXVKIGZ4dyO1nSePeL/UU4mLvDPhhXsacaZvT7ZR0ai2PHz+O7qiRxDjgzR7b0yTj6HyHtcwOAeQ== X-Received: by 2002:a1c:6503:: with SMTP id z3-v6mr10530312wmb.11.1527605198706; Tue, 29 May 2018 07:46:38 -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.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 07:46:38 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 19/28] ovl: Treat metacopy dentries as type OVL_PATH_MERGE Date: Tue, 29 May 2018 16:46:03 +0200 Message-Id: <20180529144612.16675-20-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 OVL_PATH_MERGE is used only for merged directories. But conceptually, a metacopy dentry (backed by a lower data dentry) is a merged entity as well. So mark metacopy dentries as OVL_PATH_MERGE and ovl_rename() makes use of this property later to set redirect on a metacopy file. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 73939e08d8bf..61ace2de3019 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -134,7 +134,8 @@ enum ovl_path_type ovl_path_type(struct dentry *dentry) */ if (oe->numlower) { type |= __OVL_PATH_ORIGIN; - if (d_is_dir(dentry)) + if (d_is_dir(dentry) || + !ovl_has_upperdata(d_inode(dentry))) type |= __OVL_PATH_MERGE; } } else {