Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2823625imu; Sun, 23 Dec 2018 08:35:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN4GSHstH4YKgixGBDCbEA8iVgCy2UOrVnYij+Hp8joAEFX6BhjopdRNngLRsi/3LvUb2A+X X-Received: by 2002:a62:2292:: with SMTP id p18mr10508679pfj.9.1545582914567; Sun, 23 Dec 2018 08:35:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545582914; cv=none; d=google.com; s=arc-20160816; b=zKCEeY00aMi0oSp8ORAKLM4s+JBwcCL45Cnj/FOsJh0m2aN3NspB9UxmQQLKm2UvVJ KIYyTKNb5ufAJPckOyhGFD0cQZU02SFFaTVWRLnF8r5F014PvYhCjkPvZZdI+PgXZCC0 EVsSxT8PojaSjexCIxxxF+toL/lmoktG7yjQE6H+9VrIy6wx09BM4w1FnETprO1hHx+M y09d8d19GIUO4glW5tc6B01/zTKCFIaqEAk6DZWVNEc5SAcrpwvYGeSqEEcE99t823qr P3AlOkhHgNSfvFkVnLIg2MU9eZrmjfv/hAh1L94Iegend2U0d+NUJ/dh4dQ4813DrcWV km6A== 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=UP/qvFcGDxuz2jmuYzpIIlP85Ql5tSK/ViXe+rygjcM=; b=wQp8Z6NEviSsqlW47BWkdXTmaZbnopnsk4HpTfKVfzcb4GSX2PYjstrOL2JzllrC5/ DM2s+Psw+1QvPDpsxWhJ0j8COkvBSH2riz0d7ngg8NHJuq3KE6X4PVHW8Qk2IT4nRMb/ WLHcKR/SrjlGb37qVFi2J3QxMTJytFRiq/cWPogCY7c48e/ovJJL/9l03TuSGZNQ/q/V IuSRYDQOcNWMLGgAGCQLHVhLteVfe8/ZqYYdgBekgFOgUMXJNnPQoH+h04vC8Vp5/eYe b5exrhs5HNgQDkH7XDC+Nn3TN/wTNcIJONMDsK8lqiPj+Bax6brQsGVvB57joTSDyF3E 6xXg== 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 d25si24647210pgd.88.2018.12.23.08.34.59; Sun, 23 Dec 2018 08:35:14 -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 S2393045AbeLWAdD (ORCPT + 99 others); Sat, 22 Dec 2018 19:33:03 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:16655 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387711AbeLWAdC (ORCPT ); Sat, 22 Dec 2018 19:33:02 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 03C9AE84DC7BB; Sat, 22 Dec 2018 16:46:56 +0800 (CST) Received: from 138.huawei.com (10.175.124.28) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.408.0; Sat, 22 Dec 2018 16:46:46 +0800 From: yangerkun To: , CC: , Subject: [PATCH] debugfs: remove inc_nlink in debugfs_create_automount Date: Sat, 22 Dec 2018 16:45:36 +0800 Message-ID: <20181222084536.21305-1-yangerkun@huawei.com> X-Mailer: git-send-email 2.14.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.28] 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 13b01351dd1c..9294238e364f 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -551,12 +551,11 @@ struct dentry *debugfs_create_automount(const char *name, if (unlikely(!inode)) return failed_creating(dentry); + /* directory inodes start off with i_nlink == 2 (for "." entry) */ make_empty_dir_inode(inode); inode->i_flags |= S_AUTOMOUNT; inode->i_private = data; dentry->d_fsdata = (void *)f; - /* 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.14.4