From 4b63e1cabf758593e85158fde78b0e075c9f9912 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Sat, 25 Apr 2009 00:39:40 -0400 Subject: [PATCH] --- yaml --- r: 151238 b: refs/heads/master c: 56a83cc92991ed5bf76e224dd2ad53b5e9c00681 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/debugfs/inode.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 3ec0315aa10f..9a925098f38f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c0afe7ba5e71d8ab66bc42f90b3e237581d3c509 +refs/heads/master: 56a83cc92991ed5bf76e224dd2ad53b5e9c00681 diff --git a/trunk/fs/debugfs/inode.c b/trunk/fs/debugfs/inode.c index 0662ba6de85a..d22438ef7674 100644 --- a/trunk/fs/debugfs/inode.c +++ b/trunk/fs/debugfs/inode.c @@ -403,6 +403,7 @@ void debugfs_remove_recursive(struct dentry *dentry) } child = list_entry(parent->d_subdirs.next, struct dentry, d_u.d_child); + next_sibling: /* * If "child" isn't empty, walk down the tree and @@ -416,6 +417,16 @@ void debugfs_remove_recursive(struct dentry *dentry) } __debugfs_remove(child, parent); if (parent->d_subdirs.next == &child->d_u.d_child) { + /* + * Try the next sibling. + */ + if (child->d_u.d_child.next != &parent->d_subdirs) { + child = list_entry(child->d_u.d_child.next, + struct dentry, + d_u.d_child); + goto next_sibling; + } + /* * Avoid infinite loop if we fail to remove * one dentry.