Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2823584imu; Sun, 23 Dec 2018 08:35:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN5yOv3JnxFm0ZkBfpB4tZX7c339SjLVemejBSxD9tdoA4G7b/7koRkmcZF5VfSz6rerArFw X-Received: by 2002:a63:7e5b:: with SMTP id o27mr9572890pgn.214.1545582911555; Sun, 23 Dec 2018 08:35:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545582911; cv=none; d=google.com; s=arc-20160816; b=QJ6KZXWwz3TmOGPHuK6Vi2GihKp04lcubwQeSCENDOogIE+/VGeExSP738FQevSM+E iRSgErDsnTaEXLl2DCF+2NZM/i9i1PQR0VTJ3LsM5AMKFnqkr4NHMRdYuzGGBpAVQmn4 z7t/k874uaYjjnThLj03b5YYfU01SoKhLF0BiD8a0MelgKGChF174YvUb3UR+h8S2GAP BqWXCyVCH3G0UbxVSQJUXKB5JKAf+eZSExU8Ky3vUTMoOOikkv39OIefAuXoxsumjCAQ GPVEyiKiS3cxJHtIFq0+RM4BbAcvM1crmG/5Ij6s/T9kDiPThbqbsctY/pfm9d2FvRGD N8CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=DpMqhxrvBDZyM3MGvV0KVc0BiF01AHrfUMDXfKpVs8E=; b=0qcNbLiWWVGN9DJFuC1WaFkr1tXy1soo9AlIT76lUabmL9bpRSNMVxSEmdUJGaVEJ2 uVVQihmIV2dVlyTan4NyI8I65Lhy264QTlVmDJyU4glgDmcvpsy4TPHshSoFIbgfCxDY Tj1WW3PaIthaigmz2Dy37zWcwNZEVlAWPz/EMHSpFKe8hDNxvytZWtBi/e8qcQUTnyye NAQBDKzRpR0VtUVG6aEv6AjD0jX+g172UuRq7dG5orFTv9zP8ssMhbw1dBaWUROXg3ga 3ZRwSp3oWr6fP8MGIqGJ3G5f1+dEcVkIX5AKzi0Fz+CJZlDxTnwPxwlIOqXJaTY8jWuS Md1g== 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 s80si2019498pfa.130.2018.12.23.08.34.56; Sun, 23 Dec 2018 08:35:11 -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 S2393034AbeLWA3g (ORCPT + 99 others); Sat, 22 Dec 2018 19:29:36 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:50025 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387711AbeLWA3g (ORCPT ); Sat, 22 Dec 2018 19:29:36 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8D2425AE94266; Sat, 22 Dec 2018 16:43:26 +0800 (CST) Received: from [127.0.0.1] (10.177.33.43) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.408.0; Sat, 22 Dec 2018 16:43:22 +0800 Subject: Re: [PATCH] debugfs: remove no need inc_nlink To: Greg KH CC: , References: <20181222034111.15214-1-yangerkun@huawei.com> <20181222073205.GA21053@kroah.com> From: yangerkun Message-ID: <16b85779-5939-eff9-72a4-eb1e6159b2e4@huawei.com> Date: Sat, 22 Dec 2018 16:43:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20181222073205.GA21053@kroah.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.33.43] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Greg KH wrote on 2018/12/22 15:32: > On Sat, Dec 22, 2018 at 11:41:11AM +0800, yangerkun wrote: >> 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); > > Really? How did you test this and why does removing this line directly > go against what the comment says? So sorry for this, the fuction should be modify is debugfs_create_automount. Patch will coming soon. Thanks, Kun. > > this feels really wrong... > > greg k-h > > . >