xenbus: add missing wakeup in concurrent read/write
PATCH 1/1 xenbus: add missing wakeup in concurrent read/write
If an application has a dedicated read thread watching xenbus and another thread writes an XS_WATCH message that generates a synthetic "OK" reply, this reply will be enqueued in the buffer without waking up the reader. This can cause a deadlock in the application if it then waits for the read thread to receive the queued message.
commit e752969f502a511e83f841aa01d6cd332e6d85a0
Author: Daniel De Graaf <[email protected]> Date: Tue Sep 7 11:21:52 2010 -0400
xenbus: fix deadlock in concurrent read/write
If an application has a dedicated read thread watching xenbus and another thread writes an XS_WATCH message that generates a synthetic "OK" reply, this reply will be enqueued in the buffer without waking up the reader.
drivers/xen/xenfs/xenbus.c +1 -0
@@ -406,6 +406,7 @@ static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u)mutex_lock (&u->reply_mutex); rc =queue_reply (&u->read_buffers, &reply,sizeof (reply)); +wake_up (&u->read_waitq);mutex_unlock (&u->reply_mutex); }
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 7 lines · Daniel De Graaf
If an application has a dedicated read thread watching xenbus and another thread writes an
XS_WATCHmessage that generates a synthetic "OK" reply, this reply will be enqueued in the buffer without waking up the reader. This can cause a deadlock in the application if it then waits for the read thread to receive the queued message.Signed-off-by Daniel De Graaf <[email protected]>
Thanks. Jun Zhu, does this fix the problem you were reporting?
J
That's right! Thanks.
Jun Zhu
Citrix Systems UK
________________________________________
From: Jeremy Fitzhardinge [[email protected]]
Sent: 07 September 2010 19:34
To: Daniel De Graaf
Cc: xen-devel; Jun Zhu (Intern)
Subject: Re: [Xen-devel] [PATCH] xenbus: add missing wakeup in concurrent read/write
Quoted 7 lines · Daniel De Graaf
If an application has a dedicated read thread watching xenbus and another thread writes an
XS_WATCHmessage that generates a synthetic "OK" reply, this reply will be enqueued in the buffer without waking up the reader. This can cause a deadlock in the application if it then waits for the read thread to receive the queued message.Signed-off-by Daniel De Graaf <[email protected]>
Thanks. Jun Zhu, does this fix the problem you were reporting?
J