All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] debugfs: remove inc_nlink in debugfs_create_automount
@ 2018-12-22  8:45 yangerkun
  2018-12-22 11:25 ` Greg KH
  2018-12-23  1:13 ` Al Viro
  0 siblings, 2 replies; 4+ messages in thread
From: yangerkun @ 2018-12-22  8:45 UTC (permalink / raw)
  To: gregkh, rafael; +Cc: yangerkun, linux-kernel

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);
 	d_instantiate(dentry, inode);
 	inc_nlink(d_inode(dentry->d_parent));
 	fsnotify_mkdir(d_inode(dentry->d_parent), dentry);
-- 
2.14.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-24  3:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-22  8:45 [PATCH] debugfs: remove inc_nlink in debugfs_create_automount yangerkun
2018-12-22 11:25 ` Greg KH
2018-12-24  3:47   ` yangerkun
2018-12-23  1:13 ` Al Viro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.