From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2999842AbdD2CNX (ORCPT ); Fri, 28 Apr 2017 22:13:23 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:39390 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2999774AbdD2CNN (ORCPT ); Fri, 28 Apr 2017 22:13:13 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Takashi Iwai Cc: Al Viro , Andrew Morton , Tristan Ye , linux-kernel@vger.kernel.org References: <20170428130015.14775-1-tiwai@suse.de> Date: Fri, 28 Apr 2017 21:06:56 -0500 In-Reply-To: <20170428130015.14775-1-tiwai@suse.de> (Takashi Iwai's message of "Fri, 28 Apr 2017 15:00:15 +0200") Message-ID: <877f24vuf3.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1d4Hsg-0003q4-MA;;;mid=<877f24vuf3.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=67.3.233.227;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+k9GdEUiWxIcoPVaV2ddD/bH1bJsyZS28= X-SA-Exim-Connect-IP: 67.3.233.227 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Takashi Iwai X-Spam-Relay-Country: X-Spam-Timing: total 5683 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 3.2 (0.1%), b_tie_ro: 2.2 (0.0%), parse: 0.86 (0.0%), extract_message_metadata: 15 (0.3%), get_uri_detail_list: 1.17 (0.0%), tests_pri_-1000: 7 (0.1%), tests_pri_-950: 1.16 (0.0%), tests_pri_-900: 0.95 (0.0%), tests_pri_-400: 17 (0.3%), check_bayes: 16 (0.3%), b_tokenize: 4.9 (0.1%), b_tok_get_all: 4.9 (0.1%), b_comp_prob: 1.65 (0.0%), b_tok_touch_all: 2.8 (0.0%), b_finish: 0.63 (0.0%), tests_pri_0: 149 (2.6%), check_dkim_signature: 0.45 (0.0%), check_dkim_adsp: 3.2 (0.1%), tests_pri_500: 5486 (96.5%), poll_dns_idle: 5480 (96.4%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH] proc: Fix unbalanced hard link numbers X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Takashi Iwai 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 > Signed-off-by: Takashi Iwai > --- > 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--;