mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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: [email protected]
Reported-by: David Teigland <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
This commit is contained in:
parent
2595646791
commit
687cf4412a
1 changed files with 4 additions and 0 deletions
|
|
@ -930,6 +930,10 @@ static int blocks_are_clean_separate_dirty(struct dm_cache_metadata *cmd,
|
|||
bool dirty_flag;
|
||||
*result = true;
|
||||
|
||||
if (from_cblock(cmd->cache_blocks) == 0)
|
||||
/* Nothing to do */
|
||||
return 0;
|
||||
|
||||
r = dm_bitset_cursor_begin(&cmd->dirty_info, cmd->dirty_root,
|
||||
from_cblock(cmd->cache_blocks), &cmd->dirty_cursor);
|
||||
if (r) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue