[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1331582478-2259-1-git-send-email-levinsasha928@gmail.com>
Date: Mon, 12 Mar 2012 16:01:18 -0400
From: Sasha Levin <levinsasha928@...il.com>
To: axboe@...nel.dk
Cc: tj@...nel.org, linux-kernel@...r.kernel.org,
Sasha Levin <levinsasha928@...il.com>
Subject: [PATCH] blk-cgroup: Call cgroup_path only under cgroup lock
Since we can't keep rcu read lock during blkg_alloc(), we currently
call cgroup_path() without any locks at all.
This patch adds cgroup locking before calling cgroup_path.
This also fixes a lockdep warning on boot.
Signed-off-by: Sasha Levin <levinsasha928@...il.com>
---
block/blk-cgroup.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index cb6b176..b5f539c 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -508,7 +508,9 @@ static struct blkio_group *blkg_alloc(struct blkio_cgroup *blkcg,
INIT_LIST_HEAD(&blkg->q_node);
blkg->blkcg = blkcg;
blkg->refcnt = 1;
+ cgroup_lock();
cgroup_path(blkcg->css.cgroup, blkg->path, sizeof(blkg->path));
+ cgroup_unlock();
for (i = 0; i < BLKIO_NR_POLICIES; i++) {
struct blkio_policy_type *pol = blkio_policy[i];
--
1.7.8.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists