From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Dexuan Cui <decui@microsoft.com>
Cc: KY Srinivasan <kys@microsoft.com>,
"gregkh\@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devel\@linuxdriverproject.org" <devel@linuxdriverproject.org>,
"olaf\@aepfle.de" <olaf@aepfle.de>,
"apw\@canonical.com" <apw@canonical.com>,
"jasowang\@redhat.com" <jasowang@redhat.com>
Subject: Re: [PATCH 1/3] Drivers: hv: utils: fix hvt_op_poll() return value on transport destroy
Date: Wed, 16 Dec 2015 11:19:00 +0100 [thread overview]
Message-ID: <877fkevgq3.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <ae031c6174194ce085d8beb82a032ae6@HKXPR3004MB0088.064d.mgd.msft.net> (Dexuan Cui's message of "Wed, 16 Dec 2015 06:37:19 +0000")
Dexuan Cui <decui@microsoft.com> writes:
>> From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On Behalf
>> Of K. Y. Srinivasan
>> Sent: Wednesday, December 16, 2015 8:27
>> To: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
>> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
>> vkuznets@redhat.com; jasowang@redhat.com
>> Subject: [PATCH 1/3] Drivers: hv: utils: fix hvt_op_poll() return value on transport
>> destroy
>>
>> From: Vitaly Kuznetsov <vkuznets@redhat.com>
>>
>> The return type of hvt_op_poll() is unsigned int and -EBADF is
>> inappropriate, poll functions return POLL* statuses.
>>
>> Reported-by: Dexuan Cui <decui@microsoft.com>
>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
>> ---
>> drivers/hv/hv_utils_transport.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv/hv_utils_transport.c
>> index ee20b50..4f42c0e 100644
>> --- a/drivers/hv/hv_utils_transport.c
>> +++ b/drivers/hv/hv_utils_transport.c
>> @@ -109,7 +109,7 @@ static unsigned int hvt_op_poll(struct file *file,
>> poll_table *wait)
>> poll_wait(file, &hvt->outmsg_q, wait);
>>
>> if (hvt->mode == HVUTIL_TRANSPORT_DESTROY)
>> - return -EBADF;
>> + return POLLERR | POLLHUP;
>>
>> if (hvt->outmsg_len > 0)
>> return POLLIN | POLLRDNORM;
>> --
>
> Hi Vitaly,
> The daemon only polls on POLLIN.
> I'm not sure returning "POLLERR | POLLHUP" here can wake up the daemon or not.
>
I tested this patch with hv_kvp_daemon which does poll() and it
works: we wake up all pollers from hvutil_transport_destroy(). Here
we just need to return proper value. Actually, the return value doesn't
really matter -- we do read() after poll() and get -EBADF there. But
let's be consistent.
--
Vitaly
next prev parent reply other threads:[~2015-12-16 10:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 0:26 [PATCH 0/3] Drivers: hv: Fix CPU assignment for FC devices K. Y. Srinivasan
2015-12-16 0:27 ` [PATCH 1/3] Drivers: hv: utils: fix hvt_op_poll() return value on transport destroy K. Y. Srinivasan
2015-12-16 0:27 ` [PATCH 2/3] Drivers: hv: vmbus: Treat Fibre Channel devices as performance critical K. Y. Srinivasan
2015-12-16 0:27 ` [PATCH 3/3] Drivers: hv: vmbus: Cleanup vmbus_set_event() K. Y. Srinivasan
2015-12-21 21:09 ` Greg KH
2015-12-21 21:24 ` KY Srinivasan
2015-12-16 6:37 ` [PATCH 1/3] Drivers: hv: utils: fix hvt_op_poll() return value on transport destroy Dexuan Cui
2015-12-16 10:19 ` Vitaly Kuznetsov [this message]
2015-12-16 10:41 ` Dexuan Cui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877fkevgq3.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=apw@canonical.com \
--cc=decui@microsoft.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=jasowang@redhat.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=olaf@aepfle.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox