Hello community, here is the log from the commit of package powerpc-utils for openSUSE:Factory checked in at 2015-10-12 10:00:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/powerpc-utils (Old) and /work/SRC/openSUSE:Factory/.powerpc-utils.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "powerpc-utils" Changes: -------- --- /work/SRC/openSUSE:Factory/powerpc-utils/powerpc-utils.changes 2015-07-28 11:42:56.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.powerpc-utils.new/powerpc-utils.changes 2015-10-12 10:01:08.000000000 +0200 @@ -1,0 +2,20 @@ +Wed Oct 7 10:16:45 UTC 2015 - [email protected] + +- generate error message when PHB is not found (bsc#948430) + +- added patches: + * powerpc-utils.bug-948430-drmgr-Generate-error-message-when-PHB-is-not-found.patch + +------------------------------------------------------------------- +Thu Oct 1 09:22:31 UTC 2015 - [email protected] + +- fix for adding spookfish 8GB FC adapter for DLPAR operations + (bsc#945968) +- warn users about deprecated support SLES 12 onwards (bsc#936383) + +- added patches: + * powerpc-utils.bug-945968_allocate-workarea-memory-instead-of-using-stac.patch + * powerpc-utils.bug-945968_drmgr-Combine-the-init_node-and-examine_child-routin.patch + * powerpc-utils.bug-936383_snap-deprecated_warning_sles.patch + +------------------------------------------------------------------- New: ---- powerpc-utils.bug-936383_snap-deprecated_warning_sles.patch powerpc-utils.bug-945968_allocate-workarea-memory-instead-of-using-stac.patch powerpc-utils.bug-945968_drmgr-Combine-the-init_node-and-examine_child-routin.patch powerpc-utils.bug-948430-drmgr-Generate-error-message-when-PHB-is-not-found.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ powerpc-utils.spec ++++++ --- /var/tmp/diff_new_pack.X7CMCv/_old 2015-10-12 10:01:08.000000000 +0200 +++ /var/tmp/diff_new_pack.X7CMCv/_new 2015-10-12 10:01:08.000000000 +0200 @@ -41,6 +41,10 @@ Source1: nvsetenv Patch1: powerpc-utils-lsprop.patch Patch2: ofpathname_powernv.patch +Patch3: powerpc-utils.bug-936383_snap-deprecated_warning_sles.patch +Patch4: powerpc-utils.bug-945968_allocate-workarea-memory-instead-of-using-stac.patch +Patch5: powerpc-utils.bug-945968_drmgr-Combine-the-init_node-and-examine_child-routin.patch +Patch6: powerpc-utils.bug-948430-drmgr-Generate-error-message-when-PHB-is-not-found.patch ExclusiveArch: ppc ppc64 ppc64le %description @@ -51,6 +55,10 @@ %setup -q %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 %build %configure ++++++ powerpc-utils.bug-936383_snap-deprecated_warning_sles.patch ++++++ Index: powerpc-utils-1.2.26/scripts/snap =================================================================== --- powerpc-utils-1.2.26.orig/scripts/snap +++ powerpc-utils-1.2.26/scripts/snap @@ -35,17 +35,23 @@ my $cmddir = "snap_commands"; # cmd out my $cmdoutdir = "$outdir/$cmddir"; # in outdir dir. my $rsxx_exists = 0; # Does an IBM Flash Adapter exist? my $distro_file = "/etc/issue"; -my $redhat_release_file = "/etc/redhat-release"; -if (-e $redhat_release_file) { - open(RELEASE, "< $redhat_release_file") or die "open: $!\n"; - $_ = <RELEASE>; - my $redhat_version = (split / /, $_)[6]; - if ($redhat_version >= 7.0) { - print "snap is not supported on the RHEL 7 onwards..!\n"; - print "Please use sosreport to collect log data..!! \n"; - exit 1; - } +my $suse_release_file = "/etc/SuSE-release"; + +if (-e $suse_release_file) { + open(RELEASE, "< $suse_release_file") or die "open: $!\n"; + while(<RELEASE>) { + if ($_ =~ /VERSION/) { + my $suse_version = (split /=/, $_)[1]; + if ($suse_version >= 12) { + print "snap is depcreated from SLES 12 onwards..!\n"; + print "Please use supportconfig to collect log data..!! \n"; + close(RELEASE); + exit 1; + } #check version number + } # match version + } #while + close(RELEASE); } our($opt_a, $opt_d, $opt_h, $opt_o, $opt_t, $opt_v); ++++++ powerpc-utils.bug-945968_allocate-workarea-memory-instead-of-using-stac.patch ++++++ >From 96a83ab8b84576517a28bc8f4d8e684e6c86befd Mon Sep 17 00:00:00 2001 From: Nathan Fontenot <[email protected]> Date: Wed, 2 Sep 2015 10:36:25 -0400 Subject: [PATCH] drmgr: Allocate workarea memory instead of using stack The configure_connector() routine declares a 4K buffer on the stack, this is causing odd behaviors in drmgr such as segfaults in libc malloc code. The workarea should be malloc()'ed instead of being on the stack. Signed-off-by: Nathan Fontenot <[email protected]> --- src/drmgr/rtas_calls.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/drmgr/rtas_calls.c b/src/drmgr/rtas_calls.c index b7b5b82..e312260 100644 --- a/src/drmgr/rtas_calls.c +++ b/src/drmgr/rtas_calls.c @@ -263,7 +263,7 @@ set_indicator_error(int error) struct of_node * configure_connector(int index) { - char workarea[WORK_SIZE]; + char *workarea; struct of_node *node; struct of_node *first_node = NULL; struct of_node *last_node = NULL; /* Last node processed */ @@ -274,8 +274,12 @@ configure_connector(int index) say(DEBUG, "Configuring connector for drc index %x\n", index); + workarea = zalloc(WORK_SIZE); + if (!workarea) + return NULL; + /* initialize work area and args structure */ - work_int = (int *) &workarea[0]; + work_int = (int *)workarea; work_int[0] = htobe32(index); work_int[1] = 0; @@ -397,6 +401,7 @@ configure_connector(int index) } } + free(workarea); return first_node; } -- 1.8.5.6 ++++++ powerpc-utils.bug-945968_drmgr-Combine-the-init_node-and-examine_child-routin.patch ++++++ >From 5fee10ac758e16d49e42d5cf0855df44b1f90a7a Mon Sep 17 00:00:00 2001 From: Nathan Fontenot <[email protected]> Date: Wed, 2 Sep 2015 11:03:28 -0400 Subject: [PATCH] drmgr: Combine the init_node() and examine_child() routines The complexity of the init_node() and examine_child() routines that call each other recursively is causing drmgr to segfault in odd and sometimes slightly differing ways. Each instance does involve drmgr segfaulting in libc malloc code. This patch re-writes these two routines to combine them into a single routine that is called recursively. The result is cleaner code that no longer segfaults. Signed-off-by: Nathan Fontenot <[email protected]> --- src/drmgr/common_pci.c | 100 +++++++++++++++++-------------------------------- 1 file changed, 34 insertions(+), 66 deletions(-) diff --git a/src/drmgr/common_pci.c b/src/drmgr/common_pci.c index 04a8a35..590c9b2 100644 --- a/src/drmgr/common_pci.c +++ b/src/drmgr/common_pci.c @@ -304,11 +304,6 @@ add_child_node(struct dr_node *parent, char *child_path) parent->children = child; } -/* This forward declaration is needed because init_node and examine_child - * call each other. - */ -static int examine_child(struct dr_node *, char *); - /** * init_node * @@ -318,82 +313,55 @@ static int examine_child(struct dr_node *, char *); static int init_node(struct dr_node *node) { - struct dirent **de_list, *de; - char *newpath; - int count; - int rc, i; + DIR *d; + struct dirent *de; + char child_path[DR_PATH_MAX]; + uint32_t my_drc_index; + int rc; if (node->is_owned) find_ofdt_dname(node, node->ofdt_path); - count = scandir(node->ofdt_path, &de_list, 0, alphasort); - for (i = 0; i < count; i++) { - de = de_list[i]; + d = opendir(node->ofdt_path); + if (!d) + return -1; + + rc = 0; + while ((de = readdir(d)) != NULL) { if ((de->d_type != DT_DIR) || is_dot_dir(de->d_name)) continue; - newpath = zalloc(strlen(node->ofdt_path) + - strlen(de->d_name) + 2); - if (newpath == NULL) { - say(ERROR, "Could not allocate path for node at " - "%s/%s\n", node->ofdt_path, de->d_name); - return 1; - } - - sprintf(newpath, "%s/%s", node->ofdt_path, de->d_name); - rc = examine_child(node, newpath); - if (rc) - return rc; - } - - return 0; -} - -/** - * examine_children - * - * @param node - * @param child_path - * @returns 0 on success, !0 otherwise - */ -static int -examine_child(struct dr_node *node, char *child_path) -{ - uint32_t my_drc_index; - int used = 0; - int rc = 0; + sprintf(child_path, "%s/%s", node->ofdt_path, de->d_name); - if (get_my_drc_index(child_path, &my_drc_index)) - goto done; + if (get_my_drc_index(child_path, &my_drc_index)) + continue; - if (node->dev_type == PCI_HP_DEV) { - if (node->drc_index == my_drc_index) { - /* Add hotplug children */ - add_child_node(node, child_path); - used = 1; - } - } else { - if (! node->is_owned) { + if (node->dev_type == PCI_HP_DEV) { if (node->drc_index == my_drc_index) { - /* Update node path */ - snprintf(node->ofdt_path, DR_PATH_MAX, "%s", - child_path); - node->is_owned = 1; - used = 1; - - /* Populate w/ children */ - rc = init_node(node); + /* Add hotplug children */ + add_child_node(node, child_path); } } else { - /* Add all DR-capable children */ - add_child_node(node, child_path); - used = 1; + if (!node->is_owned) { + if (node->drc_index == my_drc_index) { + /* Update node path */ + snprintf(node->ofdt_path, DR_PATH_MAX, + "%s", child_path); + node->is_owned = 1; + + /* Populate w/ children */ + rc = init_node(node); + if (rc) + break; + } + } else { + /* Add all DR-capable children */ + add_child_node(node, child_path); + } } } -done: - if (! used) - free(child_path); + closedir(d); return rc; } -- 1.8.5.6 ++++++ powerpc-utils.bug-948430-drmgr-Generate-error-message-when-PHB-is-not-found.patch ++++++ >From d291c43e4ad1141591008e39e77549a6fd33d48a Mon Sep 17 00:00:00 2001 From: Nathan Fontenot <[email protected]> Date: Tue, 8 Sep 2015 11:35:09 -0400 Subject: [PATCH] drmgr: Generate error message when PHB is not found An error message should be generated when drmgr is asked to remove a PHB that does not exist. The current behavior is to just exit without any message. Signed-off-by: Nathan Fontenot <[email protected]> --- src/drmgr/drslot_chrp_phb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/drmgr/drslot_chrp_phb.c b/src/drmgr/drslot_chrp_phb.c index 3ed109c..dc83125 100644 --- a/src/drmgr/drslot_chrp_phb.c +++ b/src/drmgr/drslot_chrp_phb.c @@ -253,8 +253,10 @@ remove_phb(struct options *opts) int rc = 0; phb = get_node_by_name(opts->usr_drc_name, PHB_NODES); - if (phb == NULL) + if (phb == NULL) { + say(ERROR, "Could not find PHB %s\n", opts->usr_drc_name); return RC_NONEXISTENT; + } /* If this PHB still owns children that are not hotplug, fail. */ for (child = phb->children; child; child = child->next) { -- 1.8.5.6
