--- evms-2.5.3.a/plugins/md/md_main.c 2005-02-14 18:38:53.000000000 -0600 +++ evms-2.5.3.b/plugins/md/md_main.c 2005-07-13 23:32:12.000000000 -0500 @@ -1135,9 +1135,9 @@ goto out; } if (org->saved_info) { - new_member->saved_info = EngFncs->engine_alloc(sizeof(*(org->saved_info))); + new_member->saved_info = EngFncs->engine_alloc(MD_SAVED_INFO_BYTES); if (new_member->saved_info) { - *(new_member->saved_info) = *(org->saved_info); + memcpy(new_member->saved_info, org->saved_info, MD_SAVED_INFO_BYTES); } else { rc = ENOMEM; goto out; @@ -1173,6 +1173,7 @@ new_vol = md_allocate_volume(); if (new_vol) { *new_vol = *org; + new_vol->private_data = 0; new_vol->nr_disks = 0; new_vol->members = EngFncs->allocate_list(); new_vol->setup_funcs = EngFncs->allocate_list(); --- evms-2.5.3.a/plugins/md/raid5_mgr.c 2005-05-27 13:46:14.000000000 -0500 +++ evms-2.5.3.b/plugins/md/raid5_mgr.c 2005-07-13 17:57:54.000000000 -0500 @@ -67,9 +67,16 @@ static void raid5_free_private_data(md_volume_t * volume) { - raid5_conf_t * conf = (raid5_conf_t *)volume->private_data; + raid5_conf_t * conf; LOG_ENTRY(); + if (!volume) { + LOG_WARNING("Volume is NULL!!!.\n"); + LOG_EXIT_VOID(); + return; + } + + conf = (raid5_conf_t *)volume->private_data; if (!conf) { LOG_WARNING("Nothing to free!!!.\n"); @@ -1990,7 +1997,6 @@ { int rc; md_volume_t * volume = (md_volume_t *) region->private_data; - raid5_conf_t * conf = mdvol_to_conf(volume); LOG_ENTRY(); @@ -2007,7 +2013,7 @@ /* Remove the parent/child associations with the PVs. */ md_clear_child_list(region, children); - EngFncs->engine_free(conf); + raid5_free_private_data(volume); /* Delete the volume. */ md_delete_volume(volume, tear_down); region->private_data = NULL; @@ -5640,9 +5646,10 @@ static void free_region (storage_object_t *region) { md_volume_t * volume = (md_volume_t *)region->private_data; - raid5_conf_t * conf = mdvol_to_conf(volume); - EngFncs->engine_free(conf); + LOG_ENTRY(); + + raid5_free_private_data(volume); md_free_volume(volume); LOG_EXIT_VOID();