lkml.org 
[lkml]   [2017]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] proc: Fix unbalanced hard link numbers
Takashi Iwai <tiwai@suse.de> writes:

> 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.

Applied. Thanks.

>
> 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>
> ---
> fs/proc/generic.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/proc/generic.c b/fs/proc/generic.c
> index ee27feb34cf4..9425c0d97262 100644
> --- a/fs/proc/generic.c
> +++ b/fs/proc/generic.c
> @@ -472,6 +472,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--;

\
 
 \ /
  Last update: 2017-04-29 04:14    [W:0.043 / U:1.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site