Skip to contentSkip to conversation

Kprobes : Recursively remove the directory on failure

PATCH In review Sasikantha babu 2 participants 2 messages Apr 3, 2012 – Apr 6, 2012 kprobes

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Kprobes : Recursively remove the directory on failure

Remove the "kprobes" directory recursivly if "enabled" file creation fails

---
 kernel/kprobes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/kprobes.c +1 -1
index c62b854..9b45515 100644
@@ -2251,7 +2251,7 @@ static int __kprobes debugfs_kprobe_init(void)
 	file = debugfs_create_file("enabled", 0600, dir,
 					&value, &fops_kp);
 	if (!file) {
-		debugfs_remove(dir);
+		debugfs_remove_recursive(dir);
 		return -ENOMEM;
 	}
 
Signature · 1 line
1.7.3.4
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Sasikantha babu

Remove the "kprobes" directory recursivly if "enabled" file creation fails

Right, this should remove recursively, because there is "list" file already.
Thank you!

Quoted 17 lines
---
 kernel/kprobes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/kprobes.c +1 -1
index c62b854..9b45515 100644
@@ -2251,7 +2251,7 @@ static int __kprobes debugfs_kprobe_init(void)
 	file = debugfs_create_file("enabled", 0600, dir,
 					&value, &fops_kp);
 	if (!file) {
-		debugfs_remove(dir);
+		debugfs_remove_recursive(dir);
 		return -ENOMEM;
 	}
 
Signature · 4 lines
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: [email protected]