diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-12-01 16:18:56 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-12-01 16:18:56 -0500 |
commit | c99da91e7a12724127475a85cc7a38214b3504e2 (patch) | |
tree | de0eb3fe32ce58804457963fd133a53bb8fba5b8 /block/blktrace.c | |
parent | a31e23e15cbb9734c5883a4a7f58d8712d303e0b (diff) | |
parent | 92d499d991ec4f5cbd00d6f33967eab9d3ee8d6c (diff) |
Merge branch 'master' into upstream-fixes
Diffstat (limited to 'block/blktrace.c')
-rw-r--r-- | block/blktrace.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/block/blktrace.c b/block/blktrace.c index d00ac3993c1..498a0a54a6a 100644 --- a/block/blktrace.c +++ b/block/blktrace.c @@ -202,6 +202,7 @@ static void blk_remove_tree(struct dentry *dir) static struct dentry *blk_create_tree(const char *blk_name) { struct dentry *dir = NULL; + int created = 0; mutex_lock(&blk_tree_mutex); @@ -209,13 +210,17 @@ static struct dentry *blk_create_tree(const char *blk_name) blk_tree_root = debugfs_create_dir("block", NULL); if (!blk_tree_root) goto err; + created = 1; } dir = debugfs_create_dir(blk_name, blk_tree_root); if (dir) root_users++; - else - blk_remove_root(); + else { + /* Delete root only if we created it */ + if (created) + blk_remove_root(); + } err: mutex_unlock(&blk_tree_mutex); |