On 10/22/21 2:09 PM, Nathan Chancellor wrote: > On Wed, Oct 20, 2021 at 04:41:19PM +0200, Christoph Hellwig wrote: >> Consolidate the various helpers into a single blk_flush_plug helper that >> takes a plk_plug and the from_scheduler bool and switch all callsites to >> call it directly. Checks that the plug is non-NULL must be performed by >> the caller, something that most already do anyway. >> >> Signed-off-by: Christoph Hellwig <hch@xxxxxx> > > This patch as commit 008f75a20e70 ("block: cleanup the flush plug > helpers") in -next causes the following errors with CONFIG_BLOCK=n > (tinyconfig): > > kernel/sched/core.c: In function ‘sched_submit_work’: > kernel/sched/core.c:6346:35: error: ‘struct task_struct’ has no member named ‘plug’ > 6346 | blk_flush_plug(tsk->plug, true); > | ^~ > kernel/sched/core.c: In function ‘io_schedule_prepare’: > kernel/sched/core.c:8357:20: error: ‘struct task_struct’ has no member named ‘plug’ > 8357 | if (current->plug) > | ^~ > kernel/sched/core.c:8358:39: error: ‘struct task_struct’ has no member named ‘plug’ > 8358 | blk_flush_plug(current->plug, true); > | ^~ > > I tested the latest block tree and did not see it fixed nor did I see it > reported or fixed elsewhere. This should fix it, thanks for reporting. commit 599593a82fc57f5e9453c8ef7420df3206934a0c Author: Jens Axboe <axboe@xxxxxxxxx> Date: Fri Oct 22 19:35:45 2021 -0600 sched: make task_struct->plug always defined If CONFIG_BLOCK isn't set, then it's an empty struct anyway. Just make it generally available, so we don't break the compile: kernel/sched/core.c: In function ‘sched_submit_work’: kernel/sched/core.c:6346:35: error: ‘struct task_struct’ has no member named ‘plug’ 6346 | blk_flush_plug(tsk->plug, true); | ^~ kernel/sched/core.c: In function ‘io_schedule_prepare’: kernel/sched/core.c:8357:20: error: ‘struct task_struct’ has no member named ‘plug’ 8357 | if (current->plug) | ^~ kernel/sched/core.c:8358:39: error: ‘struct task_struct’ has no member named ‘plug’ 8358 | blk_flush_plug(current->plug, true); | ^~ Reported-by: Nathan Chancellor <nathan@xxxxxxxxxx> Fixes: 008f75a20e70 ("block: cleanup the flush plug helpers") Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> diff --git a/include/linux/sched.h b/include/linux/sched.h index c1a927ddec64..e0454e60fe8f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1160,10 +1160,8 @@ struct task_struct { /* Stacked block device info: */ struct bio_list *bio_list; -#ifdef CONFIG_BLOCK /* Stack plugging: */ struct blk_plug *plug; -#endif /* VM state: */ struct reclaim_state *reclaim_state; -- Jens Axboe