linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] mm: correct status code which move_pages() returns for zero page
@ 2018-04-17 11:06 Li Wang
  2018-04-17 13:03 ` Michal Hocko
  0 siblings, 1 reply; 11+ messages in thread
From: Li Wang @ 2018-04-17 11:06 UTC (permalink / raw)
  To: mhocko; +Cc: linux-mm, ltp, Kirill A . Shutemov, Zi Yan

move_pages(2) declears that status code for zero page is supposed to
be -EFAULT. But now it (LTP/move_pages04 test) gets -EPERM, the root
cause is that not goto out_flush after store_status() saves the err
which add_page_for_migration() returns for zero page.

LTP move_pages04:
   TFAIL  :  move_pages04.c:143: status[1] is EPERM, expected EFAULT

Signed-off-by: Li Wang <liwang@redhat.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Zi Yan <zi.yan@cs.rutgers.edu>
---
 mm/migrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index f65dd69..2b315fc 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1608,7 +1608,7 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes,
 			continue;
 
 		err = store_status(status, i, err, 1);
-		if (err)
+		if (!err)
 			goto out_flush;
 
 		err = do_move_pages_to_node(mm, &pagelist, current_node);
-- 
2.9.5

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-04-18 11:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-17 11:06 [RFC PATCH] mm: correct status code which move_pages() returns for zero page Li Wang
2018-04-17 13:03 ` Michal Hocko
2018-04-17 14:14   ` Michal Hocko
2018-04-17 14:28     ` Li Wang
2018-04-17 19:00       ` Michal Hocko
2018-04-17 20:09         ` Zi Yan
2018-04-18  9:07           ` Michal Hocko
2018-04-18  9:19             ` Michal Hocko
2018-04-18 10:39               ` Li Wang
2018-04-18 11:29                 ` Michal Hocko
2018-04-18 11:46                   ` Li Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox