Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2814229imu; Sun, 23 Dec 2018 08:22:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN7OCDzG6WSX8W43kAW9weMHeV5yq1lClZX+8n48JieJNs7UE2bB8i+aGOrz7zIQQEJ5YPj7 X-Received: by 2002:a65:64c8:: with SMTP id t8mr9467502pgv.31.1545582148628; Sun, 23 Dec 2018 08:22:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545582148; cv=none; d=google.com; s=arc-20160816; b=AAcLjElQSpYq76ACmWZGHazHke41dUvr+BsgR8iaeCZRkSmiB3Eh4uqIPMmopnG5qE zGBXYTPtygLDyp05/vN1RyOvu8vbO5gkJcrdd1un597JXBZieiq8ZF7jOsfb/sIjXEMe QsCOkUk3LBX6D8zhoFr5QOoh1xLY4SRhDB+vZrki/GysBxcjnxo84Eadu8lMSGhaS4r4 G1TvW+lMY9k3bxwabGFI+9ACDVpigYtgn/PTnbRgRD1MtVkuFtWL8ugES+rGTy3wDbX7 q+AgiaOKGL8ArOFE9nBNV86FIQ7f5pMrJinuus13QJIOIMYv0T82QgQ1APPJBHMimmOO BZIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HrorcvRZEX78sXYQ8G4N6jjOV24RosmVQsG97j2g4T4=; b=ecuZ8RJW1PKutroV+pQYrpYxXzfh2A5eA5yNQsROof/nHL3mN7Enbi/D4Yo6PU25oD MYHsc6q873Z0UmYwH4B+bSpi1dPAmtsNlB2lvRKIl6XvA3lzyt2B6PMPegnfRT9sJ8rQ 6CFw3cR7sxJQ7R87W0T8hL5XC2b2z4bTZ2UXYCMwLvhpsLf4FF53qJH4wberzbiwHjCt aIY6wdwvkVRal5W4BovLjpue3ojq4WNPgEErMJun8/xhtUsHqAUdZa1/N6eHjKWzQ/DA 9KjJ/sM//5avFZw2rUg/kCf+LmuvsRHrStRhvL3WnvXLUJAmxc8QOobXSTqJXWzTRq9q yO0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ryFveUid; 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 a3si26432526pld.252.2018.12.23.08.22.13; Sun, 23 Dec 2018 08:22:28 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ryFveUid; 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 S2391660AbeLVRrP (ORCPT + 99 others); Sat, 22 Dec 2018 12:47:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:34140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387623AbeLVRrN (ORCPT ); Sat, 22 Dec 2018 12:47:13 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9684C219FE; Sat, 22 Dec 2018 11:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545477915; bh=rHhuQRG+CPfH9o7bUDFs6weW/e2Z5xXMrhOOXqB/GJA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ryFveUidm95Mm1Ivmbt8jCZFwECvE+4RQxCjQMyY2mzlVoKtNZHZsmpbGUK17/NH7 BCXcrkZxp6U8OpzEwnEOi1UrpirwKJw7y4wGgS3vb7PcddRp20jOWuwkcWuSq3k+66 BLnIuTnvpsT3gCZHbMGpEMZ3C2Io4gVjs21tAU2U= Date: Sat, 22 Dec 2018 12:25:12 +0100 From: Greg KH To: yangerkun Cc: rafael@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] debugfs: remove inc_nlink in debugfs_create_automount Message-ID: <20181222112512.GA27683@kroah.com> References: <20181222084536.21305-1-yangerkun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181222084536.21305-1-yangerkun@huawei.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 22, 2018 at 04:45:36PM +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 | 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); Again, have you tested this and how? How did you find this issue? thanks, greg k-h