Hello community,

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

Package is "stress-ng"

Thu Feb 22 15:00:26 2018 rev:33 rq:577380 version:0.09.16

Changes:
--------
--- /work/SRC/openSUSE:Factory/stress-ng/stress-ng.changes      2018-02-06 
16:47:35.848438787 +0100
+++ /work/SRC/openSUSE:Factory/.stress-ng.new/stress-ng.changes 2018-02-22 
15:00:29.698215250 +0100
@@ -1,0 +2,17 @@
+Fri Feb 16 17:17:20 UTC 2018 - mar...@gmx.de
+
+- Update to version 0.09.16
+  * Makefile: bump version
+  * Silence a build warning on %d for g_pgrp, cast to int
+  * Use the new is_dot_filename() helper
+  * Add is_dot_filename helper function to check for "." or ".." filenames
+  * stress-filename: clean up temporary files on forced termination
+  * stress-handle: catch any SIGKILL signals and report back
+  * stress-filename: catch any SIGKILL signals and report back
+  * Print process ID in [ ] braces
+  * Add debug to inform us when stress-ng kills process group with SIGKILL
+  * Makefile: make build output less noisy and cluttered
+  * helper: add in compiler major minor info
+  * stress-vecmath: don't built with clang less than version 5.0
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ stress-ng.spec ++++++
--- /var/tmp/diff_new_pack.FUAX5J/_old  2018-02-22 15:00:30.878172799 +0100
+++ /var/tmp/diff_new_pack.FUAX5J/_new  2018-02-22 15:00:30.886172511 +0100
@@ -18,10 +18,10 @@
 
 
 Name:           stress-ng
-Version:        0.09.15
+Version:        0.09.16
 Release:        0
 Summary:        Tool to load and stress a computer
-License:        GPL-2.0
+License:        GPL-2.0-only
 Group:          System/Benchmark
 Url:            http://kernel.ubuntu.com/~cking/stress-ng/
 Source:         
http://kernel.ubuntu.com/~cking/tarballs/%{name}/%{name}-%{version}.tar.xz

++++++ stress-ng-0.09.15.tar.xz -> stress-ng-0.09.16.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.15/Makefile 
new/stress-ng-0.09.16/Makefile
--- old/stress-ng-0.09.15/Makefile      2018-02-03 16:21:38.000000000 +0100
+++ new/stress-ng-0.09.16/Makefile      2018-02-15 18:41:52.000000000 +0100
@@ -16,7 +16,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
 #
 
-VERSION=0.09.15
+VERSION=0.09.16
 #
 # Codename "portable pressure producer"
 #
@@ -307,11 +307,16 @@
 .o: stress-ng.h Makefile
 
 .c.o: stress-ng.h Makefile $(SRC)
-       @echo $(CC) $(CFLAGS) -c -o $@ $<
+       @echo "CC $<"
        @$(CC) $(CFLAGS) -c -o $@ $<
 
-stress-ng: $(OBJS)
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(OBJS) -lm $(LDFLAGS) -lc -o $@
+stress-ng: info $(OBJS)
+       @echo "LD $@"
+       @$(CC) $(CPPFLAGS) $(CFLAGS) $(OBJS) -lm $(LDFLAGS) -lc -o $@
+
+.PHONY: info
+info:
+       @echo "CFLAGS: $(CFLAGS)"
 
 #
 #  generate apparmor data using minimal core utils tools from apparmor
@@ -326,7 +331,8 @@
                sed '$$ s/.$$//' >> apparmor-data.c
        @echo "};" >> apparmor-data.c
        @echo "const size_t g_apparmor_data_len = sizeof(g_apparmor_data);" >> 
apparmor-data.c
-       $(CC) -c apparmor-data.c -o apparmor-data.o
+       @echo "CC $<"
+       @$(CC) -c apparmor-data.c -o apparmor-data.o
        @rm -rf apparmor-data.c
 
 #
@@ -340,11 +346,11 @@
 
 perf.o: perf.c perf-event.c
        @gcc -E perf-event.c | grep "PERF_COUNT" | sed 's/,/ /' | awk {'print 
"#define _SNG_" $$1 " (1)"'} > perf-event.h
-       @echo $(CC) $(CFLAGS) -c -o $@ $<
+       @echo CC $<
        @$(CC) $(CFLAGS) -c -o $@ $<
 
 stress-vecmath.o: stress-vecmath.c
-       @echo $(CC) $(CFLAGS) -fno-builtin -c -o $@ $<
+       @echo CC $<
        @$(CC) $(CFLAGS) -fno-builtin -c -o $@ $<
        @touch stress-ng.c
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.15/helper.c 
new/stress-ng-0.09.16/helper.c
--- old/stress-ng-0.09.15/helper.c      2018-02-03 16:21:38.000000000 +0100
+++ new/stress-ng-0.09.16/helper.c      2018-02-15 18:41:52.000000000 +0100
@@ -1054,6 +1054,9 @@
 #endif
 }
 
+#define XSTRINGIFY(s) STRINGIFY(s)
+#define STRINGIFY(s) #s
+
 /*
  *  stress_not_implemented()
  *     report that a stressor is not implemented
@@ -1061,17 +1064,24 @@
  */
 int stress_not_implemented(const args_t *args)
 {
+#if defined(__clang_major__) && defined(__clang_minor__)
+       static char cc[] = " (clang " XSTRINGIFY(__clang_major__) "." 
XSTRINGIFY(__clang_minor__) ")";
+#elif defined(__GNUC__) && defined(__GNUC_MINOR__)
+       static char cc[] = " (gcc " XSTRINGIFY(__GNUC__) "." 
XSTRINGIFY(__GNUC_MINOR__) ")";
+#else
+       static char cc[] = " (cc unknown)";
+#endif
 #if defined(HAVE_UNAME)
        struct utsname buf;
 
        if (!uname(&buf)) {
-               pr_inf("%s: this stressor is not implemented on this system: %s 
%s %s\n",
-                       args->name, buf.machine, buf.sysname, buf.release);
+               pr_inf("%s: this stressor is not implemented on this system: %s 
%s %s%s\n",
+                       args->name, buf.machine, buf.sysname, buf.release, cc);
                return EXIT_NOT_IMPLEMENTED;
        }
 #endif
-       pr_inf("%s: this stressor is not implemented on this system\n",
-               args->name);
+       pr_inf("%s: this stressor is not implemented on this system: %s\n",
+               args->name, cc);
        return EXIT_NOT_IMPLEMENTED;
 }
 
@@ -1281,3 +1291,16 @@
        return 0;
 }
 #endif
+
+/*
+ *  is_dot_filename()
+ *     is filename "." or ".."
+ */
+bool is_dot_filename(const char *name)
+{
+       if (!strcmp(name, "."))
+               return true;
+       if (!strcmp(name, ".."))
+               return true;
+       return false;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.15/stress-apparmor.c 
new/stress-ng-0.09.16/stress-apparmor.c
--- old/stress-ng-0.09.15/stress-apparmor.c     2018-02-03 16:21:38.000000000 
+0100
+++ new/stress-ng-0.09.16/stress-apparmor.c     2018-02-15 18:41:52.000000000 
+0100
@@ -162,8 +162,7 @@
 
                if (!g_keep_stressing_flag)
                        break;
-               if (!strcmp(d->d_name, ".") ||
-                   !strcmp(d->d_name, ".."))
+               if (is_dot_filename(d->d_name))
                        continue;
                switch (d->d_type) {
                case DT_DIR:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.15/stress-dev.c 
new/stress-ng-0.09.16/stress-dev.c
--- old/stress-ng-0.09.15/stress-dev.c  2018-02-03 16:21:38.000000000 +0100
+++ new/stress-ng-0.09.16/stress-dev.c  2018-02-15 18:41:52.000000000 +0100
@@ -383,8 +383,7 @@
 
                if (!keep_stressing())
                        break;
-               if (!strcmp(d->d_name, ".") ||
-                   !strcmp(d->d_name, ".."))
+               if (is_dot_filename(d->d_name))
                        continue;
                /* Xen clients hang on hpet when running as root */
                if (!euid && !strcmp(d->d_name, "hpet"))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.15/stress-filename.c 
new/stress-ng-0.09.16/stress-filename.c
--- old/stress-ng-0.09.15/stress-filename.c     2018-02-03 16:21:38.000000000 
+0100
+++ new/stress-ng-0.09.16/stress-filename.c     2018-02-15 18:41:52.000000000 
+0100
@@ -162,6 +162,31 @@
 }
 
 /*
+ *  stress_filename_tidy()
+ *     clean up residual files
+ */
+static void stress_filename_tidy(const char *path)
+{
+       DIR *dir;
+       struct dirent *d;
+
+       dir = opendir(path);
+       if (dir) {
+               while ((d = readdir(dir)) != NULL) {
+                       char filename[PATH_MAX];
+
+                       if (is_dot_filename(d->d_name))
+                               continue;
+                       (void)snprintf(filename, sizeof(filename),
+                               "%s/%s", path, d->d_name);
+                       (void)unlink(filename);
+               }
+       }
+       (void)closedir(dir);
+       (void)rmdir(path);
+}
+
+/*
  *  stress_filename_generate_random()
  *     generate a filename of length sz_max with
  *     random selection from possible char set
@@ -213,7 +238,7 @@
  *  stress_filename()
  *     stress filename sizes etc
  */
-int stress_filename (const args_t *args)
+int stress_filename(const args_t *args)
 {
        int ret, rc = EXIT_FAILURE;
        size_t sz_left, sz_max;
@@ -221,6 +246,7 @@
        char filename[PATH_MAX];
        char *ptr;
        struct statvfs buf;
+       pid_t pid;
        size_t i, chars_allowed = 0, sz;
 #if defined(__APPLE__)
        uint8_t filename_opt = STRESS_FILENAME_POSIX;
@@ -293,63 +319,117 @@
                goto tidy_dir;
        }
 
-       i = 0;
-       sz = 1;
-       do {
-               const char ch = allowed[i];
-               const size_t rnd_sz = 1 + (mwc32() % sz_max);
-
-               i++;
-               if (i >= chars_allowed)
-                       i = 0;
-
-               /* Should succeed */
-               stress_filename_generate(ptr, 1, ch);
-               stress_filename_test(args, filename, 1, true);
-               stress_filename_generate_random(ptr, 1, chars_allowed);
-               stress_filename_test(args, filename, 1, true);
-
-               /* Should succeed */
-               stress_filename_generate(ptr, sz_max, ch);
-               stress_filename_test(args, filename, sz_max, true);
-               stress_filename_generate_random(ptr, sz_max, chars_allowed);
-               stress_filename_test(args, filename, sz_max, true);
-
-               /* Should succeed */
-               stress_filename_generate(ptr, sz_max - 1, ch);
-               stress_filename_test(args, filename, sz_max - 1, true);
-               stress_filename_generate_random(ptr, sz_max - 1, chars_allowed);
-               stress_filename_test(args, filename, sz_max - 1, true);
-
-               /* Should fail */
-               stress_filename_generate(ptr, sz_max + 1, ch);
-               stress_filename_test(args, filename, sz_max + 1, false);
-               stress_filename_generate_random(ptr, sz_max + 1, chars_allowed);
-               stress_filename_test(args, filename, sz_max + 1, false);
-
-               /* Should succeed */
-               stress_filename_generate(ptr, sz, ch);
-               stress_filename_test(args, filename, sz, true);
-               stress_filename_generate_random(ptr, sz, chars_allowed);
-               stress_filename_test(args, filename, sz, true);
-
-               /* Should succeed */
-               stress_filename_generate(ptr, rnd_sz, ch);
-               stress_filename_test(args, filename, rnd_sz, true);
-               stress_filename_generate_random(ptr, rnd_sz, chars_allowed);
-               stress_filename_test(args, filename, rnd_sz, true);
-
-               sz++;
-               if (sz > sz_max)
-                       sz = 1;
+again:
+       if (!g_keep_stressing_flag)
+               goto tidy_dir;
+       pid = fork();
+       if (pid < 0) {
+               if (errno == EAGAIN)
+                       goto again;
+               pr_err("%s: fork failed: errno=%d: (%s)\n",
+                       args->name, errno, strerror(errno));
+       } else if (pid > 0) {
+               int status, ret;
+
+               (void)setpgid(pid, g_pgrp);
+               /* Parent, wait for child */
+               ret = waitpid(pid, &status, 0);
+               if (ret < 0) {
+                       if (errno != EINTR)
+                               pr_dbg("%s: waitpid(): errno=%d (%s)\n",
+                                       args->name, errno, strerror(errno));
+                       (void)kill(pid, SIGTERM);
+                       (void)kill(pid, SIGKILL);
+                       (void)waitpid(pid, &status, 0);
+               } else if (WIFSIGNALED(status)) {
+                       pr_dbg("%s: child died: %s (instance %d)\n",
+                               args->name, stress_strsignal(WTERMSIG(status)),
+                               args->instance);
+                       /* If we got killed by OOM killer, re-start */
+                       if (WTERMSIG(status) == SIGKILL) {
+                               if (g_opt_flags & OPT_FLAGS_OOMABLE) {
+                                       log_system_mem_info();
+                                       pr_dbg("%s: assuming killed by OOM "
+                                               "killer, bailing out "
+                                               "(instance %d)\n",
+                                               args->name, args->instance);
+                                       _exit(0);
+                               } else {
+                                       log_system_mem_info();
+                                       pr_dbg("%s: assuming killed by OOM "
+                                               "killer, restarting again "
+                                               "(instance %d)\n",
+                                               args->name, args->instance);
+                                       goto again;
+                               }
+                       }
+               }
+       } else if (pid == 0) {
+               /* Child, wrapped to catch OOMs */
+
+               (void)setpgid(0, g_pgrp);
+               stress_parent_died_alarm();
 
-               inc_counter(args);
-       } while (keep_stressing());
+               /* Make sure this is killable by OOM killer */
+               set_oom_adjustment(args->name, true);
 
+               i = 0;
+               sz = 1;
+               do {
+                       const char ch = allowed[i];
+                       const size_t rnd_sz = 1 + (mwc32() % sz_max);
+
+                       i++;
+                       if (i >= chars_allowed)
+                               i = 0;
+
+                       /* Should succeed */
+                       stress_filename_generate(ptr, 1, ch);
+                       stress_filename_test(args, filename, 1, true);
+                       stress_filename_generate_random(ptr, 1, chars_allowed);
+                       stress_filename_test(args, filename, 1, true);
+
+                       /* Should succeed */
+                       stress_filename_generate(ptr, sz_max, ch);
+                       stress_filename_test(args, filename, sz_max, true);
+                       stress_filename_generate_random(ptr, sz_max, 
chars_allowed);
+                       stress_filename_test(args, filename, sz_max, true);
+
+                       /* Should succeed */
+                       stress_filename_generate(ptr, sz_max - 1, ch);
+                       stress_filename_test(args, filename, sz_max - 1, true);
+                       stress_filename_generate_random(ptr, sz_max - 1, 
chars_allowed);
+                       stress_filename_test(args, filename, sz_max - 1, true);
+
+                       /* Should fail */
+                       stress_filename_generate(ptr, sz_max + 1, ch);
+                       stress_filename_test(args, filename, sz_max + 1, false);
+                       stress_filename_generate_random(ptr, sz_max + 1, 
chars_allowed);
+                       stress_filename_test(args, filename, sz_max + 1, false);
+
+                       /* Should succeed */
+                       stress_filename_generate(ptr, sz, ch);
+                       stress_filename_test(args, filename, sz, true);
+                       stress_filename_generate_random(ptr, sz, chars_allowed);
+                       stress_filename_test(args, filename, sz, true);
+
+                       /* Should succeed */
+                       stress_filename_generate(ptr, rnd_sz, ch);
+                       stress_filename_test(args, filename, rnd_sz, true);
+                       stress_filename_generate_random(ptr, rnd_sz, 
chars_allowed);
+                       stress_filename_test(args, filename, rnd_sz, true);
+
+                       sz++;
+                       if (sz > sz_max)
+                               sz = 1;
+                       inc_counter(args);
+               } while (keep_stressing());
+               _exit(EXIT_SUCCESS);
+       }
        rc = EXIT_SUCCESS;
 
 tidy_dir:
-       (void)rmdir(dirname);
+       (void)stress_filename_tidy(dirname);
 
        return rc;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.15/stress-getdent.c 
new/stress-ng-0.09.16/stress-getdent.c
--- old/stress-ng-0.09.15/stress-getdent.c      2018-02-03 16:21:38.000000000 
+0100
+++ new/stress-ng-0.09.16/stress-getdent.c      2018-02-15 18:41:52.000000000 
+0100
@@ -130,9 +130,7 @@
                        struct shim_linux_dirent *d = (struct shim_linux_dirent 
*)ptr;
                        unsigned char d_type = *(ptr + d->d_reclen - 1);
 
-                       if (d_type == DT_DIR &&
-                           strcmp(d->d_name, ".") &&
-                           strcmp(d->d_name, "..")) {
+                       if (d_type == DT_DIR && is_dot_filename(d->d_name)) {
                                char newpath[PATH_MAX];
 
                                (void)snprintf(newpath, sizeof(newpath), 
"%s/%s", path, d->d_name);
@@ -200,9 +198,7 @@
                while (ptr < buf + nread) {
                        struct shim_linux_dirent64 *d = (struct 
shim_linux_dirent64 *)ptr;
 
-                       if (d->d_type == DT_DIR &&
-                           strcmp(d->d_name, ".") &&
-                           strcmp(d->d_name, "..")) {
+                       if (d->d_type == DT_DIR && is_dot_filename(d->d_name)) {
                                char newpath[PATH_MAX];
 
                                (void)snprintf(newpath, sizeof(newpath), 
"%s/%s", path, d->d_name);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.15/stress-handle.c 
new/stress-ng-0.09.16/stress-handle.c
--- old/stress-ng-0.09.15/stress-handle.c       2018-02-03 16:21:38.000000000 
+0100
+++ new/stress-ng-0.09.16/stress-handle.c       2018-02-15 18:41:52.000000000 
+0100
@@ -99,73 +99,128 @@
 int stress_handle(const args_t *args)
 {
        int mounts;
+       pid_t pid;
 
        if ((mounts = get_mount_info(args)) < 0) {
                pr_fail("%s: failed to parse /proc/self/mountinfo\n", 
args->name);
                return EXIT_FAILURE;
        }
 
-       do {
-               struct file_handle *fhp, *tmp;
-               int mount_id, mount_fd, fd, i;
-
-               if ((fhp = malloc(sizeof(*fhp))) == NULL)
-                       continue;
-
-               fhp->handle_bytes = 0;
-               if ((name_to_handle_at(AT_FDCWD, FILENAME, fhp, &mount_id, 0) 
!= -1) &&
-                   (errno != EOVERFLOW)) {
-                       pr_fail_err("name_to_handle_at: failed to get file 
handle size");
-                       free(fhp);
-                       break;
-               }
-               tmp = realloc(fhp, sizeof(struct file_handle) + 
fhp->handle_bytes);
-               if (tmp == NULL) {
-                       free(fhp);
-                       continue;
-               }
-               fhp = tmp;
-               if (name_to_handle_at(AT_FDCWD, FILENAME, fhp, &mount_id, 0) < 
0) {
-                       pr_fail_err("name_to_handle_at: failed to get file 
handle");
-                       free(fhp);
-                       break;
+again:
+       if (!g_keep_stressing_flag)
+               goto tidy;
+       pid = fork();
+       if (pid < 0) {
+               if (errno == EAGAIN)
+                       goto again;
+               pr_err("%s: fork failed: errno=%d: (%s)\n",
+                       args->name, errno, strerror(errno));
+       } else if (pid > 0) {
+               int status, ret;
+
+               (void)setpgid(pid, g_pgrp);
+               /* Parent, wait for child */
+               ret = waitpid(pid, &status, 0);
+               if (ret < 0) {
+                       if (errno != EINTR)
+                               pr_dbg("%s: waitpid(): errno=%d (%s)\n",
+                                       args->name, errno, strerror(errno));
+                       (void)kill(pid, SIGTERM);
+                       (void)kill(pid, SIGKILL);
+                       (void)waitpid(pid, &status, 0);
+               } else if (WIFSIGNALED(status)) {
+                       pr_dbg("%s: child died: %s (instance %d)\n",
+                               args->name, stress_strsignal(WTERMSIG(status)),
+                               args->instance);
+                       /* If we got killed by OOM killer, re-start */
+                       if (WTERMSIG(status) == SIGKILL) {
+                               if (g_opt_flags & OPT_FLAGS_OOMABLE) {
+                                       log_system_mem_info();
+                                       pr_dbg("%s: assuming killed by OOM "
+                                               "killer, bailing out "
+                                               "(instance %d)\n",
+                                               args->name, args->instance);
+                                       _exit(0);
+                               } else {
+                                       log_system_mem_info();
+                                       pr_dbg("%s: assuming killed by OOM "
+                                               "killer, restarting again "
+                                               "(instance %d)\n",
+                                               args->name, args->instance);
+                                       goto again;
+                               }
+                       }
                }
-
-               mount_fd = -2;
-               for (i = 0; i < mounts; i++) {
-                       if (mount_info[i].mount_id == mount_id) {
-                               mount_fd = open(mount_info[i].mount_path, 
O_RDONLY);
+       } else if (pid == 0) {
+               (void)setpgid(0, g_pgrp);
+               stress_parent_died_alarm();
+
+               /* Make sure this is killable by OOM killer */
+               set_oom_adjustment(args->name, true);
+
+               do {
+                       struct file_handle *fhp, *tmp;
+                       int mount_id, mount_fd, fd, i;
+
+                       if ((fhp = malloc(sizeof(*fhp))) == NULL)
+                               continue;
+
+                       fhp->handle_bytes = 0;
+                       if ((name_to_handle_at(AT_FDCWD, FILENAME, fhp, 
&mount_id, 0) != -1) &&
+                           (errno != EOVERFLOW)) {
+                               pr_fail_err("name_to_handle_at: failed to get 
file handle size");
+                               free(fhp);
                                break;
                        }
-               }
-               if (mount_fd == -2) {
-                       pr_fail("%s: cannot find mount id %d\n", args->name, 
mount_id);
-                       free(fhp);
-                       break;
-               }
-               if (mount_fd < 0) {
-                       pr_fail("%s: failed to open mount path '%s': errno=%d 
(%s)\n",
-                               args->name, mount_info[i].mount_path, errno, 
strerror(errno));
-                       free(fhp);
-                       break;
-               }
-               if ((fd = open_by_handle_at(mount_fd, fhp, O_RDONLY)) < 0) {
-                       /* We don't abort if EPERM occurs, that's not a test 
failure */
-                       if (errno != EPERM) {
-                               pr_fail("%s: open_by_handle_at: failed to open: 
errno=%d (%s)\n",
-                                       args->name, errno, strerror(errno));
-                               (void)close(mount_fd);
+                       tmp = realloc(fhp, sizeof(struct file_handle) + 
fhp->handle_bytes);
+                       if (tmp == NULL) {
+                               free(fhp);
+                               continue;
+                       }
+                       fhp = tmp;
+                       if (name_to_handle_at(AT_FDCWD, FILENAME, fhp, 
&mount_id, 0) < 0) {
+                               pr_fail_err("name_to_handle_at: failed to get 
file handle");
                                free(fhp);
                                break;
                        }
-               } else {
-                       (void)close(fd);
-               }
-               (void)close(mount_fd);
-               free(fhp);
-               inc_counter(args);
-       } while (keep_stressing());
 
+                       mount_fd = -2;
+                       for (i = 0; i < mounts; i++) {
+                               if (mount_info[i].mount_id == mount_id) {
+                                       mount_fd = 
open(mount_info[i].mount_path, O_RDONLY);
+                                       break;
+                               }
+                       }
+                       if (mount_fd == -2) {
+                               pr_fail("%s: cannot find mount id %d\n", 
args->name, mount_id);
+                               free(fhp);
+                               break;
+                       }
+                       if (mount_fd < 0) {
+                               pr_fail("%s: failed to open mount path '%s': 
errno=%d (%s)\n",
+                                       args->name, mount_info[i].mount_path, 
errno, strerror(errno));
+                               free(fhp);
+                               break;
+                       }
+                       if ((fd = open_by_handle_at(mount_fd, fhp, O_RDONLY)) < 
0) {
+                               /* We don't abort if EPERM occurs, that's not a 
test failure */
+                               if (errno != EPERM) {
+                                       pr_fail("%s: open_by_handle_at: failed 
to open: errno=%d (%s)\n",
+                                               args->name, errno, 
strerror(errno));
+                                       (void)close(mount_fd);
+                                       free(fhp);
+                                       break;
+                               }
+                       } else {
+                               (void)close(fd);
+                       }
+                       (void)close(mount_fd);
+                       free(fhp);
+                       inc_counter(args);
+               } while (keep_stressing());
+               _exit(EXIT_SUCCESS);
+       }
+tidy:
        free_mount_info(mounts);
 
        return EXIT_SUCCESS;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.15/stress-inotify.c 
new/stress-ng-0.09.16/stress-inotify.c
--- old/stress-ng-0.09.15/stress-inotify.c      2018-02-03 16:21:38.000000000 
+0100
+++ new/stress-ng-0.09.16/stress-inotify.c      2018-02-15 18:41:52.000000000 
+0100
@@ -203,10 +203,8 @@
                while ((d = readdir(dp)) != NULL) {
                        char filename[PATH_MAX];
 
-                       if (!strcmp(d->d_name, ".") ||
-                           !strcmp(d->d_name, ".."))
+                       if (is_dot_filename(d->d_name))
                                continue;
-
                        (void)snprintf(filename, sizeof(filename), "%s/%s",
                                path, d->d_name);
                        (void)rm_file(args, filename);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.15/stress-ng.c 
new/stress-ng-0.09.16/stress-ng.c
--- old/stress-ng-0.09.15/stress-ng.c   2018-02-03 16:21:38.000000000 +0100
+++ new/stress-ng-0.09.16/stress-ng.c   2018-02-15 18:41:52.000000000 +0100
@@ -1918,8 +1918,10 @@
 
        /* multiple calls will always fallback to SIGKILL */
        count++;
-       if (count > 5)
+       if (count > 5) {
+               pr_dbg("killing process group %d with SIGKILL\n", (int)g_pgrp);
                signum = SIGKILL;
+       }
 
        (void)killpg(g_pgrp, sig);
 
@@ -2042,16 +2044,16 @@
 #if NEED_GLIBC(2,1,0)
                                                const char *signame = 
strsignal(WTERMSIG(status));
 
-                                               pr_dbg("process %d 
(stress-ng-%s) terminated on signal: %d (%s)\n",
+                                               pr_dbg("process [%d] 
(stress-ng-%s) terminated on signal: %d (%s)\n",
                                                        ret, pi->stressor->name,
                                                        WTERMSIG(status), 
signame);
 #else
-                                               pr_dbg("process %d 
(stress-ng-%s) terminated on signal: %d\n",
+                                               pr_dbg("process [%d] 
(stress-ng-%s) terminated on signal: %d\n",
                                                        ret, pi->stressor->name,
                                                        WTERMSIG(status));
 #endif
 #else
-                                               pr_dbg("process %d 
(stress-ng-%s) terminated on signal\n",
+                                               pr_dbg("process [%d] 
(stress-ng-%s) terminated on signal\n",
                                                        ret, 
pi->stressor->name);
 #endif
                                                *success = false;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.15/stress-ng.h 
new/stress-ng-0.09.16/stress-ng.h
--- old/stress-ng-0.09.15/stress-ng.h   2018-02-03 16:21:38.000000000 +0100
+++ new/stress-ng-0.09.16/stress-ng.h   2018-02-15 18:41:52.000000000 +0100
@@ -2520,6 +2520,7 @@
 extern WARN_UNUSED uint64_t stress_get_filesystem_available_inodes(void);
 extern char *stress_uint64_to_str(char *str, size_t len, const uint64_t val);
 extern WARN_UNUSED int stress_drop_capabilities(const char *name);
+extern WARN_UNUSED bool is_dot_filename(const char *name);
 
 /*
  *  Indicate a stress test failed because of limited resources
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.15/stress-procfs.c 
new/stress-ng-0.09.16/stress-procfs.c
--- old/stress-ng-0.09.15/stress-procfs.c       2018-02-03 16:21:38.000000000 
+0100
+++ new/stress-ng-0.09.16/stress-procfs.c       2018-02-15 18:41:52.000000000 
+0100
@@ -234,8 +234,7 @@
 
                if (!g_keep_stressing_flag)
                        break;
-               if (!strcmp(d->d_name, ".") ||
-                   !strcmp(d->d_name, ".."))
+               if (is_dot_filename(d->d_name))
                        continue;
                switch (d->d_type) {
                case DT_DIR:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.15/stress-sysfs.c 
new/stress-ng-0.09.16/stress-sysfs.c
--- old/stress-ng-0.09.15/stress-sysfs.c        2018-02-03 16:21:38.000000000 
+0100
+++ new/stress-ng-0.09.16/stress-sysfs.c        2018-02-15 18:41:52.000000000 
+0100
@@ -222,8 +222,7 @@
 
                if (!keep_stressing())
                        break;
-               if (!strcmp(d->d_name, ".") ||
-                   !strcmp(d->d_name, ".."))
+               if (is_dot_filename(d->d_name))
                        continue;
                switch (d->d_type) {
                case DT_DIR:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.09.15/stress-vecmath.c 
new/stress-ng-0.09.16/stress-vecmath.c
--- old/stress-ng-0.09.15/stress-vecmath.c      2018-02-03 16:21:38.000000000 
+0100
+++ new/stress-ng-0.09.16/stress-vecmath.c      2018-02-15 18:41:52.000000000 
+0100
@@ -24,6 +24,18 @@
  */
 #include "stress-ng.h"
 
+/*
+ *  Clang 5.0 is the lowest version of clang that
+ *  can build this without issues (clang 4.0 seems
+ *  to spend forever optimizing this and causes the build
+ *  to never complete)
+ */
+#if defined(__clang__) && \
+    defined(__clang_major__) && \
+    __clang_major__ < 5
+#undef HAVE_VECMATH
+#endif
+
 #if defined(HAVE_VECMATH)
 
 typedef int8_t  vint8_t  __attribute__ ((vector_size (16)));


Reply via email to