]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
dm: remove flush_scheduled_work() during local_exit()
authorMike Snitzer <snitzer@kernel.org>
Tue, 14 Feb 2023 18:06:05 +0000 (13:06 -0500)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:46:46 +0000 (16:46 +0100)
BugLink: https://bugs.launchpad.net/bugs/2011425
[ Upstream commit 0b22ff5360f5c4e11050b89206370fdf7dc0a226 ]

Commit acfe0ad74d2e1 ("dm: allocate a special workqueue for deferred
device removal") switched from using system workqueue to a single
workqueue local to DM.  But it didn't eliminate the call to
flush_scheduled_work() that was introduced purely for the benefit of
deferred device removal with commit 2c140a246dc ("dm: allow remove to
be deferred").

Since DM core uses its own workqueue (and queue_work) there is no need
to call flush_scheduled_work() from local_exit().  local_exit()'s
destroy_workqueue(deferred_remove_workqueue) handles flushing work
started with queue_work().

Fixes: acfe0ad74d2e1 ("dm: allocate a special workqueue for deferred device removal")
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/md/dm.c

index b424a6ee27baf22a7ccbf22019d34c74cbc3bf7b..eba9bc06856bf4d116c02b2cb3d05513a7ce5f2c 100644 (file)
@@ -231,7 +231,6 @@ out_uevent_exit:
 
 static void local_exit(void)
 {
-       flush_scheduled_work();
        destroy_workqueue(deferred_remove_workqueue);
 
        unregister_blkdev(_major, _name);