]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dm thin: fix race condition when destroying thin pool workqueue
authorNikolay Borisov <kernel@kyup.com>
Thu, 17 Dec 2015 16:03:35 +0000 (18:03 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:43:42 +0000 (15:43 -0700)
commite5cb612db89c877d6c739f8c1b1c25c4f25cf735
tree151b71d316da4d2ce8a1f2982182b3eec1a8df9e
parentb060a1c54c6ab650396e54b699204c63f56c9729
dm thin: fix race condition when destroying thin pool workqueue

Orabug: 23330598

[ Upstream commit 18d03e8c25f173f4107a40d0b8c24defb6ed69f3 ]

When a thin pool is being destroyed delayed work items are
cancelled using cancel_delayed_work(), which doesn't guarantee that on
return the delayed item isn't running.  This can cause the work item to
requeue itself on an already destroyed workqueue.  Fix this by using
cancel_delayed_work_sync() which guarantees that on return the work item
is not running anymore.

Fixes: 905e51b39a555 ("dm thin: commit outstanding data every second")
Fixes: 85ad643b7e7e5 ("dm thin: add timeout to stop out-of-data-space mode holding IO forever")
Signed-off-by: Nikolay Borisov <kernel@kyup.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 9e612a000cf889cfa624d984ccef770fdce43cf6)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/md/dm-thin.c