]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm cache policy smq: ensure IO doesn't prevent cleaner policy progress
authorJoe Thornber <ejt@redhat.com>
Tue, 25 Jul 2023 15:44:41 +0000 (11:44 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:22:46 +0000 (10:22 +0200)
commit098d0b9ba03c96ffbba1f236038bbea4933372f6
tree67f8e3c91357eade6f8a04de6ad3ea5b683b2172
parent7c9b8cca49176232f155ddbd78bb8066defec551
dm cache policy smq: ensure IO doesn't prevent cleaner policy progress

commit 1e4ab7b4c881cf26c1c72b3f56519e03475486fb upstream.

When using the cleaner policy to decommission the cache, there is
never any writeback started from the cache as it is constantly delayed
due to normal I/O keeping the device busy. Meaning @idle=false was
always being passed to clean_target_met()

Fix this by adding a specific 'cleaner' flag that is set when the
cleaner policy is configured. This flag serves to always allow the
cleaner's writeback work to be queued until the cache is
decommissioned (even if the cache isn't idle).

Reported-by: David Jeffery <djeffery@redhat.com>
Fixes: b29d4986d0da ("dm cache: significant rework to leverage dm-bio-prison-v2")
Cc: stable@vger.kernel.org
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-cache-policy-smq.c