dm cache metadata: verify cache has blocks in blocks_are_clean_separate_dirty()
authorMike Snitzer <snitzer@redhat.com>
Fri, 9 Nov 2018 16:56:03 +0000 (11:56 -0500)
committerMike Snitzer <snitzer@redhat.com>
Fri, 7 Dec 2018 21:04:09 +0000 (16:04 -0500)
commit687cf4412a343a63928a5c9d91bdc0f522939d43
treea72edb30ab6964bfdb543c26391efffc4004d214
parent2595646791c319cadfdbf271563aac97d0843dc7
dm cache metadata: verify cache has blocks in blocks_are_clean_separate_dirty()

Otherwise dm_bitset_cursor_begin() return -ENODATA.  Other calls to
dm_bitset_cursor_begin() have similar negative checks.

Fixes inability to create a cache in passthrough mode (even though doing
so makes no sense).

Fixes: 0d963b6e65 ("dm cache metadata: fix metadata2 format's blocks_are_clean_separate_dirty")
Cc: stable@vger.kernel.org
Reported-by: David Teigland <teigland@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-cache-metadata.c