]> git.ipfire.org Git - people/ms/linux.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Oct 2015 21:39:22 +0000 (14:39 -0700)
commit3df65ac14e0764f6dec07cba371f51cff7bd765b
tree6960a1cb5702812c102ea33a7bac49a2d6b290ae
parenta9dfb91592b3a2af6a26e9f32d453e179e9e21e0
dm cache: fix NULL pointer when switching from cleaner policy

commit 2bffa1503c5c06192eb1459180fac4416575a966 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>
drivers/md/dm-cache-policy-cleaner.c