aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/debugfs/inode.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index d6c5fb53c746..554f4a9dfaf8 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -162,6 +162,7 @@ static int debugfs_create_by_name(const char *name, mode_t mode,
162 error = debugfs_mkdir(parent->d_inode, *dentry, mode); 162 error = debugfs_mkdir(parent->d_inode, *dentry, mode);
163 else 163 else
164 error = debugfs_create(parent->d_inode, *dentry, mode); 164 error = debugfs_create(parent->d_inode, *dentry, mode);
165 dput(*dentry);
165 } else 166 } else
166 error = PTR_ERR(*dentry); 167 error = PTR_ERR(*dentry);
167 mutex_unlock(&parent->d_inode->i_mutex); 168 mutex_unlock(&parent->d_inode->i_mutex);
@@ -273,6 +274,7 @@ EXPORT_SYMBOL_GPL(debugfs_create_dir);
273void debugfs_remove(struct dentry *dentry) 274void debugfs_remove(struct dentry *dentry)
274{ 275{
275 struct dentry *parent; 276 struct dentry *parent;
277 int ret = 0;
276 278
277 if (!dentry) 279 if (!dentry)
278 return; 280 return;
@@ -284,11 +286,15 @@ void debugfs_remove(struct dentry *dentry)
284 mutex_lock(&parent->d_inode->i_mutex); 286 mutex_lock(&parent->d_inode->i_mutex);
285 if (debugfs_positive(dentry)) { 287 if (debugfs_positive(dentry)) {
286 if (dentry->d_inode) { 288 if (dentry->d_inode) {
287 if (S_ISDIR(dentry->d_inode->i_mode)) 289 if (S_ISDIR(dentry->d_inode->i_mode)) {
288 simple_rmdir(parent->d_inode, dentry); 290 ret = simple_rmdir(parent->d_inode, dentry);
289 else 291 if (ret)
292 printk(KERN_ERR
293 "DebugFS rmdir on %s failed : "
294 "directory not empty.\n",
295 dentry->d_name.name);
296 } else
290 simple_unlink(parent->d_inode, dentry); 297 simple_unlink(parent->d_inode, dentry);
291 dput(dentry);
292 } 298 }
293 } 299 }
294 mutex_unlock(&parent->d_inode->i_mutex); 300 mutex_unlock(&parent->d_inode->i_mutex);