lkml.org 
[lkml]   [2015]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/2] mm: fixup_userfault returns VM_FAULT_RETRY if asked
    On Thu, Nov 19, 2015 at 12:49:57AM +0100, Dominik Dingel wrote:
    > When calling fixup_userfault with FAULT_FLAG_ALLOW_RETRY, fixup_userfault
    > didn't care about VM_FAULT_RETRY and returned 0. If the VM_FAULT_RETRY flag is
    > set we will return the complete result of handle_mm_fault.
    >
    > Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
    > ---
    > mm/gup.c | 2 ++
    > 1 file changed, 2 insertions(+)
    >
    > diff --git a/mm/gup.c b/mm/gup.c
    > index deafa2c..2af3b31 100644
    > --- a/mm/gup.c
    > +++ b/mm/gup.c
    > @@ -609,6 +609,8 @@ int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
    > return -EFAULT;
    > BUG();
    > }
    > + if (ret & VM_FAULT_RETRY)
    > + return ret;

    Nope. fixup_user_fault() return errno, not VM_FAULT_* mask.

    I guess it should be
    return -EBUSY;

    > if (tsk) {
    > if (ret & VM_FAULT_MAJOR)
    > tsk->maj_flt++;
    > --
    > 2.3.9
    >

    --
    Kirill A. Shutemov


    \
     
     \ /
      Last update: 2015-11-19 01:21    [W:2.873 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site