diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-09 03:02:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-09 03:02:35 -0400 |
commit | 1236d6bb6e19fc72ffc6bbcdeb1bfefe450e54ee (patch) | |
tree | 47da3feee8e263e8c9352c85cf518e624be3c211 /mm/madvise.c | |
parent | 750b1a6894ecc9b178c6e3d0a1170122971b2036 (diff) | |
parent | 8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff) |
Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/madvise.c')
-rw-r--r-- | mm/madvise.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mm/madvise.c b/mm/madvise.c index 21261ff0466f..25bade36e9ca 100644 --- a/mm/madvise.c +++ b/mm/madvise.c | |||
@@ -625,18 +625,26 @@ static int madvise_inject_error(int behavior, | |||
625 | { | 625 | { |
626 | struct page *page; | 626 | struct page *page; |
627 | struct zone *zone; | 627 | struct zone *zone; |
628 | unsigned int order; | ||
628 | 629 | ||
629 | if (!capable(CAP_SYS_ADMIN)) | 630 | if (!capable(CAP_SYS_ADMIN)) |
630 | return -EPERM; | 631 | return -EPERM; |
631 | 632 | ||
632 | for (; start < end; start += PAGE_SIZE << | 633 | |
633 | compound_order(compound_head(page))) { | 634 | for (; start < end; start += PAGE_SIZE << order) { |
634 | int ret; | 635 | int ret; |
635 | 636 | ||
636 | ret = get_user_pages_fast(start, 1, 0, &page); | 637 | ret = get_user_pages_fast(start, 1, 0, &page); |
637 | if (ret != 1) | 638 | if (ret != 1) |
638 | return ret; | 639 | return ret; |
639 | 640 | ||
641 | /* | ||
642 | * When soft offlining hugepages, after migrating the page | ||
643 | * we dissolve it, therefore in the second loop "page" will | ||
644 | * no longer be a compound page, and order will be 0. | ||
645 | */ | ||
646 | order = compound_order(compound_head(page)); | ||
647 | |||
640 | if (PageHWPoison(page)) { | 648 | if (PageHWPoison(page)) { |
641 | put_page(page); | 649 | put_page(page); |
642 | continue; | 650 | continue; |