Skip to contentSkip to conversation

loop: fix double BKL lock

PATCH New Arnd Bergmann 1 participant 1 message Sep 11, 2010 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 loop: fix double BKL lock

Patch 6e9624b8c "block: push down BKL into .open and .release" accidentally introduced an extra lock_kernel() instead of unlock_kernel(). Because of the recursiveness and release-while-sleeping properties of the BKL, this did not do much harm, but is incorrect nonetheless.

---

Please apply before 2.6.36

 drivers/block/loop.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/loop.c +1 -1
index 91797bb..d311e38 100644
@@ -1448,7 +1448,7 @@ static int lo_release(struct gendisk *disk, fmode_t mode)
 out:
 	mutex_unlock(&lo->lo_ctl_mutex);
 out_unlocked:
-	lock_kernel();
+	unlock_kernel();
 	return 0;
 }
 
Signature · 1 line
1.7.1