Skip to contentSkip to conversation

blkcg: change a spin_lock() to spin_lock_irq()

PATCH In review Dan Carpenter 2 participants 2 messages Mar 29, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 blkcg: change a spin_lock() to spin_lock_irq()

Smatch complains that we re-enable IRQs twice. It looks like we forgot to disable them here on the spin_trylock() failure path. This was added in 9f13ef678e "blkcg: use double locking instead of RCU for blkg synchronization".

block/blk-cgroup.c +1 -1
index 74a76a8..bf4b76e 100644
@@ -1598,7 +1598,7 @@ static int blkiocg_pre_destroy(struct cgroup *cgroup)
 		} else {
 			spin_unlock_irq(&blkcg->lock);
 			cpu_relax();
-			spin_lock(&blkcg->lock);
+			spin_lock_irq(&blkcg->lock);
 		}
 	}
 
maintainer
#1 lore raw
Quoted 4 lines · Dan Carpenter

Smatch complains that we re-enable IRQs twice. It looks like we forgot to disable them here on the spin_trylock() failure path. This was added in 9f13ef678e "blkcg: use double locking instead of RCU for blkg synchronization".

Thanks, that is indeed a screwup. Fix applied.

Signature · 1 line
Jens Axboe