dm space map common: zero entire ll_disk [Linux 5.2]

dm space map common: zero entire ll_disk [Linux 5.2]

This Linux kernel change "dm space map common: zero entire ll_disk" is included in the Linux 5.2 release. This change is authored by Mike Snitzer <snitzer [at] redhat.com> on Fri Mar 22 16:12:22 2019 -0400. The commit for this change in Linux stable tree is c6e086e (patch).

dm space map common: zero entire ll_disk

Otherwise, memory that is allocated (and potentially not previously
zeroed) will get written to disk as part of the space maps.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/md/persistent-data/dm-space-map-common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/md/persistent-data/dm-space-map-common.c b/drivers/md/persistent-data/dm-space-map-common.c
index 0a3b8ae..b8a6218 100644
--- a/drivers/md/persistent-data/dm-space-map-common.c
+++ b/drivers/md/persistent-data/dm-space-map-common.c
@@ -190,6 +190,8 @@ static int sm_find_free(void *addr, unsigned begin, unsigned end,

 static int sm_ll_init(struct ll_disk *ll, struct dm_transaction_manager *tm)
 {
+   memset(ll, 0, sizeof(struct ll_disk));
+
    ll->tm = tm;

    ll->bitmap_info.tm = tm;

Leave a Reply

Your email address will not be published. Required fields are marked *