Skip to content

Commit

Permalink
xenbus: add missing wakeup in concurrent read/write
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel De Graaf authored and Jeremy Fitzhardinge committed Sep 8, 2010
1 parent 6d6df2e commit 76ce761
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/xen/xenfs/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 76ce761

Please sign in to comment.