direct-io.hg

changeset 14584:a9a39cc52e74

linux: Fix for missing response to XS_UNWATCH request.
From: Magnus Carlsson <magnus@galois.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Mar 27 16:19:25 2007 +0100 (2007-03-27)
parents f1014cbe906a
children 3375391fb0c9
files linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Tue Mar 27 16:03:30 2007 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Tue Mar 27 16:19:25 2007 +0100
     1.3 @@ -236,7 +236,10 @@ static ssize_t xenbus_dev_write(struct f
     1.4  		break;
     1.5  
     1.6  	case XS_WATCH:
     1.7 -	case XS_UNWATCH:
     1.8 +	case XS_UNWATCH: {
     1.9 +		static const char *XS_RESP = "OK";
    1.10 +		struct xsd_sockmsg hdr;
    1.11 +
    1.12  		path = u->u.buffer + sizeof(u->u.msg);
    1.13  		token = memchr(path, 0, u->u.msg.len);
    1.14  		if (token == NULL) {
    1.15 @@ -246,9 +249,6 @@ static ssize_t xenbus_dev_write(struct f
    1.16  		token++;
    1.17  
    1.18  		if (msg_type == XS_WATCH) {
    1.19 -			static const char * XS_WATCH_RESP = "OK";
    1.20 -			struct xsd_sockmsg hdr;
    1.21 -
    1.22  			watch = kmalloc(sizeof(*watch), GFP_KERNEL);
    1.23  			watch->watch.node = kmalloc(strlen(path)+1,
    1.24                                                      GFP_KERNEL);
    1.25 @@ -266,11 +266,6 @@ static ssize_t xenbus_dev_write(struct f
    1.26  			}
    1.27  			
    1.28  			list_add(&watch->list, &u->watches);
    1.29 -
    1.30 -			hdr.type = XS_WATCH;
    1.31 -			hdr.len = strlen(XS_WATCH_RESP) + 1;
    1.32 -			queue_reply(u, (char *)&hdr, sizeof(hdr));
    1.33 -			queue_reply(u, (char *)XS_WATCH_RESP, hdr.len);
    1.34  		} else {
    1.35  			list_for_each_entry_safe(watch, tmp_watch,
    1.36                                                   &u->watches, list) {
    1.37 @@ -285,7 +280,12 @@ static ssize_t xenbus_dev_write(struct f
    1.38  			}
    1.39  		}
    1.40  
    1.41 +		hdr.type = msg_type;
    1.42 +		hdr.len = strlen(XS_RESP) + 1;
    1.43 +		queue_reply(u, (char *)&hdr, sizeof(hdr));
    1.44 +		queue_reply(u, (char *)XS_RESP, hdr.len);
    1.45  		break;
    1.46 +	}
    1.47  
    1.48  	default:
    1.49  		rc = -EINVAL;