Skip to content

Commit

Permalink
dm space map disk: fix sm_disk_count_is_more_than_one()
Browse files Browse the repository at this point in the history
dm_tm_shadow_block() is the only caller of
dm_sm_count_is_more_than_one() which only ever operates on a metadata
space-map.  So in practice, sm_disk_count_is_more_than_one() isn't
actually used (which explains why this bug never amounted to anything).

But fix sm_disk_count_is_more_than_one() to properly set *result and
return 0.

Reported-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Mike Snitzer committed Feb 14, 2015
1 parent 802ea9d commit 145b900
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/md/persistent-data/dm-space-map-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ static int sm_disk_count_is_more_than_one(struct dm_space_map *sm, dm_block_t b,
if (r)
return r;

return count > 1;
*result = count > 1;

return 0;
}

static int sm_disk_set_count(struct dm_space_map *sm, dm_block_t b,
Expand Down

0 comments on commit 145b900

Please sign in to comment.