Skip to content

Commit

Permalink
dm space map metadata: skip useless memcpy in metadata_ll_init_index()
Browse files Browse the repository at this point in the history
When metadata_ll_init_index() is called by sm_ll_new_metadata(),
ll->mi_le hasn't been initialized yet. So, when
metadata_ll_init_index() copies the contents of ll->mi_le into the
newly allocated bitmap_root, it is just copying garbage. ll->mi_le
will be allocated later in sm_ll_extend() and copied into the
bitmap_root, in sm_ll_commit().

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Benjamin Marzinski authored and Mike Snitzer committed Dec 8, 2016
1 parent 314c25c commit 0c79ce0
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/md/persistent-data/dm-space-map-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,6 @@ static int metadata_ll_init_index(struct ll_disk *ll)
if (r < 0)
return r;

memcpy(dm_block_data(b), &ll->mi_le, sizeof(ll->mi_le));
ll->bitmap_root = dm_block_location(b);

dm_tm_unlock(ll->tm, b);
Expand Down

0 comments on commit 0c79ce0

Please sign in to comment.