Commit b93008d1 authored by Simon Gaiser's avatar Simon Gaiser Committed by Boris Ostrovsky

xen: xenbus: Catch closing of non existent transactions

Users of the xenbus functions should never close a non existent
transaction (for example by trying to closing the same transaction
twice) but better catch it in xs_request_exit() than to corrupt the
reference counter.
Signed-off-by: default avatarSimon Gaiser <simon@invisiblethingslab.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
parent 2a22ee6c
...@@ -140,7 +140,9 @@ void xs_request_exit(struct xb_req_data *req) ...@@ -140,7 +140,9 @@ void xs_request_exit(struct xb_req_data *req)
spin_lock(&xs_state_lock); spin_lock(&xs_state_lock);
xs_state_users--; xs_state_users--;
if ((req->type == XS_TRANSACTION_START && req->msg.type == XS_ERROR) || if ((req->type == XS_TRANSACTION_START && req->msg.type == XS_ERROR) ||
req->type == XS_TRANSACTION_END) (req->type == XS_TRANSACTION_END &&
!WARN_ON_ONCE(req->msg.type == XS_ERROR &&
!strcmp(req->body, "ENOENT"))))
xs_state_users--; xs_state_users--;
spin_unlock(&xs_state_lock); spin_unlock(&xs_state_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment