linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: allow unmapped hole at head side of mbind range
@ 2019-10-24  7:35 Li Xinhai
  2019-10-24 10:48 ` Vlastimil Babka
  2019-10-24 12:25 ` Michal Hocko
  0 siblings, 2 replies; 5+ messages in thread
From: Li Xinhai @ 2019-10-24  7:35 UTC (permalink / raw)
  To: linux-mm, linux-kernel

From: Li Xinhai  <xinhai.li@outlook.com>

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@outlook.com>
---

 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;


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

end of thread, other threads:[~2019-10-28  8:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-24  7:35 [PATCH] mm: allow unmapped hole at head side of mbind range Li Xinhai
2019-10-24 10:48 ` Vlastimil Babka
2019-10-25  2:32   ` Hugh Dickins
2019-10-28  8:12     ` lixinhai.lxh
2019-10-24 12:25 ` Michal Hocko

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