Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44563
b: refs/heads/master
c: 65c3333
h: refs/heads/master
i:
  44561: 2e8bba7
  44559: aba2bd2
v: v3
  • Loading branch information
Mathieu Desnoyers authored and Greg Kroah-Hartman committed Dec 13, 2006
1 parent b9795d3 commit a5b11c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 63223a0654c2a473ae64835819b87826cb7415ee
refs/heads/master: 65c333367b1aea57d58168ad3dc1df27b0227401
14 changes: 10 additions & 4 deletions trunk/fs/debugfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ static int debugfs_create_by_name(const char *name, mode_t mode,
error = debugfs_mkdir(parent->d_inode, *dentry, mode);
else
error = debugfs_create(parent->d_inode, *dentry, mode);
dput(*dentry);
} else
error = PTR_ERR(*dentry);
mutex_unlock(&parent->d_inode->i_mutex);
Expand Down Expand Up @@ -273,6 +274,7 @@ EXPORT_SYMBOL_GPL(debugfs_create_dir);
void debugfs_remove(struct dentry *dentry)
{
struct dentry *parent;
int ret = 0;

if (!dentry)
return;
Expand All @@ -284,11 +286,15 @@ void debugfs_remove(struct dentry *dentry)
mutex_lock(&parent->d_inode->i_mutex);
if (debugfs_positive(dentry)) {
if (dentry->d_inode) {
if (S_ISDIR(dentry->d_inode->i_mode))
simple_rmdir(parent->d_inode, dentry);
else
if (S_ISDIR(dentry->d_inode->i_mode)) {
ret = simple_rmdir(parent->d_inode, dentry);
if (ret)
printk(KERN_ERR
"DebugFS rmdir on %s failed : "
"directory not empty.\n",
dentry->d_name.name);
} else
simple_unlink(parent->d_inode, dentry);
dput(dentry);
}
}
mutex_unlock(&parent->d_inode->i_mutex);
Expand Down

0 comments on commit a5b11c0

Please sign in to comment.