Commit 6e1f23ff authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Don't hold BKL across sync_blockdev() in blkdev_put()

Running sync_blockdev() inside lock_kernel causes long scheduling
stalls under some conditions because the lock_kernel() disables
preemption.

We don't need the BKL across sync_blockdev(), so move it down a bit.

This is a minimal fix - we probably don't need BKL for much at all in
there.
parent cfe7c13e
......@@ -703,13 +703,13 @@ int blkdev_put(struct block_device *bdev, int kind)
struct gendisk *disk = bdev->bd_disk;
down(&bdev->bd_sem);
lock_kernel();
switch (kind) {
case BDEV_FILE:
case BDEV_FS:
sync_blockdev(bd_inode->i_bdev);
break;
}
lock_kernel();
if (!--bdev->bd_openers)
kill_bdev(bdev);
if (bdev->bd_contains == bdev) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment