Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm space map metadata: skip useless memcpy in metadata_ll_init_index()

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>

authored by

Benjamin Marzinski and committed by
Mike Snitzer
0c79ce0b 314c25c5

-1
-1
drivers/md/persistent-data/dm-space-map-common.c
··· 547 547 if (r < 0) 548 548 return r; 549 549 550 - memcpy(dm_block_data(b), &ll->mi_le, sizeof(ll->mi_le)); 551 550 ll->bitmap_root = dm_block_location(b); 552 551 553 552 dm_tm_unlock(ll->tm, b);