File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -680,7 +680,11 @@ void del_gendisk(struct gendisk *disk)
680
680
* disk is marked as dead (GENHD_FL_UP cleared).
681
681
*/
682
682
down_write (& bdev_lookup_sem );
683
+
684
+ mutex_lock (& disk -> part0 -> bd_mutex );
683
685
blk_drop_partitions (disk );
686
+ mutex_unlock (& disk -> part0 -> bd_mutex );
687
+
684
688
fsync_bdev (disk -> part0 );
685
689
__invalidate_device (disk -> part0 , true);
686
690
Original file line number Diff line number Diff line change @@ -531,6 +531,8 @@ void blk_drop_partitions(struct gendisk *disk)
531
531
struct disk_part_iter piter ;
532
532
struct block_device * part ;
533
533
534
+ lockdep_assert_held (& disk -> part0 -> bd_mutex );
535
+
534
536
disk_part_iter_init (& piter , disk , DISK_PITER_INCL_EMPTY );
535
537
while ((part = disk_part_iter_next (& piter )))
536
538
delete_partition (part );
You can’t perform that action at this time.
0 commit comments