[ovs-dev] [PATCH 4/9] datapath-windows: Fix bugs in Event.c around subscribe and lock
Yin Lin
yinlin10 at gmail.com
Mon Jul 18 18:07:28 UTC 2016
Thanks Sai for fixing the bugs. A few questions:
1. There is also an unrelease lock in line 359, function OvsWaitEventIoctl.
2. Do we need the lock before OvsGetOpenInstance? If so, please release the
lock inside "if (instance == NULL)"; if not, you should do the same thing
on line 359.
On Wed, Jul 13, 2016 at 4:38 PM, Sairam Venugopal <vsairam at vmware.com>
wrote:
> When userspace tries to resubscribe to an existing queue, return
> STATUS_INVALID_PARAMETER since it's not supported. The current bug
> overwrites status to STATUS_SUCCESS.
>
> The second bug fix is around releasing the EventQueue lock if an open
> instance couldn't be found. The current version returns back without
> releasing the lock. Moving the OvsAcquireEventQueueLock() after the
> instance is verified.
>
> Signed-off-by: Sairam Venugopal <vsairam at vmware.com>
> ---
> datapath-windows/ovsext/Event.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/datapath-windows/ovsext/Event.c
> b/datapath-windows/ovsext/Event.c
> index 8c7c3ec..8ff0322 100644
> --- a/datapath-windows/ovsext/Event.c
> +++ b/datapath-windows/ovsext/Event.c
> @@ -217,9 +217,8 @@ OvsSubscribeEventIoctl(PFILE_OBJECT fileObject,
> if (queue->mask != request->mask) {
> status = STATUS_INVALID_PARAMETER;
> OVS_LOG_WARN("Can not chnage mask when the queue is
> subscribed");
> + goto done_event_subscribe;
> }
> - status = STATUS_SUCCESS;
> - goto done_event_subscribe;
> } else if (!request->subscribe && queue == NULL) {
> status = STATUS_SUCCESS;
> goto done_event_subscribe;
> @@ -356,8 +355,6 @@ OvsWaitEventIoctl(PIRP irp,
> }
> poll = (POVS_EVENT_POLL)inputBuffer;
>
> - OvsAcquireEventQueueLock();
> -
> instance = OvsGetOpenInstance(fileObject, poll->dpNo);
> if (instance == NULL) {
> OVS_LOG_TRACE("Exit: Can not find open instance, dpNo: %d",
> @@ -365,6 +362,7 @@ OvsWaitEventIoctl(PIRP irp,
> return STATUS_INVALID_PARAMETER;
> }
>
> + OvsAcquireEventQueueLock();
> queue = (POVS_EVENT_QUEUE)instance->eventQueue;
> if (queue == NULL) {
> OVS_LOG_TRACE("Exit: Event queue does not exist");
> --
> 2.9.0.windows.1
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
More information about the dev
mailing list