Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2533019imu; Sun, 23 Dec 2018 01:49:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN7MeA1vlPxXer+G0itpg5PlEXDoGPRH7Z0cCdmwzDkwQvB1gZmQsuF+wrRgpVDiYTW7BygM X-Received: by 2002:a17:902:2c03:: with SMTP id m3mr8766794plb.6.1545558599910; Sun, 23 Dec 2018 01:49:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545558599; cv=none; d=google.com; s=arc-20160816; b=icUwduYJ/WiyMUCQyMloosDu6Dt6T9oAeuAodHczfJpr7F3J+QynU4JQx9mnPQ2ntm Z8pgayHVKWFnRiy6eJvCTNTvGae4sNNjvg1BcB/AWkw3HBZ1OI7XK4jadbQ9Equtihyb aPVGX4W03sLPGwLG+1vlyF3ujd/6cY3CpeRpNHu9XVF3yZ2JkQo2HqgUUH7EihyVrrie wlGZXd7+mEU83F8nA1zLGjccn9oC7ZcWBDbVMJWAQjzt53FgwVKk9j/24/jChr6IS9P5 8nZUWRuDzs3JFgINlaCf9hbfj7gYu5o9O66WRwQRePfQVoq3UOnZVvfIrB2Omzy3mlND ldlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=0tpHCzqfaBMzjZIRLIR1KlaGSFIKIXE5l1IB0v+pe6M=; b=0DSDzbzP48uYept+zq+bzaUYTvXgPRHKQO97Ybi1WJhcPJ1WIeELnYrsZvlezGBq+n zKqGWJ4mpnnbUC3cXj1ZybQDzCNXYMKZ/OV7d6um3bBrDI2fiuvcqGJS1cFRwKc9+o5J X8IiOEB3nhZGYeMM/luXqyshld+Q+pYfsc7M0SOilYmGPZhASJNpat+gYrFVkWfodcCm h/T9QYk17vckOdSy8P45PM8UAOiFLXBPhq6fUNfUte3wt3awdfvFUROzRIJxAp3zNpDo 2v2UIr+BfcRohOjlS399NNuycOE+p43WHdZnbU39D2QKi16lUn2TvOUAVOmIwOC98i/V S4Hw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i17si22161115pgk.233.2018.12.23.01.49.44; Sun, 23 Dec 2018 01:49:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387542AbeLVDyC (ORCPT + 99 others); Fri, 21 Dec 2018 22:54:02 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:17054 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728705AbeLVDyC (ORCPT ); Fri, 21 Dec 2018 22:54:02 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id F41CC42823308; Sat, 22 Dec 2018 11:38:03 +0800 (CST) Received: from RH5885H-V3.huawei.com (10.90.53.225) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Sat, 22 Dec 2018 11:37:57 +0800 From: yangerkun To: , CC: , Subject: [PATCH] debugfs: remove no need inc_nlink Date: Sat, 22 Dec 2018 11:41:11 +0800 Message-ID: <20181222034111.15214-1-yangerkun@huawei.com> X-Mailer: git-send-email 2.9.5 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove inc_nlink in debugfs_create_automount, or this inode will never be free. Signed-off-by: yangerkun --- fs/debugfs/inode.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 13b0135..9e6e225 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -516,8 +516,6 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent) inode->i_op = &simple_dir_inode_operations; inode->i_fop = &simple_dir_operations; - /* 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.9.5