diff options
author | Mike Kravetz <[email protected]> | 2016-06-24 14:48:40 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2016-06-24 17:23:52 -0700 |
commit | a7b50abc90afb2e3c27e1bd212643cc53eaf0b60 (patch) | |
tree | f077b8755dc655d1d95f4ad44d425cc2d92fdb4c | |
parent | 9df10fb7b80bc2f540956ba01b5e7ee1012001a5 (diff) |
selftests/vm/compaction_test: fix write to restore nr_hugepages
The write at the end of the test to restore nr_hugepages to its previous
value is failing. This is because it is trying to write the number of
bytes in the char array as opposed to the number of bytes in the string.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Mike Kravetz <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Sri Jayaramappa <[email protected]>
Cc: Eric B Munson <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | tools/testing/selftests/vm/compaction_test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c index 932ff577ffc0..00c4f65d12da 100644 --- a/tools/testing/selftests/vm/compaction_test.c +++ b/tools/testing/selftests/vm/compaction_test.c @@ -136,7 +136,7 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size) printf("No of huge pages allocated = %d\n", (atoi(nr_hugepages))); - if (write(fd, initial_nr_hugepages, sizeof(initial_nr_hugepages)) + if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages)) != strlen(initial_nr_hugepages)) { perror("Failed to write to /proc/sys/vm/nr_hugepages\n"); goto close_fd; |