aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/blk-cgroup.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index e4a4145926f6..1039fb9ff5f5 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -451,7 +451,20 @@ static int blkcg_reset_stats(struct cgroup_subsys_state *css,
451 struct blkcg_gq *blkg; 451 struct blkcg_gq *blkg;
452 int i; 452 int i;
453 453
454 mutex_lock(&blkcg_pol_mutex); 454 /*
455 * XXX: We invoke cgroup_add/rm_cftypes() under blkcg_pol_mutex
456 * which ends up putting cgroup's internal cgroup_tree_mutex under
457 * it; however, cgroup_tree_mutex is nested above cgroup file
458 * active protection and grabbing blkcg_pol_mutex from a cgroup
459 * file operation creates a possible circular dependency. cgroup
460 * internal locking is planned to go through further simplification
461 * and this issue should go away soon. For now, let's trylock
462 * blkcg_pol_mutex and restart the write on failure.
463 *
464 * http://lkml.kernel.org/g/5363C04B.4010400@oracle.com
465 */
466 if (!mutex_trylock(&blkcg_pol_mutex))
467 return restart_syscall();
455 spin_lock_irq(&blkcg->lock); 468 spin_lock_irq(&blkcg->lock);
456 469
457 /* 470 /*