dm cache metadata: fix metadata2 format's blocks_are_clean_separate_dirty
authorJoe Thornber <ejt@redhat.com>
Mon, 20 Mar 2017 15:54:11 +0000 (11:54 -0400)
committerMike Snitzer <snitzer@redhat.com>
Mon, 20 Mar 2017 20:00:49 +0000 (16:00 -0400)
commit0d963b6e650d9d5533223f3dbcde7dda466df65c
tree5ecc07ecd3618e8aa476af8ef5abb7099a40aa16
parentf1a880a93baaadb14c10a348fd199f1cdb6bcccd
dm cache metadata: fix metadata2 format's blocks_are_clean_separate_dirty

The dm_bitset_cursor_begin() call was using the incorrect nr_entries.
Also, the last dm_bitset_cursor_next() must be avoided if we're at the
end of the cursor.

Fixes: 7f1b21591a6 ("dm cache metadata: use cursor api in blocks_are_clean_separate_dirty()")
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-cache-metadata.c