From patchwork Mon May 7 08:37:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10383495 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 9BD6C6037F for ; Mon, 7 May 2018 08:42:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9296328A96 for ; Mon, 7 May 2018 08:42:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 877B028B3E; Mon, 7 May 2018 08:42:40 +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 3164D28A96 for ; Mon, 7 May 2018 08:42:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752174AbeEGIih (ORCPT ); Mon, 7 May 2018 04:38:37 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36906 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752125AbeEGIiZ (ORCPT ); Mon, 7 May 2018 04:38:25 -0400 Received: by mail-wm0-f66.google.com with SMTP id l1-v6so13847646wmb.2 for ; Mon, 07 May 2018 01:38:25 -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=MSY2TNnMCcLRXSqy28uUaLmlSAv0j93cuKYvlDsE9SQ=; b=U1lY+BkHrpYxUlKW+1BoMnwhZ7qvJWM0H1KcvEHD2AjQnziHSq8lemW4vL5U6R0adE vabcq0AU0+8At79BXeHlWTDrkz2Qu6JIdMHd6EQj64KQXJKAkNdpGiEunhYfNtqOE2uL smamrAM2LMdHg2Xt+1/qFOPSml9uir8mvqq4KxUWAp0h3Ncj25oqL60eETnKtP38JcrI MxHTtQsyNj9q/9Z1KTiOCjC5aUhN6FP5K0RnQZSKUXEdf0QO6vwSK+uZxEdPfssZccKO xdBw5FSc8O+UDmveNXG5quHHg9NXvcufM3+Xf/haykNrCjfgirfIOnrqxLiv1Xzrpld6 K3RA== X-Gm-Message-State: ALQs6tCk26YOga3SvBnRsUL1eJb30YbJTLYvmXCgAm9rhYzvD6SAMV3U fUnrHP/yFC0GYvhZ/xz8o/ERCw== X-Google-Smtp-Source: AB8JxZpQESIGtMq1MKOALWZqZLLXbvuUNmUKEQuSL57sMxie6BJbkgNy2OlctaQWYvS+6HNO5991eg== X-Received: by 2002:a1c:170f:: with SMTP id 15-v6mr180053wmx.90.1525682304676; Mon, 07 May 2018 01:38:24 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (C2B0E321.catv.pool.telekom.hu. [194.176.227.33]) by smtp.gmail.com with ESMTPSA id h8-v6sm5908050wmc.16.2018.05.07.01.38.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 May 2018 01:38:24 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 10/35] ovl: deal with overlay files in ovl_d_real() Date: Mon, 7 May 2018 10:37:42 +0200 Message-Id: <20180507083807.28792-11-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180507083807.28792-1-mszeredi@redhat.com> References: <20180507083807.28792-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 Signed-off-by: Miklos Szeredi --- fs/overlayfs/super.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index e8551c97de51..ad6a5baf226b 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -97,6 +97,10 @@ static struct dentry *ovl_d_real(struct dentry *dentry, struct dentry *real; int err; + /* It's an overlay file */ + if (inode && d_inode(dentry) == inode) + return dentry; + if (flags & D_REAL_UPPER) return ovl_dentry_upper(dentry);