From: Andy Isaacson on 15 Jul 2010 13:30 blktrace fails to completely clean up after itself if BLKTRACESTOP is called before the final trace file is closed: % blktrace /dev/sdb & % exec 6</sys/kernel/debug/block/sdb/trace0 % kill %1 % find /sys/kernel/debug/block/ /sys/kernel/debug/block/ /sys/kernel/debug/block/sdb /sys/kernel/debug/block/sdb/trace0 % exec 6<&- % find /sys/kernel/debug/block/ /sys/kernel/debug/block/ /sys/kernel/debug/block/sdb The proper fix is to move cleanup from BLKTRACESTOP to the close routine, but that's nontrivial, so here's a simple fix to remove debug/block/<dev> when the last trace%d file is closed. Cc: stable(a)kernel.org Signed-off-by: Andy Isaacson <adi(a)hexapodia.org> --- kernel/trace/blktrace.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 347fe8e..9b78930 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -383,8 +383,12 @@ static int blk_subbuf_start_callback(struct rchan_buf *buf, void *subbuf, static int blk_remove_buf_file_callback(struct dentry *dentry) { + struct dentry *parent = dentry->d_parent; debugfs_remove(dentry); + if (simple_empty(parent)) + debugfs_remove(parent); + return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|
Pages: 1 Prev: [PATCH 1/2] blktrace: use cmpxchg Next: kmemleak: Add support for NO_BOOTMEM configurations |