Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90be7f15 authored by Bart Van Assche's avatar Bart Van Assche Committed by Greg Kroah-Hartman
Browse files

dm: mark request_queue dead before destroying the DM device



commit 3b785fbcf81c3533772c52b717f77293099498d3 upstream.

This avoids that new requests are queued while __dm_destroy() is in
progress.

Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b1d528d0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2869,6 +2869,7 @@ EXPORT_SYMBOL_GPL(dm_device_name);

static void __dm_destroy(struct mapped_device *md, bool wait)
{
	struct request_queue *q = dm_get_md_queue(md);
	struct dm_table *map;
	int srcu_idx;

@@ -2879,6 +2880,10 @@ static void __dm_destroy(struct mapped_device *md, bool wait)
	set_bit(DMF_FREEING, &md->flags);
	spin_unlock(&_minor_lock);

	spin_lock_irq(q->queue_lock);
	queue_flag_set(QUEUE_FLAG_DYING, q);
	spin_unlock_irq(q->queue_lock);

	if (dm_request_based(md) && md->kworker_task)
		flush_kthread_worker(&md->kworker);