From: Jan Stancek <jstancek@redhat.com>
To: ltp-list@lists.sourceforge.net
Cc: Jeffrey Burke <jburke@redhat.com>
Subject: [LTP] [PATCH] move_pages09: move_pages returns 0 if nothing got migrated
Date: Wed, 09 May 2012 11:11:48 +0200 [thread overview]
Message-ID: <4FAA34D4.5000706@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 559 bytes --]
Following commit changed the behavior to return 0 when no pages
require migration.
commit e78bbfa8262424417a29349a8064a535053912b9
Author: Brice Goglin <Brice.Goglin@inria.fr>
Date: Sat Oct 18 20:27:15 2008 -0700
mm: stop returning -ENOENT from sys_move_pages() if nothing got
migrated
So testing for ENOENT in move_pages09, makes sense only for
kernel < 2.6.28.
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
.../kernel/syscalls/move_pages/move_pages09.c | 29 +++++++++++++++-----
1 files changed, 22 insertions(+), 7 deletions(-)
[-- Attachment #2: 0002-move_pages09-move_pages-returns-0-if-nothing-got-mig.patch --]
[-- Type: text/x-patch, Size: 1431 bytes --]
diff --git a/testcases/kernel/syscalls/move_pages/move_pages09.c b/testcases/kernel/syscalls/move_pages/move_pages09.c
index 4cedb6a..e00fcca 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages09.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages09.c
@@ -105,12 +105,27 @@ int main(int argc, char **argv)
ret = numa_move_pages(0, TEST_PAGES, pages, nodes,
status, MPOL_MF_MOVE);
TEST_ERRNO = errno;
- if (ret == -1 && errno == ENOENT)
- tst_resm(TPASS, "move_pages failed with "
- "ENOENT as expected");
- else
- tst_resm(TFAIL, "move pages did not fail "
- "with ENOENT");
+
+ /*
+ * commit e78bbfa8262424417a29349a8064a535053912b9
+ * Author: Brice Goglin <Brice.Goglin@inria.fr>
+ * Date: Sat Oct 18 20:27:15 2008 -0700
+ * mm: stop returning -ENOENT from sys_move_pages() if nothing got migrated
+ */
+ if ((tst_kvercmp(2, 6, 28)) >= 0) {
+ if (ret == 0)
+ tst_resm(TPASS, "move_pages succeeded");
+ else
+ tst_resm(TFAIL, "move_pages failed with: %s",
+ strerror(TEST_ERRNO));
+ } else {
+ if (ret == -1 && errno == ENOENT)
+ tst_resm(TPASS, "move_pages failed with "
+ "ENOENT as expected");
+ else
+ tst_resm(TFAIL, "move_pages failed with: "
+ "%s", strerror(TEST_ERRNO));
+ }
free_pages(pages, TEST_PAGES);
}
@@ -150,4 +165,4 @@ void cleanup(void)
*/
TEST_CLEANUP;
- }
\ No newline at end of file
+ }
[-- Attachment #3: Type: text/plain, Size: 395 bytes --]
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
[-- Attachment #4: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next reply other threads:[~2012-05-09 9:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-09 9:11 Jan Stancek [this message]
2012-05-09 10:25 ` [LTP] [PATCH] move_pages09: move_pages returns 0 if nothing got migrated Caspar Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FAA34D4.5000706@redhat.com \
--to=jstancek@redhat.com \
--cc=jburke@redhat.com \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox