Hello community, here is the log from the commit of package evms checked in at Sat Jun 3 00:54:52 CEST 2006. -------- --- evms/evms.changes 2006-05-09 18:04:36.000000000 +0200 +++ evms/evms.changes 2006-06-02 19:00:06.000000000 +0200 @@ -1,0 +2,35 @@ +Thu Jun 2 10:46:09 MDT 2006 - cgao@novell.com + +- add init script 'evms' to fix bug #179219 + +------------------------------------------------------------------- +Thu Jun 1 14:35:20 CEST 2006 - fehr@suse.de + +- add Kevin Corrys version of prevent_unaligned_warning.patch (#179923) +- add two patch by Kevin Corry to fix #179907 +- add patch to allow EVMS over MD during install (#167943) + +------------------------------------------------------------------- +Mon May 29 16:05:01 CEST 2006 - fehr@suse.de + +- fix bug #178454 that slipped in with fix for #172039 + +------------------------------------------------------------------- +Wed May 24 18:34:57 CEST 2006 - fehr@suse.de + +- add call-browser to searchlist for webbrowsers (#178150) +- make the error popup dialogs modal (#178150) + +------------------------------------------------------------------- +Tue May 23 10:20:59 CEST 2006 - fehr@suse.de + +- add ntfs_unmkfs.patch to fix #176945 + +------------------------------------------------------------------- +Mon May 22 14:21:36 CEST 2006 - fehr@suse.de + +- add evms_fat.patch to fix (#176950) +- replace evms_raid5.patch by md_raid5_degrade_fix.patch (#176941) +- fix another bunch of unaligned access warnings on IA64 (#172039) + +------------------------------------------------------------------- @@ -24 +59 @@ -- add evms_raid5.patch.patch to fix bug #167203 +- add evms_raid5.patch to fix bug #167203 Old: ---- evms_raid5.patch New: ---- allow_container_on_active_md.patch call-browser.patch evms evms_fat.patch md_over_limit_error.patch md_raid5_degrade_fix.patch md_super_fix2.patch ntfs_unmkfs.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ evms.spec ++++++ --- /var/tmp/diff_new_pack.LMCqks/_old 2006-06-03 00:54:23.000000000 +0200 +++ /var/tmp/diff_new_pack.LMCqks/_new 2006-06-03 00:54:23.000000000 +0200 @@ -20,13 +20,14 @@ %endif Autoreqprov: on Version: 2.5.5 -Release: 24 +Release: 27 Summary: EVMS--Enterprise Volume Management System BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: http://prdownloads.sourceforge.net/evms/evms-%{version}.tar.bz2 Source1: boot.evms Source2: evms-lvm-comp.pdf Source3: iscsi-plugin.tar.bz2 +Source4: evms #Patch: evms-s390.patch Patch: rename-timestamp.dif Patch1: evms-s390-IOR.patch @@ -38,11 +39,17 @@ Patch7: ocfs2.patch Patch8: configure-iscsi.diff Patch9: aclocal-iscsi.diff -Patch10: evms_raid5.patch +Patch10: md_raid5_degrade_fix.patch Patch11: compaq_naming_gpt.patch Patch12: prevent_unaligned_warning.patch Patch13: md_super_fix.patch Patch14: drivelink_declined_objects.patch +Patch15: evms_fat.patch +Patch16: ntfs_unmkfs.patch +Patch17: call-browser.patch +Patch18: md_super_fix2.patch +Patch19: md_over_limit_error.patch +Patch20: allow_container_on_active_md.patch %description This package contains the userspace tools needed to manage EVMS @@ -110,6 +117,12 @@ %patch12 %patch13 -p1 %patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 +%patch18 -p1 +%patch19 -p1 +%patch20 %build autoconf @@ -125,6 +138,7 @@ ldconfig -r $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/etc/init.d install -m 744 %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d +install -m 744 %{SOURCE4} $RPM_BUILD_ROOT/etc/init.d mkdir -p $RPM_BUILD_ROOT%{_defaultdocdir}/evms install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_defaultdocdir}/evms install -m 644 PLUGIN.IDS README TERMINOLOGY INSTALL* $RPM_BUILD_ROOT%{_defaultdocdir}/evms @@ -144,11 +158,13 @@ %clean rm -rf $RPM_BUILD_ROOT +%{fillup_and_insserv -n evms} %post rm -f /etc/sysconf/evms %postun +%restart_on_update evms %{insserv_cleanup} %files @@ -156,6 +172,7 @@ /usr/share/doc/packages/evms %config /etc/evms.conf %config /etc/init.d/boot.evms +%config /etc/init.d/evms /%_lib/lib*.so* /%_libdir/lib*.so /%_libdir/lib*.a @@ -185,6 +202,23 @@ /etc/ha.d/resource.d/evms_failover %changelog -n evms +* Fri Jun 02 2006 - cgao@novell.com +- add init script 'evms' to fix bug #179219 +* Thu Jun 01 2006 - fehr@suse.de +- add Kevin Corrys version of prevent_unaligned_warning.patch (#179923) +- add two patch by Kevin Corry to fix #179907 +- add patch to allow EVMS over MD during install (#167943) +* Mon May 29 2006 - fehr@suse.de +- fix bug #178454 that slipped in with fix for #172039 +* Wed May 24 2006 - fehr@suse.de +- add call-browser to searchlist for webbrowsers (#178150) +- make the error popup dialogs modal (#178150) +* Tue May 23 2006 - fehr@suse.de +- add ntfs_unmkfs.patch to fix #176945 +* Mon May 22 2006 - fehr@suse.de +- add evms_fat.patch to fix (#176950) +- replace evms_raid5.patch by md_raid5_degrade_fix.patch (#176941) +- fix another bunch of unaligned access warnings on IA64 (#172039) * Tue May 09 2006 - fehr@suse.de - add drivelink_declined_objects.patch to fix (#172887) * Wed May 03 2006 - fehr@suse.de @@ -194,7 +228,7 @@ * Thu Apr 20 2006 - fehr@suse.de - prevent warning about misalignment on ia64 (#167207) * Wed Apr 19 2006 - fehr@suse.de -- add evms_raid5.patch.patch to fix bug #167203 +- add evms_raid5.patch to fix bug #167203 - add compaq_naming_gpt.patch to make naming on gpt disk label consistent with dos disk label (#167397) * Fri Apr 07 2006 - ghorlacher@suse.de ++++++ allow_container_on_active_md.patch ++++++ --- engine/commit.c +++ engine/commit.c 2006/06/01 12:17:51 @@ -1930,13 +1930,22 @@ } } else { LIST_FOR_EACH(obj->child_objects, iter, child) { + int suppress_error; tmp_rc = activate_object(child); + suppress_error = strncmp( obj->name, "md/md", 5 )==0 && tmp_rc==22; if (tmp_rc != 0) { LOG_WARNING("Error code %d activating object %s: %s\n", tmp_rc, child->name, evms_strerror(tmp_rc)); - set_commit_error(WARNING, tmp_rc); + if( !suppress_error ) + set_commit_error(WARNING, tmp_rc); } if (rc == 0) { - rc = tmp_rc; + if( !suppress_error ) + rc = tmp_rc; + else { + LOG_WARNING( "suppressing error activating child %s of %s\n", + child->name, obj->name ); + child->flags &= ~SOFLAG_NEEDS_ACTIVATE; + } } } } ++++++ call-browser.patch ++++++ --- ui/gtk/support.c +++ ui/gtk/support.c 2006/05/24 16:33:44 @@ -162,6 +162,7 @@ GtkAccelGroup *accel_group; popup = gtk_window_new(GTK_WINDOW_DIALOG); + gtk_window_set_modal(GTK_WINDOW(popup), TRUE); vbox = gtk_vbox_new(FALSE, 10); label = gtk_label_new(message); button = gtk_button_new(); --- ui/gtk/weblinks.c +++ ui/gtk/weblinks.c 2006/05/24 10:26:25 @@ -75,7 +75,9 @@ { gchar *path; - if (access("/usr/bin/mozilla", X_OK) == 0) + if (access("/usr/bin/call-browser", X_OK) == 0) + path = "/usr/bin/call-browser"; + else if (access("/usr/bin/mozilla", X_OK) == 0) path = "/usr/bin/mozilla"; else if (access("/usr/bin/netscape", X_OK) == 0) path = "/usr/bin/netscape"; ++++++ evms_fat.patch ++++++ Fsck isn't implemented yet for the FAT plugin, so tell the UIs that it isn't available. --- evms-2.5.5a/plugins/fat/fatfsim.c 20 Feb 2006 16:24:09 -0000 +++ evms-2.5.5b/plugins/fat/fatfsim.c 8 May 2006 18:31:41 -0000 @@ -255,8 +255,8 @@ return ENOSYS; } - LOG_EXIT_INT(0); - return 0; + LOG_EXIT_INT(ENOSYS); + return ENOSYS; } ++++++ md_over_limit_error.patch ++++++ When the too many devices are specified for MD region create, we want to fail the request and display appropriate error message. --- evms-2.5.5a/plugins/md/linear_mgr.c 2005-11-28 08:29:46.000000000 -0600 +++ evms-2.5.5b/plugins/md/linear_mgr.c 2006-05-26 14:35:55.000000000 -0500 @@ -730,17 +730,30 @@ md_member_t *member; u_int64_t size=-1; md_sb_ver_t sb_ver = {MD_SB_VER_0, 90, 0}; + int count; my_plugin = linear_plugin; LOG_ENTRY(); + count = EngFncs->list_count(objects); + // Must have at least 1 disk - if (EngFncs->list_count(objects) < 1) { + if (count < 1) { LOG_CRITICAL("Must have at least 1 object.\n"); LOG_EXIT_INT(EINVAL); return EINVAL; } + linear_get_create_options(options, &sb_ver); + + if (count > MAX_SB_DISKS(&sb_ver)) { + MESSAGE(_("Too many devices (%d) were specified." + " For MD superblock version %d.%d, the maximum is %d.\n"), + count, sb_ver.major_version, sb_ver.minor_version, + MAX_SB_DISKS(&sb_ver)); + return EINVAL; + } + if (!(volume = md_allocate_volume())) { LOG_EXIT_INT(ENOMEM); return ENOMEM; @@ -751,8 +764,6 @@ goto error_free; } - linear_get_create_options(options, &sb_ver); - LIST_FOR_EACH_SAFE(objects, iter1, iter2, object) { size = min(size, md_object_usable_size(object, &sb_ver, 0)); } diff -Nuar evms-2.5.5a/plugins/md/md_super.h evms-2.5.5b/plugins/md/md_super.h --- evms-2.5.5a/plugins/md/md_super.h 2005-12-02 12:46:57.000000000 -0600 +++ evms-2.5.5b/plugins/md/md_super.h 2006-05-26 12:55:39.000000000 -0500 @@ -370,6 +370,7 @@ }; #define MAX_DISKS(vol) (((md_volume_t *)vol)->sb_func->max_disks()) +#define MAX_SB_DISKS(ver) ((((md_sb_ver_t *)ver)->major_version == 0) ? MD_SB_DISKS : MD_SB_1_DISKS) int md_read_sb0(storage_object_t *obj, void **super); int md_read_sb1(storage_object_t *obj, void **super, md_sb_ver_t *sb_ver); diff -Nuar evms-2.5.5a/plugins/md/multipath.c evms-2.5.5b/plugins/md/multipath.c --- evms-2.5.5a/plugins/md/multipath.c 2005-11-28 08:29:46.000000000 -0600 +++ evms-2.5.5b/plugins/md/multipath.c 2006-05-26 14:38:05.000000000 -0500 @@ -1109,12 +1109,22 @@ list_element_t iter2; md_sb_ver_t sb_ver = {MD_SB_VER_0, 90, 0}; u_int64_t size = -1; - int raid_disk; + int count, raid_disk; my_plugin = mp_plugin; LOG_ENTRY(); + count = EngFncs->list_count(objects); + + if (count > MAX_SB_DISKS(&sb_ver)) { + MESSAGE(_("Too many devices (%d) were specified." + " For MD superblock version %d.%d, the maximum is %d.\n"), + count, sb_ver.major_version, sb_ver.minor_version, + MAX_SB_DISKS(&sb_ver)); + return EINVAL; + } + if (!(vol = md_allocate_volume())) { LOG_CRITICAL("Memory error new volume structure.\n"); LOG_EXIT_INT(ENOMEM); diff -Nuar evms-2.5.5a/plugins/md/raid0_mgr.c evms-2.5.5b/plugins/md/raid0_mgr.c --- evms-2.5.5a/plugins/md/raid0_mgr.c 2006-02-22 10:05:14.000000000 -0600 +++ evms-2.5.5b/plugins/md/raid0_mgr.c 2006-05-26 14:38:54.000000000 -0500 @@ -937,6 +937,7 @@ md_sb_ver_t sb_ver = {MD_SB_VER_0, 90, 0}; md_member_t *member; u_int32_t chunksize = MD_DEFAULT_CHUNK_SIZE; + int count; int rc = 0; my_plugin = raid1_plugin; @@ -948,13 +949,25 @@ return EFAULT; } + count = EngFncs->list_count(objects); + // Must have at least 1 disk - if (EngFncs->list_count(objects) < 1) { + if (count < 1) { LOG_CRITICAL("Must have at least 1 object.\n"); rc = EINVAL; goto out; } + raid0_get_create_options(options, &chunksize, &sb_ver); + + if (count > MAX_SB_DISKS(&sb_ver)) { + MESSAGE(_("Too many devices (%d) were specified." + " For MD superblock version %d.%d, the maximum is %d.\n"), + count, sb_ver.major_version, sb_ver.minor_version, + MAX_SB_DISKS(&sb_ver)); + return EINVAL; + } + if (!(volume = md_allocate_volume())) { rc = ENOMEM; goto out; @@ -965,8 +978,6 @@ goto error_free; } - raid0_get_create_options(options, &chunksize, &sb_ver); - LIST_FOR_EACH(objects, iter1, object) { size = min(size, md_object_usable_size(object, &sb_ver, chunksize)); } diff -Nuar evms-2.5.5a/plugins/md/raid1_mgr.c evms-2.5.5b/plugins/md/raid1_mgr.c --- evms-2.5.5a/plugins/md/raid1_mgr.c 2006-02-22 19:17:15.000000000 -0600 +++ evms-2.5.5b/plugins/md/raid1_mgr.c 2006-05-26 13:21:37.000000000 -0500 @@ -1130,6 +1130,7 @@ boolean degrade = FALSE; int missing_index = 0; boolean missing_added = FALSE; + int count; int rc = 0; my_plugin = raid1_plugin; @@ -1142,12 +1143,25 @@ } // Must have at least 1 disk - if (EngFncs->list_count(objects) < 1) { + count = EngFncs->list_count(objects); + if (count < 1) { LOG_CRITICAL("Must have at least 1 object.\n"); LOG_EXIT_INT(EINVAL); return EINVAL; } + raid1_get_create_options(options, &spare_disk, &sb_ver, °rade, &missing_index); + if (degrade) + count++; + + if (count > MAX_SB_DISKS(&sb_ver)) { + MESSAGE(_("Too many devices (%d) were specified." + " For MD superblock version %d.%d, the maximum is %d.\n"), + count, sb_ver.major_version, sb_ver.minor_version, + MAX_SB_DISKS(&sb_ver)); + return EINVAL; + } + if (!(volume = md_allocate_volume())) { LOG_EXIT_INT(ENOMEM); return ENOMEM; @@ -1158,8 +1172,6 @@ goto error_free; } - raid1_get_create_options(options, &spare_disk, &sb_ver, °rade, &missing_index); - LIST_FOR_EACH(objects, iter1, object) { size = min(size, md_object_usable_size(object, &sb_ver, 0)); } diff -Nuar evms-2.5.5a/plugins/md/raid5_mgr.c evms-2.5.5b/plugins/md/raid5_mgr.c --- evms-2.5.5a/plugins/md/raid5_mgr.c 2006-05-24 17:15:23.000000000 -0500 +++ evms-2.5.5b/plugins/md/raid5_mgr.c 2006-05-26 14:31:33.000000000 -0500 @@ -1906,7 +1906,7 @@ boolean degrade = FALSE; int missing_index = 0; boolean missing_added = FALSE; - int min_disks; + int count, min_disks; int rc = 0; my_plugin = raid5_plugin; @@ -1923,13 +1923,25 @@ // Must have at least RAID5_MIN_RAID_DISKS for a functional array // and RAID5_MIN_RAID_DISKS - 1 for a degraded array min_disks = degrade ? RAID5_MIN_RAID_DISKS - 1 : RAID5_MIN_RAID_DISKS; - if (EngFncs->list_count(objects) < min_disks) { + count = EngFncs->list_count(objects); + if (count < min_disks) { MESSAGE(_("A %s MD region requires a minimum of %d objects.\n"), degrade ? "degraded" : "functional", min_disks); LOG_EXIT_INT(EINVAL); return EINVAL; } + if (degrade) + count++; + + if (count > MAX_SB_DISKS(&sb_ver)) { + MESSAGE(_("Too many devices (%d) were specified." + " For MD superblock version %d.%d, the maximum is %d.\n"), + count, sb_ver.major_version, sb_ver.minor_version, + MAX_SB_DISKS(&sb_ver)); + return EINVAL; + } + if (!(volume = md_allocate_volume())) { LOG_EXIT_INT(ENOMEM); return ENOMEM; ++++++ md_raid5_degrade_fix.patch ++++++ Fix memory corruption when raid5 array is degrade and recovery is running, whence the disk index could be out of the nr_disks range. --- evms-2.5.5a/plugins/md/raid5_mgr.c 2006-02-22 10:05:17.000000000 -0600 +++ evms-2.5.5b/plugins/md/raid5_mgr.c 2006-05-05 12:48:46.492961984 -0500 @@ -102,6 +102,7 @@ md_super_info_t info; mdu_disk_info_t d; int i, count, length = 0; + int conf_disks; int rc = 0; LOG_ENTRY(); @@ -117,9 +118,27 @@ conf->failed_disk_index = -1; LOG_DEBUG("%s: info.raid_disks: %d, info.nr_disks: %d.\n", vol->name, info.raid_disks, info.nr_disks); - conf->stripe.nr_disks = (info.raid_disks > info.nr_disks) ? info.raid_disks : info.nr_disks; - conf->disks = EngFncs->engine_alloc(sizeof(disk_info_t) * conf->stripe.nr_disks); - conf->stripe.chunks = EngFncs->engine_alloc(sizeof(chunk_t) * conf->stripe.nr_disks); + conf_disks = (info.raid_disks > info.nr_disks) ? info.raid_disks : info.nr_disks; + + /* + * If a spare is added to fix a degrade array and recovery is running, + * its index could be greater than nr_disks. + * We should take this into account when allocating memory for disks. + * + * Check disk index of each member and adjust conf_disks if necessary. + */ + LIST_FOR_EACH(vol->members, iter, member) { + if (member->dev_number >= conf_disks) { + LOG_WARNING("%s: Changing number of disk entries:" + " current value %d, new value %d.\n", + vol->name, conf_disks, member->dev_number+1); + conf_disks = member->dev_number + 1; + } + } + + conf->disks = EngFncs->engine_alloc(sizeof(disk_info_t) * conf_disks); + conf->stripe.nr_disks = conf_disks; + conf->stripe.chunks = EngFncs->engine_alloc(sizeof(chunk_t) * conf_disks); /* Set the volume to which the stripe belongs. */ conf->stripe.volume = vol; ++++++ md_super_fix.patch ++++++ --- /var/tmp/diff_new_pack.LMCqks/_old 2006-06-03 00:54:24.000000000 +0200 +++ /var/tmp/diff_new_pack.LMCqks/_new 2006-06-03 00:54:24.000000000 +0200 @@ -1,3 +1,7 @@ +- When "zero-ing" MD superblocks, use #define values. +- When creating new sb1 array with a missing disk, the kernel requires + resynce_offset set to -1. + --- evms-2.5.5/plugins/md/md_super.c 2006-02-22 14:34:53.000000000 -0600 +++ evms-2.5.5.fix/plugins/md/md_super.c 2006-04-20 11:00:40.733364216 -0500 @@ -1312,13 +1312,13 @@ ++++++ md_super_fix2.patch ++++++ In the case of evms cli, maximum number of devices is omitted. As a consequence, memory corruption may occur. Therefore, an error should be set when attempting to add a new disk to a full array. For MD version 0.90 the limit is 27. For 1KB version 1 superblock, the limit is 384. --- evms-2.5.5a/plugins/md/md_super.c 2006-05-24 17:15:08.000000000 -0500 +++ evms-2.5.5b/plugins/md/md_super.c 2006-05-24 15:50:03.000000000 -0500 @@ -608,6 +608,13 @@ goto out; } + if (master_sb->nr_disks >= MD_SB_DISKS) { + LOG_ERROR("md%d is full (nr_disks=%d).n", + master_sb->md_minor, master_sb->nr_disks); + rc = EINVAL; + goto out; + } + master_sb->nr_disks++; master_sb->working_disks++; @@ -1736,6 +1743,14 @@ rc = EINVAL; goto out; } + + if (sb->max_dev >= MD_SB_1_DISKS) { + LOG_ERROR("%s is full (max_dev=%d).\n", + sb->set_name, sb->max_dev); + rc = EINVAL; + goto out; + } + sb->dev_number = member->dev_number; if (member->data_size == -1) { ++++++ ntfs_unmkfs.patch ++++++ This patch fixes a bug in the NTFS unmkfs. The offsets for the superblocks were calculated incorrectly by using the filesystem size rather than using the volume size. The result is that sometimes the superblocks didn't get wiped out, leaving the NTFS file system still on the volume. --- evms-2.5.5/plugins/ntfs/utils.c 2006-02-24 10:36:54.000000000 -0600 +++ evms-2.5.5-fix/plugins/ntfs/utils.c 2006-05-04 16:47:26.243120000 -0500 @@ -313,7 +313,6 @@ int clear_ntfs_boot_sectors(logical_volume_t * ev) { int rc = 0; - private_data_t * pd = (private_data_t *) ev->private_data; int fd; void * block; int32_t bytes_written; @@ -346,7 +345,7 @@ } /* Wipe out the NT4+ backup boot sector. */ - bytes_written = EngFncs->write_volume(ev, fd, block, NTFS_BLOCK_SIZE, (pd->fs_size << EVMS_VSECTOR_SIZE_SHIFT) - NTFS_BLOCK_SIZE); + bytes_written = EngFncs->write_volume(ev, fd, block, NTFS_BLOCK_SIZE, (ev->vol_size << EVMS_VSECTOR_SIZE_SHIFT) - NTFS_BLOCK_SIZE); if (bytes_written != NTFS_BLOCK_SIZE) { LOG_WARNING("Failed to clear the primary boot sector on volume %s. " "Only %d bytes were written.\n", @@ -355,7 +354,7 @@ } /* Wipe out the NT3.51- backup boot sector. */ - bytes_written = EngFncs->write_volume(ev, fd, block, NTFS_BLOCK_SIZE, (pd->fs_size << (EVMS_VSECTOR_SIZE_SHIFT - 1))); + bytes_written = EngFncs->write_volume(ev, fd, block, NTFS_BLOCK_SIZE, (ev->vol_size << (EVMS_VSECTOR_SIZE_SHIFT - 1))); if (bytes_written != NTFS_BLOCK_SIZE) { LOG_WARNING("Failed to clear the primary boot sector on volume %s. " "Only %d bytes were written.\n", ++++++ prevent_unaligned_warning.patch ++++++ --- /var/tmp/diff_new_pack.LMCqks/_old 2006-06-03 00:54:24.000000000 +0200 +++ /var/tmp/diff_new_pack.LMCqks/_new 2006-06-03 00:54:24.000000000 +0200 @@ -54,3 +54,171 @@ LOG_PROC_EXIT_INT(rc); return rc; +@@ -259,33 +259,35 @@ + value_list_t ** target) + { + int rc=0; ++ value_list_t *tl; + + if (source != NULL) { + uint size; + + size = sizeof(value_list_t) + (sizeof(value_t) * source->count); + +- *target = engine_alloc(size); +- if (*target != NULL) { ++ tl = engine_alloc(size); ++ if (tl != NULL) { + if (type == EVMS_Type_String) { + int i; + + /* Copy the count of strings. */ +- (*target)->count = source->count; ++ tl->count = source->count; + + /* Get new copies of the strings for the target. */ + for (i = 0; (rc == 0) && (i < source->count); i++) { +- rc = copy_to_new_string(source->value[i].s, &((*target)->value[i].s)); ++ rc = copy_to_new_string(source->value[i].s, &(tl->value[i].s)); + } + + } else { + /* Copy the value list. */ +- memcpy(*target, source, size); ++ memcpy(tl, source, size); + } + + } else { + rc = ENOMEM; + } ++ memcpy( target, (char*)&tl, sizeof(tl)); + } + + return rc; +--- plugins/xfs/fs_xfs.c ++++ plugins/xfs/fs_xfs.c 2006/05/22 11:01:09 +@@ -720,6 +720,8 @@ + list_anchor_t global_volumes; + list_element_t vol_list_iter; + int rc, i, count; ++ value_list_t *vl; ++ memcpy( (char*)&vl, (char*)value_list, sizeof(vl) ); + + LOG_ENTRY(); + +@@ -746,24 +748,24 @@ + } + + /* if 'available volumes' list already exists, free it and start over */ +- if (*value_list) { +- for (i = 0; i < (*value_list)->count; i++) { +- if ((*value_list)->value[i].s) { +- EngFncs->engine_free((*value_list)->value[i].s); ++ if (vl) { ++ for (i = 0; i < vl->count; i++) { ++ if (vl->value[i].s) { ++ EngFncs->engine_free(vl->value[i].s); + } + } +- EngFncs->engine_free(*value_list); ++ EngFncs->engine_free(vl); + } +- *value_list = NULL; ++ vl = NULL; + + count = EngFncs->list_count(global_volumes); + /* Increment count to hold the 'None' selection. */ + count++; + /* allocate and populate 'available volumes' list */ +- *value_list = EngFncs->engine_alloc((count + 1) * sizeof(value_t) + ++ vl = EngFncs->engine_alloc((count + 1) * sizeof(value_t) + + sizeof(value_list_t)); + i = 0; +- (*value_list)->value[i].s = EngFncs->engine_strdup(NO_SELECTION); ++ vl->value[i].s = EngFncs->engine_strdup(NO_SELECTION); + i++; + LIST_FOR_EACH(global_volumes, vol_list_iter, vol) { + /* add proper volumes to 'available volumes' list */ +@@ -774,13 +776,14 @@ + *************************************************************/ + if (vol->file_system_manager == NULL && + !EngFncs->is_mounted(vol->dev_node, NULL)) { +- (*value_list)->value[i].s = EngFncs->engine_alloc(strlen(vol->name) + 1); +- strcpy((*value_list)->value[i].s, vol->name); ++ vl->value[i].s = EngFncs->engine_alloc(strlen(vol->name) + 1); ++ strcpy(vl->value[i].s, vol->name); + i++; + } + } +- (*value_list)->count = i; ++ vl->count = i; + EngFncs->destroy_list(global_volumes); ++ memcpy( (char*)value_list, (char*)&vl, sizeof(vl) ); + + LOG_EXIT_INT(0); + return 0; +--- plugins/jfs/fs_jfs.c ++++ plugins/jfs/fs_jfs.c 2006/05/22 11:04:55 +@@ -811,6 +811,8 @@ + logical_volume_t * vol; + list_element_t tmp_list_iter; + list_anchor_t tmp_list, selected_tmp_list; ++ value_list_t *vl; ++ memcpy( (char*)&vl, (char*)value_list, sizeof(vl) ); + + LOG_ENTRY(); + +@@ -843,26 +845,26 @@ + EngFncs->destroy_list(selected_tmp_list); + + /* if 'available volumes' list already exists, free it and start over */ +- if (*value_list) { +- for (i = 0; i < (*value_list)->count; i++) { +- if ((*value_list)->value[i].s) { +- EngFncs->engine_free((*value_list)->value[i].s); ++ if (vl) { ++ for (i = 0; i < vl->count; i++) { ++ if (vl->value[i].s) { ++ EngFncs->engine_free(vl->value[i].s); + } + } +- EngFncs->engine_free(*value_list); ++ EngFncs->engine_free(vl); + } +- *value_list = NULL; ++ vl = NULL; + + count = EngFncs->list_count(tmp_list); + /* Increment count to hold the 'None' selection. */ + count++; + /* allocate and populate 'available volumes' list */ +- *value_list = EngFncs->engine_alloc(count * sizeof(value_t) + sizeof(value_list_t)); ++ vl = EngFncs->engine_alloc(count * sizeof(value_t) + sizeof(value_list_t)); + if (!rc) { + list_element_t vol_list_iter; + + i = 0; +- (*value_list)->value[i].s = EngFncs->engine_strdup(NO_SELECTION); ++ vl->value[i].s = EngFncs->engine_strdup(NO_SELECTION); + i++; + LIST_FOR_EACH(tmp_list, vol_list_iter, vol) { + /* add proper volumes to 'available volumes' list */ +@@ -873,14 +875,15 @@ + *************************************************************/ + if ( (vol->file_system_manager == NULL ) && + (!EngFncs->is_mounted(vol->dev_node, NULL)) ) { +- (*value_list)->value[i].s = EngFncs->engine_alloc(strlen(vol->name) + 1); +- strcpy((*value_list)->value[i].s, vol->name); ++ vl->value[i].s = EngFncs->engine_alloc(strlen(vol->name) + 1); ++ strcpy(vl->value[i].s, vol->name); + i++; + } + } +- (*value_list)->count = i; ++ vl->count = i; + } + EngFncs->destroy_list(tmp_list); ++ memcpy( (char*)value_list, (char*)&vl, sizeof(vl) ); + + LOG_EXIT_INT(rc); + return rc; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit-unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit-help@opensuse.org
participants (1)
-
root@suse.de