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

Commit 713ada9b authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Jens Axboe
Browse files

block: move q->unplug_work initialization



modprobe loop; rmmod loop effectively creates a blk_queue and destroys it
which results in q->unplug_work being canceled without it ever being
initialized.

Therefore, move the initialization of q->unplug_work from
blk_queue_make_request() to blk_alloc_queue*().

Reported-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 0997f1c5
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -515,6 +515,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
	init_timer(&q->unplug_timer);
	init_timer(&q->unplug_timer);
	setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q);
	setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q);
	INIT_LIST_HEAD(&q->timeout_list);
	INIT_LIST_HEAD(&q->timeout_list);
	INIT_WORK(&q->unplug_work, blk_unplug_work);


	kobject_init(&q->kobj, &blk_queue_ktype);
	kobject_init(&q->kobj, &blk_queue_ktype);


+0 −2
Original line number Original line Diff line number Diff line
@@ -141,8 +141,6 @@ void blk_queue_make_request(struct request_queue *q, make_request_fn *mfn)
	if (q->unplug_delay == 0)
	if (q->unplug_delay == 0)
		q->unplug_delay = 1;
		q->unplug_delay = 1;


	INIT_WORK(&q->unplug_work, blk_unplug_work);

	q->unplug_timer.function = blk_unplug_timeout;
	q->unplug_timer.function = blk_unplug_timeout;
	q->unplug_timer.data = (unsigned long)q;
	q->unplug_timer.data = (unsigned long)q;