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 inc_nlink in debugfs_create_automount
On Sat, Dec 22, 2018 at 04:45:36PM +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 | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
> index 13b01351dd1c..9294238e364f 100644
> --- a/fs/debugfs/inode.c
> +++ b/fs/debugfs/inode.c
> @@ -551,12 +551,11 @@ struct dentry *debugfs_create_automount(const char *name,
> if (unlikely(!inode))
> return failed_creating(dentry);
>
> + /* directory inodes start off with i_nlink == 2 (for "." entry) */
> make_empty_dir_inode(inode);
> inode->i_flags |= S_AUTOMOUNT;
> inode->i_private = data;
> dentry->d_fsdata = (void *)f;
> - /* directory inodes start off with i_nlink == 2 (for "." entry) */
> - inc_nlink(inode);

Again, have you tested this and how? How did you find this issue?

thanks,

greg k-h

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