Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033254AbbKFT3q (ORCPT ); Fri, 6 Nov 2015 14:29:46 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:47241 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031785AbbKFTW1 (ORCPT ); Fri, 6 Nov 2015 14:22:27 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alban Crequy , Miklos Szeredi , David Howells Subject: [PATCH 4.2 085/110] ovl: fix open in stacked overlay Date: Fri, 6 Nov 2015 11:19:32 -0800 Message-Id: <20151106191708.446023147@linuxfoundation.org> X-Mailer: git-send-email 2.6.2 In-Reply-To: <20151106191703.247930828@linuxfoundation.org> References: <20151106191703.247930828@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1453 Lines: 44 4.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Miklos Szeredi commit 1c8a47df36d72ace8cf78eb6c228aa0f8027d3c2 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- fs/overlayfs/inode.c | 3 +++ 1 file changed, 3 insertions(+) --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -363,6 +363,9 @@ struct inode *ovl_d_select_inode(struct 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); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/