Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87d7c8ac authored by Jason Baron's avatar Jason Baron Committed by Linus Torvalds
Browse files

[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: default avatarJason Baron <jbaron@redhat.com>
Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 303912e2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
		}