Skip to contentSkip to conversation

selftests: make use of GUP_TEST_FILE macro

PATCH Applied Joel Savitz 3 participants 4 messages Jun 9, 2022 – Jun 16, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: make use of GUP_TEST_FILE macro

Commit 17de1e559cf1 ("selftests: clarify common error when running gup_test") had most of its hunks dropped due to a conflict with another patch accepted into Linux around the same time that implemented the same behavior as a subset of other changes.

However, the remaining hunk defines the GUP_TEST_FILE macro without making use of it. This patch makes use of the macro in the two relevant places.

Furthermore, the above mentioned commit's log message erroneously describes the changes that were dropped from the patch.

This patch corrects the record.

Fixes 17de1e559cf1 ("selftests: clarify common error when running gup_test")
---
 tools/testing/selftests/vm/gup_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/vm/gup_test.c +2 -2
index 6bb36ca71cb5..a309876d832f 100644
@@ -209,7 +209,7 @@ int main(int argc, char **argv)
 	if (write)
 		gup.gup_flags |= FOLL_WRITE;
 
-	gup_fd = open("/sys/kernel/debug/gup_test", O_RDWR);
+	gup_fd = open(GUP_TEST_FILE, O_RDWR);
 	if (gup_fd == -1) {
 		switch (errno) {
 		case EACCES:
@@ -224,7 +224,7 @@ int main(int argc, char **argv)
 			printf("check if CONFIG_GUP_TEST is enabled in kernel config\n");
 			break;
 		default:
-			perror("failed to open /sys/kernel/debug/gup_test");
+			perror("failed to open " GUP_TEST_FILE);
 			break;
 		}
 		exit(KSFT_SKIP);
Signature · 1 line
2.31.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 36 lines · Joel Savitz

Commit 17de1e559cf1 ("selftests: clarify common error when running gup_test") had most of its hunks dropped due to a conflict with another patch accepted into Linux around the same time that implemented the same behavior as a subset of other changes.

However, the remaining hunk defines the GUP_TEST_FILE macro without making use of it. This patch makes use of the macro in the two relevant places.

Furthermore, the above mentioned commit's log message erroneously describes the changes that were dropped from the patch.

This patch corrects the record.

Fixes 17de1e559cf1 ("selftests: clarify common error when running gup_test")
---
  tools/testing/selftests/vm/gup_test.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/vm/gup_test.c +1 -1
index 6bb36ca71cb5..a309876d832f 100644
@@ -209,7 +209,7 @@ int main(int argc, char **argv)
  	if (write)
  		gup.gup_flags |= FOLL_WRITE;
 
-	gup_fd = open("/sys/kernel/debug/gup_test", O_RDWR);
+	gup_fd = open(GUP_TEST_FILE, O_RDWR);
  	if (gup_fd == -1) {
  		switch (errno) {
  		case EACCES:

tools/testing/selftests/vm/gup_test.c int main(int argc, char **argv) · line 230

Quoted 8 lines
tools/testing/selftests/vm/gup_test.c +1 -1
@@ -224,7 +224,7 @@ int main(int argc, char **argv)
  			printf("check if CONFIG_GUP_TEST is enabled in kernel config\n");
  			break;
  		default:
-			perror("failed to open /sys/kernel/debug/gup_test");
+			perror("failed to open " GUP_TEST_FILE);
  			break;
  		}
  		exit(KSFT_SKIP);

Thank you for finding and fixing the problem.

thanks,
-- Shuah

Acked-by on v1 1/1
#2 lore raw
In reply to Joel Savitz

LGTM! Good catch :)

Quoted 47 lines · Joel Savitz

Commit 17de1e559cf1 ("selftests: clarify common error when running gup_test") had most of its hunks dropped due to a conflict with another patch accepted into Linux around the same time that implemented the same behavior as a subset of other changes.

However, the remaining hunk defines the GUP_TEST_FILE macro without making use of it. This patch makes use of the macro in the two relevant places.

Furthermore, the above mentioned commit's log message erroneously describes the changes that were dropped from the patch.

This patch corrects the record.

Fixes 17de1e559cf1 ("selftests: clarify common error when running gup_test")
---
 tools/testing/selftests/vm/gup_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/vm/gup_test.c +2 -3
index 6bb36ca71cb5..a309876d832f 100644
@@ -209,7 +209,7 @@ int main(int argc, char **argv)
        if (write)
                gup.gup_flags |= FOLL_WRITE;
 
-       gup_fd = open("/sys/kernel/debug/gup_test", O_RDWR);
+       gup_fd = open(GUP_TEST_FILE, O_RDWR);
        if (gup_fd == -1) {
                switch (errno) {
                case EACCES:
@@ -224,7 +224,7 @@ int main(int argc, char **argv)
                        printf("check if CONFIG_GUP_TEST is enabled in kernel config\n");
                        break;
                default:
-                       perror("failed to open /sys/kernel/debug/gup_test");
+                       perror("failed to open " GUP_TEST_FILE);
                        break;
                }
                exit(KSFT_SKIP);
--

2.31.1

maintainer
#3 lore raw
Quoted 24 lines · Nico Pache

LGTM! Good catch :)

Quoted 19 lines · Joel Savitz

Commit 17de1e559cf1 ("selftests: clarify common error when running gup_test") had most of its hunks dropped due to a conflict with another patch accepted into Linux around the same time that implemented the same behavior as a subset of other changes.

However, the remaining hunk defines the GUP_TEST_FILE macro without making use of it. This patch makes use of the macro in the two relevant places.

Furthermore, the above mentioned commit's log message erroneously describes the changes that were dropped from the patch.

This patch corrects the record.

Fixes 17de1e559cf1 ("selftests: clarify common error when running gup_test")

---

Applied to linux-kselftest fixes for next rc

thanks,
-- Shuah