diff options
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r-- | mm/mempolicy.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 74310017296e..4baf12e534d1 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -732,7 +732,10 @@ static int mbind_range(struct mm_struct *mm, unsigned long start, | |||
732 | if (prev) { | 732 | if (prev) { |
733 | vma = prev; | 733 | vma = prev; |
734 | next = vma->vm_next; | 734 | next = vma->vm_next; |
735 | continue; | 735 | if (mpol_equal(vma_policy(vma), new_pol)) |
736 | continue; | ||
737 | /* vma_merge() joined vma && vma->next, case 8 */ | ||
738 | goto replace; | ||
736 | } | 739 | } |
737 | if (vma->vm_start != vmstart) { | 740 | if (vma->vm_start != vmstart) { |
738 | err = split_vma(vma->vm_mm, vma, vmstart, 1); | 741 | err = split_vma(vma->vm_mm, vma, vmstart, 1); |
@@ -744,6 +747,7 @@ static int mbind_range(struct mm_struct *mm, unsigned long start, | |||
744 | if (err) | 747 | if (err) |
745 | goto out; | 748 | goto out; |
746 | } | 749 | } |
750 | replace: | ||
747 | err = vma_replace_policy(vma, new_pol); | 751 | err = vma_replace_policy(vma, new_pol); |
748 | if (err) | 752 | if (err) |
749 | goto out; | 753 | goto out; |