migrate_pages() would return positive value in some failure case,
so 'ret > 0 ? 0 : ret' may be wrong.
This fix it and remove one dead statement.

Signed-off-by: Joonsoo Kim <js1...@gmail.com>
Cc: Michal Nazarewicz <min...@mina86.com>
Cc: Marek Szyprowski <m.szyprow...@samsung.com>
Cc: Minchan Kim <minc...@kernel.org>
Cc: Christoph Lameter <c...@linux.com>

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4403009..02d4519 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5673,7 +5673,6 @@ static int __alloc_contig_migrate_range(unsigned long 
start, unsigned long end)
                        }
                        tries = 0;
                } else if (++tries == 5) {
-                       ret = ret < 0 ? ret : -EBUSY;
                        break;
                }
 
@@ -5683,7 +5682,7 @@ static int __alloc_contig_migrate_range(unsigned long 
start, unsigned long end)
        }
 
        putback_lru_pages(&cc.migratepages);
-       return ret > 0 ? 0 : ret;
+       return ret <= 0 ? ret : -EBUSY;
 }
 
 /*
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to