From: Jason Baron Date: Fri, 29 Sep 2006 09:01:01 +0000 (-0700) Subject: [PATCH] block_dev.c mutex_lock_nested() fix X-Git-Tag: v2.6.19-rc1~711 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=87d7c8aca8670a772f74766c19e0345a606b67a9;p=~emulex%2Finfiniband.git [PATCH] block_dev.c mutex_lock_nested() fix 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 Acked-by: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/block_dev.c b/fs/block_dev.c index 8cc144ffc38..4346468139e 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); }