Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752711AbdFLS3f (ORCPT ); Mon, 12 Jun 2017 14:29:35 -0400 Received: from mail-yb0-f194.google.com ([209.85.213.194]:34714 "EHLO mail-yb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752251AbdFLS3d (ORCPT ); Mon, 12 Jun 2017 14:29:33 -0400 Date: Mon, 12 Jun 2017 14:29:31 -0400 From: Tejun Heo To: Shaohua Li Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, gregkh@linuxfoundation.org, hch@lst.de, axboe@fb.com, rostedt@goodmis.org, lizefan@huawei.com, Kernel-team@fb.com, Shaohua Li Subject: Re: [PATCH 04/11] kernfs: don't set dentry->d_fsdata Message-ID: <20170612182931.GI19206@htj.duckdns.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1045 Lines: 33 Hello, On Fri, Jun 02, 2017 at 02:53:57PM -0700, Shaohua Li wrote: > @@ -570,7 +570,8 @@ static int kernfs_dop_revalidate(struct dentry *dentry, unsigned int flags) > goto out_bad; > > /* The kernfs node has been moved? */ > - if (dentry->d_parent->d_fsdata != kn->parent) > + if (d_really_is_negative(dentry->d_parent) || > + kernfs_dentry_node(dentry->d_parent) != kn->parent) > goto out_bad; Can we move d_really_is_negative() into kernfs_dentry_node()? That might add an additional NULL test to some paths but I don't think that will ever show up anywhere. > diff --git a/fs/kernfs/kernfs-internal.h b/fs/kernfs/kernfs-internal.h > index 3534cfe..82e11fa 100644 > --- a/fs/kernfs/kernfs-internal.h > +++ b/fs/kernfs/kernfs-internal.h > @@ -70,6 +70,8 @@ struct kernfs_super_info { > }; > #define kernfs_info(SB) ((struct kernfs_super_info *)(SB->s_fs_info)) > > +#define kernfs_dentry_node(d) ((d_inode(d))->i_private) I know the prev one is a macro but let's make the new one an inline function. Thnaks. -- tejun