From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from a.ns.miles-group.at ([95.130.255.143]:11949 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbcEAUVi (ORCPT ); Sun, 1 May 2016 16:21:38 -0400 Subject: Re: [PATCH] hostfs: fix opening file with overlayfs To: Toshikuni Fukaya , user-mode-linux-devel@lists.sourceforge.net References: <1462093338-8759-1-git-send-email-toshiq2@gmail.com> Cc: jdike@addtoit.com, linux-fsdevel , David Howells , Al Viro , mszeredi@redhat.com From: Richard Weinberger Message-ID: <5726654D.1070500@nod.at> Date: Sun, 1 May 2016 22:21:33 +0200 MIME-Version: 1.0 In-Reply-To: <1462093338-8759-1-git-send-email-toshiq2@gmail.com> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Sender: linux-fsdevel-owner@vger.kernel.org List-ID: CC'ing VFS folks Am 01.05.2016 um 11:02 schrieb Toshikuni Fukaya: > If a file on overlayfs using hostfs as a lowerdir is opened, it would > be failed by ENOENT because hostfs resolves a host path by a host root > path stored on the hostfs superblock referred by file->f_path.dentry, > but it is replaced with overlayfs's one starting from the > commit 4bacc9c9234c ("overlayfs: Make f_path always point to the > overlay and f_inode to the underlay"). > > We replace using file->f_path.dentry directly with calling > "file_dentry" from a commit d101a125954e ("fs: add file_dentry()") to > fix the issue. Is there a reason why not all instances of file->f_path.dentry have been replaced by file_dentry()? I smell more fallout... Thanks, //richard > Signed-off-by: Toshikuni Fukaya > --- > fs/hostfs/hostfs_kern.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c > index 7016653..26a9f43 100644 > --- a/fs/hostfs/hostfs_kern.c > +++ b/fs/hostfs/hostfs_kern.c > @@ -284,7 +284,7 @@ static int hostfs_readdir(struct file *file, struct dir_context *ctx) > int error, len; > unsigned int type; > > - name = dentry_name(file->f_path.dentry); > + name = dentry_name(file_dentry(file)); > if (name == NULL) > return -ENOMEM; > dir = open_dir(name, &error); > @@ -323,7 +323,7 @@ retry: > if (mode & FMODE_WRITE) > r = w = 1; > > - name = dentry_name(file->f_path.dentry); > + name = dentry_name(file_dentry(file)); > if (name == NULL) > return -ENOMEM; > >