Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1272690 > unrolled thread

[PATCH 1/2] mm: fixup_userfault returns VM_FAULT_RETRY if asked

Started byDominik Dingel <dingel@linux.vnet.ibm.com>
First post2015-11-19 01:00 +0100
Last post2015-11-19 01:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2] mm: fixup_userfault returns VM_FAULT_RETRY if asked Dominik Dingel <dingel@linux.vnet.ibm.com> - 2015-11-19 01:00 +0100
    Re: [PATCH 1/2] mm: fixup_userfault returns VM_FAULT_RETRY if asked "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-11-19 01:20 +0100

#1272690 — [PATCH 1/2] mm: fixup_userfault returns VM_FAULT_RETRY if asked

FromDominik Dingel <dingel@linux.vnet.ibm.com>
Date2015-11-19 01:00 +0100
Subject[PATCH 1/2] mm: fixup_userfault returns VM_FAULT_RETRY if asked
Message-ID<qwkNQ-1An-9@gated-at.bofh.it>
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;
 	if (tsk) {
 		if (ret & VM_FAULT_MAJOR)
 			tsk->maj_flt++;
-- 
2.3.9

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1272707

From"Kirill A. Shutemov" <kirill@shutemov.name>
Date2015-11-19 01:20 +0100
Message-ID<qwl7c-1Xq-33@gated-at.bofh.it>
In reply to#1272690
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web