소스 검색

[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 <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>
Jason Baron 18 년 전
부모
커밋
87d7c8aca8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      fs/block_dev.c

+ 1 - 1
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);
 				rescan_partitions(bdev->bd_disk, bdev);
 		} else {
 		} else {
 			mutex_lock_nested(&bdev->bd_contains->bd_mutex,
 			mutex_lock_nested(&bdev->bd_contains->bd_mutex,
-					  BD_MUTEX_PARTITION);
+					  BD_MUTEX_WHOLE);
 			bdev->bd_contains->bd_part_count++;
 			bdev->bd_contains->bd_part_count++;
 			mutex_unlock(&bdev->bd_contains->bd_mutex);
 			mutex_unlock(&bdev->bd_contains->bd_mutex);
 		}
 		}