diff options
author | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2010-09-07 17:42:18 +0200 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-09-08 15:18:02 +0200 |
commit | 76ce7618f9a24f7b13958c67f7d5ccfcdab71475 (patch) | |
tree | ef9dc704b151062924cc1ae1a43aeea2b3d76d5e /drivers/xen/xenfs | |
parent | xenbus: allow any xenbus command over /proc/xen/xenbus (diff) | |
download | linux-76ce7618f9a24f7b13958c67f7d5ccfcdab71475.tar.xz linux-76ce7618f9a24f7b13958c67f7d5ccfcdab71475.zip |
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.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
commit e752969f502a511e83f841aa01d6cd332e6d85a0
Author: Daniel De Graaf <dgdegra@tycho.nsa.gov>
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.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'drivers/xen/xenfs')
-rw-r--r-- | drivers/xen/xenfs/xenbus.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/xen/xenfs/xenbus.c b/drivers/xen/xenfs/xenbus.c index 46cf4048e60e..c4c7db8363e7 100644 --- a/drivers/xen/xenfs/xenbus.c +++ b/drivers/xen/xenfs/xenbus.c @@ -405,6 +405,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); } |