[PATCH] mm: allow unmapped hole at head side of mbind range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Li Xinhai  <xinhai.li@xxxxxxxxxxx>

mbind_range silently ignore unmapped hole at middle and tail of the 
specified range, but report EFAULT if hole at head side.
It is more reasonable to support silently ignore holes at any part of 
the range, only report EFAULT if the whole range is in hole.

Signed-off-by: Li Xinhai <xinhai.li@xxxxxxxxxxx>
---

 mm/mempolicy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 4ae967bcf954..ae160d9936d9 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -738,7 +738,7 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
        unsigned long vmend;
 
        vma = find_vma(mm, start);
-       if (!vma || vma->vm_start > start)
+       if (!vma || vma->vm_start >= end)
                return -EFAULT;
 
        prev = vma->vm_prev;





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux