diff mbox

kvm: Fix kvm_get_page_retry_io __gup retval check

Message ID 1411684010-883-1-git-send-email-andreslc@google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andres Lagar-Cavilla Sept. 25, 2014, 10:26 p.m. UTC
Confusion around -EBUSY and zero (inside a BUG_ON no less).

Reported-by: AndreA Arcangeli <aarcange@redhat.com>
Signed-off-by: Andres Lagar-Cavilla <andreslc@google.com>
---
 virt/kvm/kvm_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrea Arcangeli Sept. 25, 2014, 10:34 p.m. UTC | #1
On Thu, Sep 25, 2014 at 03:26:50PM -0700, Andres Lagar-Cavilla wrote:
> Confusion around -EBUSY and zero (inside a BUG_ON no less).
> 
> Reported-by: AndreA Arcangeli <aarcange@redhat.com>
> Signed-off-by: Andres Lagar-Cavilla <andreslc@google.com>
> ---
>  virt/kvm/kvm_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>

Valid for this and the previous patch in Message-Id:
<1410976308-7683-1-git-send-email-andreslc@google.com> as well.

Thanks,
Andrea

> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 3f16f56..a1cf53e 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -1146,7 +1146,7 @@ int kvm_get_user_page_io(struct task_struct *tsk, struct mm_struct *mm,
>  	npages = __get_user_pages(tsk, mm, addr, 1, flags, pagep, NULL,
>  				  &locked);
>  	if (!locked) {
> -		VM_BUG_ON(npages != -EBUSY);
> +		VM_BUG_ON(npages);
>  
>  		if (!pagep)
>  			return 0;
> -- 
> 2.1.0.rc2.206.gedb03e5
> 
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paolo Bonzini Sept. 26, 2014, 8:22 a.m. UTC | #2
Il 26/09/2014 00:26, Andres Lagar-Cavilla ha scritto:
> Confusion around -EBUSY and zero (inside a BUG_ON no less).
> 
> Reported-by: AndreA Arcangeli <aarcange@redhat.com>
> Signed-off-by: Andres Lagar-Cavilla <andreslc@google.com>
> ---
>  virt/kvm/kvm_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 3f16f56..a1cf53e 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -1146,7 +1146,7 @@ int kvm_get_user_page_io(struct task_struct *tsk, struct mm_struct *mm,
>  	npages = __get_user_pages(tsk, mm, addr, 1, flags, pagep, NULL,
>  				  &locked);
>  	if (!locked) {
> -		VM_BUG_ON(npages != -EBUSY);
> +		VM_BUG_ON(npages);
>  
>  		if (!pagep)
>  			return 0;
> 

Thanks, applied.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 3f16f56..a1cf53e 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1146,7 +1146,7 @@  int kvm_get_user_page_io(struct task_struct *tsk, struct mm_struct *mm,
 	npages = __get_user_pages(tsk, mm, addr, 1, flags, pagep, NULL,
 				  &locked);
 	if (!locked) {
-		VM_BUG_ON(npages != -EBUSY);
+		VM_BUG_ON(npages);
 
 		if (!pagep)
 			return 0;