aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-04-28 15:00:15 +0200
committerSasha Levin <alexander.levin@verizon.com>2017-05-17 15:08:24 -0400
commit3a9700b0709e1db2179f915d3be3a77aba29240c (patch)
tree55d5178d810c3414a07c8e4d4fc8faa94347110c
parent2279c8b917f7840f1e623cadeb07c12fefc45c77 (diff)
proc: Fix unbalanced hard link numbers
[ Upstream commit d66bb1607e2d8d384e53f3d93db5c18483c8c4f7 ] 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...") Cc: stable@vger.kernel.org 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: Sasha Levin <alexander.levin@verizon.com>
-rw-r--r--fs/proc/generic.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index d99099fe62d4..709586995b46 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -469,6 +469,7 @@ struct proc_dir_entry *proc_create_mount_point(const char *name)
ent->data = NULL;
ent->proc_fops = NULL;
ent->proc_iops = NULL;
+ parent->nlink++;
if (proc_register(parent, ent) < 0) {
kfree(ent);
parent->nlink--;