Skip to content

Commit

Permalink
dm cache: fix NULL pointer when switching from cleaner policy
Browse files Browse the repository at this point in the history
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 <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Joe Thornber authored and Greg Kroah-Hartman committed Oct 22, 2015
1 parent f7c7bb9 commit d60cb61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/dm-cache-policy-cleaner.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
.name = "cleaner",
.version = {1, 0, 0},
.hint_size = 0,
.hint_size = 4,
.owner = THIS_MODULE,
.create = wb_create
};
Expand Down

0 comments on commit d60cb61

Please sign in to comment.