[-mm] proc: fixup read test even more
diff mbox series

Message ID 20180317164911.GA3445@avx2
State New, archived
Headers show
Series
  • [-mm] proc: fixup read test even more
Related show

Commit Message

Alexey Dobriyan March 17, 2018, 4:49 p.m. UTC
/proc/sysrq-trigger lives on the ground floor so to speak.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

	FOLD INTO proc-shotgun-test-read-readdir-readlink-a-little-write-fix.patch

 tools/testing/selftests/proc/read.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch
diff mbox series

--- a/tools/testing/selftests/proc/read.c
+++ b/tools/testing/selftests/proc/read.c
@@ -106,10 +106,10 @@  static void f(DIR *d, unsigned int level)
 			int fd;
 
 		case DT_REG:
-			if (level == 1 && streq(de->d_name, "clear_refs")) {
-				f_reg_write(d, de->d_name, "1", 1);
-			} else if (level == 1 && streq(de->d_name, "sysrq-trigger")) {
+			if (level == 0 && streq(de->d_name, "sysrq-trigger")) {
 				f_reg_write(d, de->d_name, "h", 1);
+			} else if (level == 1 && streq(de->d_name, "clear_refs")) {
+				f_reg_write(d, de->d_name, "1", 1);
 			} else if (level == 3 && streq(de->d_name, "clear_refs")) {
 				f_reg_write(d, de->d_name, "1", 1);
 			} else {