diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-04-28 09:00:15 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-25 09:44:37 -0400 |
commit | d10b21d6e56261f5d815b8783f944cae8c6369c1 (patch) | |
tree | c8a73c6f3a97faaf25a92dc90e2021f9b0d0e1f6 /fs | |
parent | 168b2bfaa235e91c2f7a76ac693435e530f486b3 (diff) |
proc: Fix unbalanced hard link numbers
commit d66bb1607e2d8d384e53f3d93db5c18483c8c4f7 upstream.
proc_create_mount_point() forgot to increase the parent's nlink, and
it resulted in unbalanced hard link numbers, e.g. /proc/fs shows one
less than expected.
Fixes: eb6d38d5427b ("proc: Allow creating permanently empty directories...")
Reported-by: Tristan Ye <tristan.ye@suse.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/generic.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 5f2dc2032c79..6047471575bb 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -471,6 +471,7 @@ struct proc_dir_entry *proc_create_mount_point(const char *name) | |||
471 | ent->data = NULL; | 471 | ent->data = NULL; |
472 | ent->proc_fops = NULL; | 472 | ent->proc_fops = NULL; |
473 | ent->proc_iops = NULL; | 473 | ent->proc_iops = NULL; |
474 | parent->nlink++; | ||
474 | if (proc_register(parent, ent) < 0) { | 475 | if (proc_register(parent, ent) < 0) { |
475 | kfree(ent); | 476 | kfree(ent); |
476 | parent->nlink--; | 477 | parent->nlink--; |