Message ID | 20230518042323.663189-6-hch@lst.de (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | [01/13] block: factor out a bd_end_claim helper from blkdev_put | expand |
diff --git a/block/genhd.c b/block/genhd.c index d8fe40c7d1f0a2..a744daeed55318 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -575,7 +575,9 @@ void blk_mark_disk_dead(struct gendisk *disk) /* * Fail any new I/O. */ - set_bit(GD_DEAD, &disk->state); + if (test_and_set_bit(GD_DEAD, &disk->state)) + return; + if (test_bit(GD_OWNS_QUEUE, &disk->state)) blk_queue_flag_set(QUEUE_FLAG_DYING, disk->queue);