Skip to content

Commit 2e3c18d

Browse files
Tetsuo Handaaxboe
authored andcommitted
block: pass no-op callback to INIT_WORK().
syzbot is hitting flush_work() warning caused by commit 4d43d39 ("workqueue: Try to catch flush_work() without INIT_WORK().") [1]. Although that commit did not expect INIT_WORK(NULL) case, calling flush_work() without setting a valid callback should be avoided anyway. Fix this problem by setting a no-op callback instead of NULL. [1] https://syzkaller.appspot.com/bug?id=e390366bc48bc82a7c668326e0663be3b91cbd29 Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Reported-and-tested-by: syzbot <syzbot+ba2a929dcf8e704c180e@syzkaller.appspotmail.com> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 3ca17a2 commit 2e3c18d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

block/blk-core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,10 @@ static void blk_rq_timed_out_timer(struct timer_list *t)
462462
kblockd_schedule_work(&q->timeout_work);
463463
}
464464

465+
static void blk_timeout_work(struct work_struct *work)
466+
{
467+
}
468+
465469
/**
466470
* blk_alloc_queue_node - allocate a request queue
467471
* @gfp_mask: memory allocation flags
@@ -505,7 +509,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
505509
timer_setup(&q->backing_dev_info->laptop_mode_wb_timer,
506510
laptop_mode_timer_fn, 0);
507511
timer_setup(&q->timeout, blk_rq_timed_out_timer, 0);
508-
INIT_WORK(&q->timeout_work, NULL);
512+
INIT_WORK(&q->timeout_work, blk_timeout_work);
509513
INIT_LIST_HEAD(&q->icq_list);
510514
#ifdef CONFIG_BLK_CGROUP
511515
INIT_LIST_HEAD(&q->blkg_list);

0 commit comments

Comments
 (0)