Displaying 3 results from an estimated 3 matches for "watch_fir".
Did you mean:
watch_fired
2013 May 15
6
xenfs: race condition on xenstore watch
...client. It seems to me that the client is within its
rights to expect the "OK" first.
Here''s what is happening:
The userspace process xenstore-watch writes to /proc/xen/xenbus with
msg_type==XS_WATCH. This is handled by xenbus_write_watch which calls
register_xenbus_watch with watch_fired as a callback *before* acquiring
the reply_mutex and sending the synthesised "OK" reply.
This gives a fast xenstore the opportunity to cause the watch_fired to
run (and briefly grab the reply_mutex for itself) before the fake "OK"
message is sent.
Below, I''ve includ...
2006 Aug 02
2
[PATCH][RFC] permit domU userspace to watch xenstore
...);
}
+
+struct watch_adapter
+{
+ struct list_head list;
+ struct xenbus_watch watch;
+ struct xenbus_dev_data *dev_data;
+ char *token;
+};
+
+static void free_watch_adapter (struct watch_adapter *watch)
+{
+ kfree(watch->watch.node);
+ kfree(watch->token);
+ kfree(watch);
+}
+
+static void watch_fired(struct xenbus_watch *watch,
+ const char **vec,
+ unsigned int len)
+{
+ struct watch_adapter *adap =
+ container_of(watch, struct watch_adapter, watch);
+ struct xsd_sockmsg hdr;
+ const char *path, *token;
+ int path_len, tok_len, body_len;
+
+ path = vec[XS_WATCH_PATH];
+ token...
2012 Jan 24
0
[PATCH] linux-2.6.18/xenbus_dev: add missing error checks to watch handling
...atch.node = kmalloc(strlen(path)+1,
- GFP_KERNEL);
- strcpy((char *)watch->watch.node, path);
+ if (watch == NULL) {
+ rc = -ENOMEM;
+ goto out;
+ }
+ watch->watch.node = kstrdup(path, GFP_KERNEL);
watch->watch.callback = watch_fired;
- watch->token = kmalloc(strlen(token)+1, GFP_KERNEL);
- strcpy(watch->token, token);
+ watch->token = kstrdup(token, GFP_KERNEL);
watch->dev_data = u;
- err = register_xenbus_watch(&watch->watch);
+ err = watch->watch.node && watch->token
+...