block: move removing elevator after deleting disk->queue_kobj
When blk_unregister_queue() is called from add_disk() failure path, there is race in registering/unregistering elevator queue kobject from the two code paths, because commit 559dc111 ("block: move elv_register[unregister]_queue out of elevator_lock") moves elevator queue register/unregister out of elevator lock. Fix the race by removing elevator after deleting disk->queue_kobj, because kobject_del(&disk->queue_kobj) drains in-progress sysfs show()/store() of all attributes. Fixes: 559dc111 ("block: move elv_register[unregister]_queue out of elevator_lock") Reported-by:Nilay Shroff <nilay@linux.ibm.com> Suggested-by:
Nilay Shroff <nilay@linux.ibm.com> Signed-off-by:
Ming Lei <ming.lei@redhat.com> Reviewed-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Nilay Shroff <nilay@linux.ibm.com> Link: https://lore.kernel.org/r/20250508085807.3175112-3-ming.lei@redhat.com Signed-off-by:
Jens Axboe <axboe@kernel.dk>
Loading
Please register or sign in to comment