Hello community,

here is the log from the commit of package stress-ng for openSUSE:Factory 
checked in at 2018-02-06 16:47:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/stress-ng (Old)
 and      /work/SRC/openSUSE:Factory/.stress-ng.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "stress-ng"

Tue Feb  6 16:47:33 2018 rev:32 rq:572515 version:0.09.15

Changes:
--------
--- /work/SRC/openSUSE:Factory/stress-ng/stress-ng.changes      2018-01-31 
19:54:01.179539724 +0100
+++ /work/SRC/openSUSE:Factory/.stress-ng.new/stress-ng.changes 2018-02-06 
16:47:35.848438787 +0100
@@ -1,0 +2,11 @@
+Sun Feb  4 09:04:27 UTC 2018 - [email protected]
+
+- Update to version 0.09.15
+  * Makefile: bump version
+  * stress-bind-mount: ensure we have clone support with HAVE_CLONE
+    check, fixes another FTBFS in ia64
+  * stress-wait: remove empty line
+  * Rename array and type unsupported to supported
+  * stress-flock: Add more flock lock types, add more stressing children
+
+-------------------------------------------------------------------

Old:
----
  stress-ng-0.09.14.tar.xz

New:
----
  stress-ng-0.09.15.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ stress-ng.spec ++++++
--- /var/tmp/diff_new_pack.qb60LU/_old  2018-02-06 16:47:37.076381329 +0100
+++ /var/tmp/diff_new_pack.qb60LU/_new  2018-02-06 16:47:37.076381329 +0100
@@ -18,7 +18,7 @@
 
 
 Name:           stress-ng
-Version:        0.09.14
+Version:        0.09.15
 Release:        0
 Summary:        Tool to load and stress a computer
 License:        GPL-2.0

++++++ stress-ng-0.09.14.tar.xz -> stress-ng-0.09.15.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.14/Makefile 
new/stress-ng-0.09.15/Makefile
--- old/stress-ng-0.09.14/Makefile      2018-01-30 14:17:57.000000000 +0100
+++ new/stress-ng-0.09.15/Makefile      2018-02-03 16:21:38.000000000 +0100
@@ -16,7 +16,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
 #
 
-VERSION=0.09.14
+VERSION=0.09.15
 #
 # Codename "portable pressure producer"
 #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.14/stress-bind-mount.c 
new/stress-ng-0.09.15/stress-bind-mount.c
--- old/stress-ng-0.09.14/stress-bind-mount.c   2018-01-30 14:17:58.000000000 
+0100
+++ new/stress-ng-0.09.15/stress-bind-mount.c   2018-02-03 16:21:38.000000000 
+0100
@@ -24,7 +24,10 @@
  */
 #include "stress-ng.h"
 
-#if defined(__linux__) && defined(MS_BIND) && defined(MS_REC)
+#if defined(__linux__) && \
+    defined(MS_BIND) && \
+    defined(MS_REC) && \
+    defined(HAVE_CLONE)
 
 #define CLONE_STACK_SIZE       (64*1024)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.14/stress-flock.c 
new/stress-ng-0.09.15/stress-flock.c
--- old/stress-ng-0.09.14/stress-flock.c        2018-01-30 14:17:58.000000000 
+0100
+++ new/stress-ng-0.09.15/stress-flock.c        2018-02-03 16:21:38.000000000 
+0100
@@ -26,63 +26,118 @@
 
 #if defined(LOCK_EX) && defined(LOCK_UN)
 
+#define MAX_FLOCK_STRESSORS    (3)
+
+void stress_flock_child(const args_t *args, const int fd)
+{
+       bool cont;
+
+       for (;;) {
+               if (flock(fd, LOCK_EX) == 0) {
+                       cont = keep_stressing();
+                       if (cont)
+                               inc_counter(args);
+                       (void)flock(fd, LOCK_UN);
+                       if (!cont)
+                               break;
+               }
+
+#if defined(LOCK_NB)
+               if (flock(fd, LOCK_EX | LOCK_NB) == 0) {
+                       cont = keep_stressing();
+                       if (cont)
+                               inc_counter(args);
+                       (void)flock(fd, LOCK_UN);
+                       if (!cont)
+                               break;
+               }
+#endif
+
+#if defined(LOCK_SH)
+               if (!keep_stressing())
+                       break;
+               if (flock(fd, LOCK_SH) == 0) {
+                       cont = keep_stressing();
+                       if (cont)
+                               inc_counter(args);
+                       (void)flock(fd, LOCK_UN);
+                       if (!cont)
+                               break;
+               }
+#endif
+
+#if defined(LOCK_SH) && defined(LOCK_NB)
+               if (!keep_stressing())
+                       break;
+               if (flock(fd, LOCK_SH | LOCK_NB) == 0) {
+                       cont = keep_stressing();
+                       if (cont)
+                               inc_counter(args);
+                       (void)flock(fd, LOCK_UN);
+                       if (!cont)
+                               break;
+               }
+#endif
+       }
+}
+
 /*
  *  stress_flock
  *     stress file locking
  */
 int stress_flock(const args_t *args)
 {
-       int fd;
-       const pid_t ppid = getppid();
+       int fd, ret, rc = EXIT_FAILURE;
+       size_t i;
+       pid_t pids[MAX_FLOCK_STRESSORS];
        char filename[PATH_MAX];
-       char dirname[PATH_MAX];
 
-       /*
-        *  There will be a race to create the directory
-        *  so EEXIST is expected on all but one instance
-        */
-       (void)stress_temp_dir(dirname, sizeof(dirname), args->name, ppid, 
args->instance);
-       if (mkdir(dirname, S_IRWXU) < 0) {
-               if (errno != EEXIST) {
-                       pr_fail_err("mkdir");
-                       return exit_status(errno);
-               }
+       ret = stress_temp_dir_mk_args(args);
+       if (ret < 0)
+               return exit_status(-ret);
+
+       (void)stress_temp_filename_args(args,
+               filename, sizeof(filename), mwc32());
+       fd = open(filename, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
+       if (fd < 0) {
+               pr_err("%s: failed to create %s: errno=%d (%s)\n",
+                       args->name, filename, errno, strerror(errno));
+                       goto err;
        }
 
-       /*
-        *  Lock file is based on parent pid and instance 0
-        *  as we need to share this among all the other
-        *  stress flock processes
-        */
-       (void)stress_temp_filename(filename, sizeof(filename),
-               args->name, ppid, 0, 0);
-retry:
-       if ((fd = open(filename, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR)) < 0) {
-               int rc = exit_status(errno);
-
-               if ((errno == ENOENT) && g_keep_stressing_flag) {
-                       /* Race, sometimes we need to retry */
-                       goto retry;
-               }
-               /* Not sure why this fails.. report and abort */
-               pr_fail_err("open");
-               (void)rmdir(dirname);
-               return rc;
-       }
+       memset(pids, 0, sizeof(pids));
+       for (i = 0; i < MAX_FLOCK_STRESSORS; i++) {
+               pids[i] = fork();
+               if (pids[i] < 0) {
+                       goto reap;
+               } else if (pids[i] == 0) {
+                       (void)setpgid(0, g_pgrp);
+                       stress_parent_died_alarm();
 
-       do {
-               if (flock(fd, LOCK_EX) < 0)
-                       continue;
-               (void)shim_sched_yield();
-               (void)flock(fd, LOCK_UN);
-               inc_counter(args);
-       } while (keep_stressing());
+                       stress_flock_child(args, fd);
+                       _exit(EXIT_SUCCESS);
+               }
+       }
 
+       stress_flock_child(args, fd);
+       rc = EXIT_SUCCESS;
+reap:
        (void)close(fd);
+
+       for (i = 0; i < MAX_FLOCK_STRESSORS; i++) {
+               if (pids[i] > 0) {
+                       int status;
+
+                       (void)kill(pids[i], SIGKILL);
+                       (void)waitpid(pids[i], &status, 0);
+               }
+       }
+
        (void)unlink(filename);
-       (void)rmdir(dirname);
+err:
+       (void)stress_temp_dir_rm_args(args);
 
-       return EXIT_SUCCESS;
+       return rc;
 }
 
 #else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.14/stress-ng.c 
new/stress-ng-0.09.15/stress-ng.c
--- old/stress-ng-0.09.14/stress-ng.c   2018-01-30 14:17:58.000000000 +0100
+++ new/stress-ng-0.09.15/stress-ng.c   2018-02-03 16:21:38.000000000 +0100
@@ -37,7 +37,7 @@
 typedef struct {
        const stress_id_t str_id;
        int (*func_supported)(void);
-} unsupported_t;
+} supported_t;
 
 typedef struct {
        const stress_id_t str_id;
@@ -87,7 +87,7 @@
  *  stressors to be run-time checked to see if they are supported
  *  on the platform.
  */
-static const unsupported_t unsupported[] = {
+static const supported_t supported[] = {
        { STRESS_APPARMOR,      stress_apparmor_supported },
        { STRESS_CHROOT,        stress_chroot_supported },
        { STRESS_CYCLIC,        stress_cyclic_supported },
@@ -2629,16 +2629,16 @@
 {
        size_t i;
 
-       for (i = 0; i < SIZEOF_ARRAY(unsupported); i++) {
+       for (i = 0; i < SIZEOF_ARRAY(supported); i++) {
                proc_info_t *pi = procs_head;
-               stress_id_t id = unsupported[i].str_id;
+               stress_id_t id = supported[i].str_id;
 
                while (pi) {
                        proc_info_t *next = pi->next;
 
                        if ((pi->stressor->id == id) &&
                            (pi->num_procs) &&
-                           (unsupported[i].func_supported() < 0))
+                           (supported[i].func_supported() < 0))
                                remove_proc(pi);
                        pi = next;
                }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.14/stress-wait.c 
new/stress-ng-0.09.15/stress-wait.c
--- old/stress-ng-0.09.14/stress-wait.c 2018-01-30 14:17:58.000000000 +0100
+++ new/stress-ng-0.09.15/stress-wait.c 2018-02-03 16:21:38.000000000 +0100
@@ -24,7 +24,6 @@
  */
 #include "stress-ng.h"
 
-
 /*
  *  Disabled for GNU/Hurd because it this stressor breaks with
  *  the error:


Reply via email to