lkml.org 
[lkml]   [2018]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] debugfs: remove no need inc_nlink
On Sat, Dec 22, 2018 at 11:41:11AM +0800, yangerkun wrote:
> Remove inc_nlink in debugfs_create_automount, or this inode will never
> be free.
>
> Signed-off-by: yangerkun <yangerkun@huawei.com>
> ---
> fs/debugfs/inode.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
> index 13b0135..9e6e225 100644
> --- a/fs/debugfs/inode.c
> +++ b/fs/debugfs/inode.c
> @@ -516,8 +516,6 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent)
> inode->i_op = &simple_dir_inode_operations;
> inode->i_fop = &simple_dir_operations;
>
> - /* directory inodes start off with i_nlink == 2 (for "." entry) */
> - inc_nlink(inode);

Really? How did you test this and why does removing this line directly
go against what the comment says?

this feels really wrong...

greg k-h

\
 
 \ /
  Last update: 2018-12-22 18:50    [W:0.067 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site