Commit 495ec73d authored by Joe Thornber's avatar Joe Thornber Committed by Luis Henriques

dm cache: fix NULL pointer when switching from cleaner policy

commit 2bffa150 upstream.

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: default avatarJoe Thornber <ejt@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 206b196c
...@@ -434,7 +434,7 @@ static struct dm_cache_policy *wb_create(dm_cblock_t cache_size, ...@@ -434,7 +434,7 @@ static struct dm_cache_policy *wb_create(dm_cblock_t cache_size,
static struct dm_cache_policy_type wb_policy_type = { static struct dm_cache_policy_type wb_policy_type = {
.name = "cleaner", .name = "cleaner",
.version = {1, 0, 0}, .version = {1, 0, 0},
.hint_size = 0, .hint_size = 4,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.create = wb_create .create = wb_create
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment