Skip to content

Commit 383f72c

Browse files
jthornbergregkh
authored andcommitted
dm cache: fix NULL pointer when switching from cleaner policy
commit 2bffa15 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: Joe Thornber <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 16d4c27 commit 383f72c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/dm-cache-policy-cleaner.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ static struct dm_cache_policy *wb_create(dm_cblock_t cache_size,
435435
static struct dm_cache_policy_type wb_policy_type = {
436436
.name = "cleaner",
437437
.version = {1, 0, 0},
438-
.hint_size = 0,
438+
.hint_size = 4,
439439
.owner = THIS_MODULE,
440440
.create = wb_create
441441
};

0 commit comments

Comments
 (0)