Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: avoid repeated work in blk_mark_disk_dead

Check if GD_DEAD is already set in blk_mark_disk_dead, and don't
duplicate the work already done.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Christian Brauner <brauner@kernel.org>
Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Link: https://lore.kernel.org/r/20230601094459.1350643-6-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
a4f75764 66fddc25

+3 -1
+3 -1
block/genhd.c
··· 575 575 /* 576 576 * Fail any new I/O. 577 577 */ 578 - set_bit(GD_DEAD, &disk->state); 578 + if (test_and_set_bit(GD_DEAD, &disk->state)) 579 + return; 580 + 579 581 if (test_bit(GD_OWNS_QUEUE, &disk->state)) 580 582 blk_queue_flag_set(QUEUE_FLAG_DYING, disk->queue); 581 583