On Sat, Feb 11 2023 at 1:19P -0500, Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> wrote: > Hello. > > Like commit c4f135d64382 ("workqueue: Wrap flush_workqueue() using a macro") > says, flush_scheduled_work() is dangerous and will be forbidden. But I haven't > heard from you after https://lkml.kernel.org/r/YtF45oMcHMKXjIyy@xxxxxxxxxx . > > https://lkml.kernel.org/r/49925af7-78a8-a3dd-bce6-cfc02e1a9236@xxxxxxxxxxxxxxxxxxx > https://lkml.kernel.org/r/e170edc2-e5b9-4c8b-4ed3-7e2d7a2850dc@xxxxxxxxxxxxxxxxxxx > > Please do clarify which work items does this flush_scheduled_work() need to wait. > > Regards. > WARN_ON() seems excessive, why not WARN_ON_ONCE()? But that aside, sorry for not looking closely and responding with findings sooner. BUT, I did just have a quick look at drivers/md/dm.c and its use of flush_schduled_work(): a quick 'git blame drivers/md/dm.c' told me it was only introduced for the benefit of DM's deferred device removal feature (commit 2c140a246dc0b "dm: allow remove to be deferred"). Given that, I've staged these 2 commits for 6.3 inclusion: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-6.3&id=68fb709113077f1f367d8a55deb01d2d6bf23b0f https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-6.3&id=cd4afc85b39c1b9dd63715c591829f67b07c86a8 Thanks, Mike -- dm-devel mailing list dm-devel@xxxxxxxxxx https://listman.redhat.com/mailman/listinfo/dm-devel