aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-12-04 11:54:04 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-12-04 11:54:04 +0100
commit92279a682103333c660c67091db1245bd4b41f42 (patch)
treef9079b0e9acd055a78d438a4f720cf20ce5b026d
parent5ec893880824dcf095e381a7ad66f3aad5e090d3 (diff)
downloadxen-92279a682103333c660c67091db1245bd4b41f42.tar.gz
xen-92279a682103333c660c67091db1245bd4b41f42.tar.bz2
xen-92279a682103333c660c67091db1245bd4b41f42.zip
Add a comment to tricky corner case in evtchn_close().
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r--xen/common/event_channel.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 6f5a34774b..c3ef30ce34 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -344,6 +344,14 @@ static long __evtchn_close(struct domain *d1, int port1)
}
else if ( d2 != chn1->u.interdomain.remote_dom )
{
+ /*
+ * We can only get here if the port was closed and re-bound after
+ * unlocking d1 but before locking d2 above. We could retry but
+ * it is easier to return the same error as if we had seen the
+ * port in ECS_CLOSED. It must have passed through that state for
+ * us to end up here, so it's a valid error to return.
+ */
+ BUG_ON(d1 != current->domain);
rc = -EINVAL;
goto out;
}