dm cache: fix NULL pointer when switching from cleaner policy
authorJoe Thornber <ejt@redhat.com>
Fri, 9 Oct 2015 13:03:38 +0000 (14:03 +0100)
committerSasha Levin <sasha.levin@oracle.com>
Wed, 28 Oct 2015 02:14:27 +0000 (22:14 -0400)
commitd2adffd701eefc29c06cd10494e4bdb2bc70fe3b
tree6ae1ac3726e44d621586c63997e8482080347d6f
parent5b0d0df8f71b1f8565ba0a66f9c7e431cc3b4cbc
dm cache: fix NULL pointer when switching from cleaner policy

[ Upstream commit 2bffa1503c5c06192eb1459180fac4416575a966 ]

The cleaner policy doesn't make use of the per cache block hint space in
the metadata (unlike the other policies).  When switching from the
cleaner policy to mq or smq a NULL pointer crash (in dm_tm_new_block)
was observed.  The crash was caused by bugs in dm-cache-metadata.c
when trying to skip creation of the hint btree.

The minimal fix is to change hint size for the cleaner policy to 4 bytes
(only hint size supported).

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/md/dm-cache-policy-cleaner.c