lkml.org 
[lkml]   [2021]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] kvm/eventfd: fix the misleading comment in kvm_irqfd_assign
From


Am 29.11.21 um 04:43 schrieb Longpeng(Mike):
> From: Longpeng <longpeng2@huawei.com>
>
> The comment above the invocation of vfs_poll() is misleading, move
> it to the right place.
>
I think that the current variant is better.
events is only used in that function to check for EPOLLIN, so the
assignment and the if belong together from a "what am I doing here" perspective.

> Fixes: 684a0b719ddb ("KVM: eventfd: Fix lock order inversion")
> Signed-off-by: Longpeng <longpeng2@huawei.com>
> ---
> virt/kvm/eventfd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
> index 2ad013b..cd01814 100644
> --- a/virt/kvm/eventfd.c
> +++ b/virt/kvm/eventfd.c
> @@ -406,12 +406,12 @@ bool __attribute__((weak)) kvm_arch_irqfd_route_changed(
>
> spin_unlock_irq(&kvm->irqfds.lock);
>
> + events = vfs_poll(f.file, &irqfd->pt);
> +
> /*
> * Check if there was an event already pending on the eventfd
> * before we registered, and trigger it as if we didn't miss it.
> */
> - events = vfs_poll(f.file, &irqfd->pt);
> -
> if (events & EPOLLIN)
> schedule_work(&irqfd->inject);
>

\
 
 \ /
  Last update: 2021-11-29 18:16    [W:0.047 / U:3.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site