Displaying 2 results from an estimated 2 matches for "queue_reply".
2006 Aug 02
2
[PATCH][RFC] permit domU userspace to watch xenstore
...uest. */
unsigned int len;
union {
@@ -70,6 +73,8 @@ struct xenbus_dev_data {
char read_buffer[PAGE_SIZE];
unsigned int read_cons, read_prod;
wait_queue_head_t read_waitq;
+
+ struct mutex reply_mutex;
};
static struct proc_dir_entry *xenbus_dev_intf;
@@ -100,13 +105,59 @@ static void queue_reply(struct xenbus_de
{
int i;
+ mutex_lock(&u->reply_mutex);
+
for (i = 0; i < len; i++, u->read_prod++)
u->read_buffer[MASK_READ_IDX(u->read_prod)] = data[i];
BUG_ON((u->read_prod - u->read_cons) > sizeof(u->read_buffer));
+ mutex_unlock(&u->reply_...
2013 May 15
6
xenfs: race condition on xenstore watch
...}
token++;
+ mutex_lock(&u->reply_mutex);
+
if (msg_type == XS_WATCH) {
watch = alloc_watch_adapter(path, token);
if (watch == NULL) {
@@ -401,12 +403,11 @@ static int xenbus_write_watch(unsigned m
"OK"
};
- mutex_lock(&u->reply_mutex);
rc = queue_reply(&u->read_buffers, &reply, sizeof(reply));
- mutex_unlock(&u->reply_mutex);
}
out:
+ mutex_unlock(&u->reply_mutex);
return rc;
}