kvm: Fix kvm_get_page_retry_io __gup retval check
PATCH 1/1 kvm: Fix kvm_get_page_retry_io __gup retval check
Confusion around -EBUSY and zero (inside a BUG_ON no less).
Reported-by AndreA Arcangeli <[email protected]>
Signed-off-by Andres Lagar-Cavilla <[email protected]>
--- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
virt/kvm/kvm_main.c +1 -1
@@ -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 ;
Signature · 1 line
2.1.0.rc2.206.gedb03e5
Quoted 7 lines · Andres Lagar-Cavilla
Confusion around
-EBUSYand zero (inside aBUG_ONno less).Reported-by AndreA Arcangeli <[email protected]>Signed-off-by Andres Lagar-Cavilla <[email protected]>--- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Andrea Arcangeli <[email protected]>
Valid for this and the previous patch in Message-Id:
<[email protected]> as well.
Thanks,
Andrea
Quoted 17 lines
virt/kvm/kvm_main.c +1
-1@@ -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 ;Signature · 1 line
2.1.0.rc2.206.gedb03e5
Il 26/09/2014 00:26, Andres Lagar-Cavilla ha scritto:
Quoted 14 lines
Confusion around
-EBUSYand zero (inside aBUG_ONno less).Reported-by AndreA Arcangeli <[email protected]>Signed-off-by Andres Lagar-Cavilla <[email protected]>--- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)virt/kvm/kvm_main.c +0
-0
virt/kvm/kvm_main.c int kvm_get_user_page_io(struct task_struct *tsk, struct mm_struct *mm, · line 1152
Quoted 8 lines
virt/kvm/kvm_main.c +1
-1@@ -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