Skip to contentSkip to conversation

blk-cgroup: fix wrong unlock order when parse per blkg config

PATCH RESEND New Joseph Qi 1 participant 1 message Apr 21, 2017

Subsystems (3)
lore
Share & tools
lore

Joseph Qi

author
#0 lore raw

PATCH RESEND 1/1 blk-cgroup: fix wrong unlock order when parse per blkg config

In case of error blkg in blkg_conf_prep, we should unlock queue->queue_lock first and then rcu, just like blkg_conf_finish.

---
 block/blk-cgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-cgroup.c +1 -1
index bbe7ee0..cc017b2 100644
@@ -823,8 +823,8 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
 
 	if (IS_ERR(blkg)) {
 		ret = PTR_ERR(blkg);
-		rcu_read_unlock();
 		spin_unlock_irq(disk->queue->queue_lock);
+		rcu_read_unlock();
 		owner = disk->fops->owner;
 		put_disk(disk);
 		module_put(owner);
Signature · 1 line
1.9.4