[PATCH] block_dev.c mutex_lock_nested() fix
authorJason Baron <jbaron@redhat.com>
Fri, 29 Sep 2006 09:01:01 +0000 (02:01 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 29 Sep 2006 16:18:19 +0000 (09:18 -0700)
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 <jbaron@redhat.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/block_dev.c

index 8cc144ffc3828ecfad6f6b432611be5ddc44f2a8..4346468139e80247e6db85d389a072cedf0d52a0 100644 (file)
@@ -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);
                }