Re: [PATCH] Kprobes : Recursively remove the directory on failure

From: Masami Hiramatsu
Date: Fri Apr 06 2012 - 03:53:56 EST


(2012/04/04 0:35), Sasikantha babu wrote:
> Remove the "kprobes" directory recursivly if "enabled" file creation fails
>
> Signed-off-by: Sasikantha babu <sasikanth.v19@xxxxxxxxx>

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

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@xxxxxxxxxxx>

> ---
> kernel/kprobes.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index c62b854..9b45515 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -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;
> }
>


--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@xxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/