From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751334AbbJNEot (ORCPT ); Wed, 14 Oct 2015 00:44:49 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:9656 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750724AbbJNEos (ORCPT ); Wed, 14 Oct 2015 00:44:48 -0400 Subject: Re: [PATCH] debugfs: update commits of debugfs_remove To: References: <1444791237-105846-1-git-send-email-tanxiaojun@huawei.com> CC: From: Tan Xiaojun Message-ID: <561DDDA9.4030009@huawei.com> Date: Wed, 14 Oct 2015 12:44:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1444791237-105846-1-git-send-email-tanxiaojun@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.21.79] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.561DDDB1.0045,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 2607ba5552e88191f63585df3edde760 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Please ignore this patch, I make a spelling mistake. On 2015/10/14 10:53, Tan Xiaojun wrote: > This function debugfs_remove can't remove a directory if it is not > empty. The commits make misunderstood and cause misuse easily, so > update it. > > Signed-off-by: Tan Xiaojun > --- > fs/debugfs/inode.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c > index c711be8..350754e 100644 > --- a/fs/debugfs/inode.c > +++ b/fs/debugfs/inode.c > @@ -531,7 +531,8 @@ static int __debugfs_remove(struct dentry *dentry, struct dentry *parent) > } > > /** > - * debugfs_remove - removes a file or directory from the debugfs filesystem > + * debugfs_remove - removes a file or an empty directory from the debugfs > + * filesystem > * @dentry: a pointer to a the dentry of the file or directory to be > * removed. > * > @@ -542,6 +543,9 @@ static int __debugfs_remove(struct dentry *dentry, struct dentry *parent) > * This function is required to be called in order for the file to be > * removed, no automatic cleanup of files will happen when a module is > * removed, you are responsible here. > + * > + * For removing directory, if you are not sure it is empty or not, use > + * debugfs_remove_recursive instead. > */ > void debugfs_remove(struct dentry *dentry) > { >