On (24/10/07 18:45), Sergey Senozhatsky wrote: > + /* > + * Tell the file system to write back all dirty data and shut down if > + * it hasn't been notified earlier. > + */ > + if (!test_bit(GD_DEAD, &disk->state)) > + blk_report_disk_dead(disk, false); > + /* TODO: big fat comment */ > + blk_queue_flag_set(QUEUE_FLAG_DYING, disk->queue); > + __blk_mark_disk_dead(disk); > + > /* > * Prevent new openers by unlinked the bdev inode. > */ > @@ -657,18 +667,10 @@ void del_gendisk(struct gendisk *disk) > bdev_unhash(part); > mutex_unlock(&disk->open_mutex); > > - /* > - * Tell the file system to write back all dirty data and shut down if > - * it hasn't been notified earlier. > - */ > - if (!test_bit(GD_DEAD, &disk->state)) > - blk_report_disk_dead(disk, false); > - > /* > * Drop all partitions now that the disk is marked dead. > */ > mutex_lock(&disk->open_mutex); > - __blk_mark_disk_dead(disk); > xa_for_each_start(&disk->part_tbl, idx, part, 1) > drop_partition(part); > mutex_unlock(&disk->open_mutex); > @@ -714,6 +716,10 @@ void del_gendisk(struct gendisk *disk) > rq_qos_exit(q); > blk_mq_unquiesce_queue(q); > > + /* TODO: big fat comment */ > + if (test_bit(GD_OWNS_QUEUE, &disk->state)) if (!test_bit()), muppet. > + blk_queue_flag_clear(QUEUE_FLAG_DYING, disk->queue);