+ proc-more-robust-bulk-read-test.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: proc: more robust bulk read test
has been added to the -mm tree.  Its filename is
     proc-more-robust-bulk-read-test.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/proc-more-robust-bulk-read-test.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/proc-more-robust-bulk-read-test.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Alexey Dobriyan <adobriyan@xxxxxxxxx>
Subject: proc: more robust bulk read test

/proc may not be mounted and test will exit successfully.

Ensure proc is mounted at /proc.

Link: http://lkml.kernel.org/r/20190209105613.GA10384@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 tools/testing/selftests/proc/read.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

--- a/tools/testing/selftests/proc/read.c~proc-more-robust-bulk-read-test
+++ a/tools/testing/selftests/proc/read.c
@@ -26,8 +26,10 @@
 #include <dirent.h>
 #include <stdbool.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
 #include <sys/stat.h>
+#include <sys/vfs.h>
 #include <fcntl.h>
 #include <unistd.h>
 
@@ -123,10 +125,22 @@ static void f(DIR *d, unsigned int level
 int main(void)
 {
 	DIR *d;
+	struct statfs sfs;
 
 	d = opendir("/proc");
 	if (!d)
 		return 4;
+
+	/* Ensure /proc is proc. */
+	if (fstatfs(dirfd(d), &sfs) == -1) {
+		return 1;
+	}
+	if (sfs.f_type != 0x9fa0) {
+		fprintf(stderr, "error: unexpected f_type %lx\n", (long)sfs.f_type);
+		return 2;
+	}
+
 	f(d, 0);
+
 	return 0;
 }
_

Patches currently in -mm which might be from adobriyan@xxxxxxxxx are

ramfs-support-o_tmpfile.patch
mm-shuffle-gfp_-flags.patch
numa-make-nr_node_ids-unsigned-int.patch
numa-make-nr_online_nodes-unsigned-int.patch
proc-return-exit-code-4-for-skipped-tests.patch
proc-read-kernel-cpu-stat-pointer-once.patch
proc-use-seq_puts-everywhere.patch
proc-test-proc-maps-smaps-smaps_rollup-statm.patch
proc-test-proc-maps-smaps-smaps_rollup-statm-fix.patch
proc-more-robust-bulk-read-test.patch
elf-dont-be-afraid-of-overflow.patch
elf-use-list_for_each_entry.patch
elf-use-list_for_each_entry-fix.patch
elf-spread-const-a-little.patch
proc-calculate-end-pointer-for-proc-lookup-at-compile-time.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux