Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp52746imu; Thu, 8 Nov 2018 14:38:24 -0800 (PST) X-Google-Smtp-Source: AJdET5cx3qGkqIelqxP5bZxnAulOr9yzJ7apZsDucd8uJhkYHvTx1fbAzF/YshYJjSUUy4CV6LA0 X-Received: by 2002:a17:902:598f:: with SMTP id p15-v6mr6323907pli.260.1541716704918; Thu, 08 Nov 2018 14:38:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716704; cv=none; d=google.com; s=arc-20160816; b=OdexBNlng6WrJDFHmWT7f1yLd+/0a++0GuLLVH3y4hwj/shGYz1uUt/wZRGkh3DHgf NY0hwx1EZXj6tZfQB+B34lpzoFm6/QcWfbV3bZEvd10+qNLXHBCHnoHk8WgYH8Z9vR9y esGQjc0G+SieLyOJQ+dVjBf+usTt1OiDTbLn5FMCbkec3DgWw+Z5oJD0UAWQCo+pA3Fm tC+oA0hmD53OQORiLVcXSc8mC1oPljjpF1RMUA6Y/fBdgxSBEbNMYQGxI8Qmc/dXdk7f Sg60XIinrD3sdbSF3F6Orez4YNMAp/+oSVcqx/upQ6giZ8mT+Rn7x9WYWyJYBIF2kzvY 9H6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/qE/bd0eXaYhgm9ntdhEoMgHKABDlL6NJ6W8P6ICD5A=; b=qgj/LGRDgYiaXB4cOTLh1chsH9C/PWISZdjCFu2eKRl/If2TySm0xhhCJmLTHutBj2 yBiQ7X5Q9zPueBDCq5DeLcDTxdga0DaK726rgfSFQ3hqCqqrfoAT31kfLkzbZHMkRP7P p5oLSokEzkN+3yyIVFJK9Ccq1uLfcpmwxn4ZT6vnFgY1S5lJT1itA9YVHyDweBjl7AwZ GIPUrL/5JD5qfixt9twl+YndYKIDirvys+Zl2bZgbl683vjqI44DtFfpxEXFrEDCfhET 3xheFWRTY02X+Fm7knDDMhB1xIUb1kFT6wyDWMG4RQD+MadGCBBzMDC5wmbWhVPphJiw qgZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Hfeh3guB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t25-v6si6014346pfm.152.2018.11.08.14.38.09; Thu, 08 Nov 2018 14:38:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Hfeh3guB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729671AbeKIHft (ORCPT + 99 others); Fri, 9 Nov 2018 02:35:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:52842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728166AbeKIHfs (ORCPT ); Fri, 9 Nov 2018 02:35:48 -0500 Received: from localhost (unknown [208.72.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 431F0208E3; Thu, 8 Nov 2018 21:58:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714300; bh=s+AShUkBd/qwo94Rq0iejbV0auoreRcHzBFuLirBO1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hfeh3guBFVPkY7l0rZk+jFAIyfWebWmxjOuQv7qXiruoQDG3NYmu/G3xt9FEcmCf4 Xh7y7UpVY+ax2vNUyHDnHfSA3bZ6zYbu6COHFKcndF7phdFqFwEav1czla0ezONiQc mRJclnZaDlWfp05qElqtFl7biIHjxq4YW2tG8mPI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alban Crequy , Miklos Szeredi , David Howells , Sasha Levin Subject: [PATCH 3.18 120/144] ovl: fix open in stacked overlay Date: Thu, 8 Nov 2018 13:51:31 -0800 Message-Id: <20181108215106.712592404@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215054.826084593@linuxfoundation.org> References: <20181108215054.826084593@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 1c8a47df36d72ace8cf78eb6c228aa0f8027d3c2 ] If two overlayfs filesystems are stacked on top of each other, then we need recursion in ovl_d_select_inode(). I guess d_backing_inode() is supposed to do that. But currently it doesn't and that functionality is open coded in vfs_open(). This is now copied into ovl_d_select_inode() to fix this regression. Reported-by: Alban Crequy Signed-off-by: Miklos Szeredi Fixes: 4bacc9c9234c ("overlayfs: Make f_path always point to the overlay...") Cc: David Howells Cc: # v4.2+ Signed-off-by: Sasha Levin --- fs/overlayfs/inode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index df5c2853c4e5..a01ec1836a72 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -377,6 +377,9 @@ struct inode *ovl_d_select_inode(struct dentry *dentry, unsigned file_flags) ovl_path_upper(dentry, &realpath); } + if (realpath.dentry->d_flags & DCACHE_OP_SELECT_INODE) + return realpath.dentry->d_op->d_select_inode(realpath.dentry, file_flags); + return d_backing_inode(realpath.dentry); } -- 2.17.1