projects/linux·commit 87d7c8ac

[PATCH] block_dev.c mutex_lock_nested() fix

87d7c8ac · Jason Baron <[email protected]> · 2006-09-29 02:01:01 -07:00

In the case below we are locking the whole disk not a partition.  This
change simply brings the code in line with the piece above where when we
are the 'first' opener, and we are a partition.

Signed-off-by: Jason Baron <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
87d7c8aca8670a772f74766c19e0345a606b67a9
Parents
303912e2

Changes

1 files changed · +1 −1

FileStatusAddDelContent
fs/block_dev.cmodified+1−1View file

fs/block_dev.c

View file
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 8cc144f..4346468 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1031,7 +1031,7 @@ do_open(struct block_device *bdev, struct file *file, unsigned int subclass)
rescan_partitions(bdev->bd_disk, bdev);
} else {
mutex_lock_nested(&bdev->bd_contains->bd_mutex,
- BD_MUTEX_PARTITION);
+ BD_MUTEX_WHOLE);
bdev->bd_contains->bd_part_count++;
mutex_unlock(&bdev->bd_contains->bd_mutex);
}