diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-05-11 20:39:54 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-05-11 20:39:54 +0200 |
commit | dd3afa517d4fefaadee9fcefefd2e503e251e909 (patch) | |
tree | f3f7123477f50f4e8f36b11e1387b7341a883b78 /libubus-req.c | |
parent | 90037b772c525ad734acb4641c9dacb7abf48ffe (diff) | |
download | ubus-dd3afa517d4fefaadee9fcefefd2e503e251e909.tar.gz |
libubus: fix deadlock in recursive synchronous ubus requests
When synchronous request completion loops are running, the innermost
loop can receive events that can unblock the outer loops, however the
loop clears uloop_cancelled (which is set by the request completion).
This causes the event loop to continue running even while a completion
loop has already been unblocked.
Fix this by not clearing uloop_cancelled for inner loops
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'libubus-req.c')
-rw-r--r-- | libubus-req.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libubus-req.c b/libubus-req.c index f02af8e..2f2dce1 100644 --- a/libubus-req.c +++ b/libubus-req.c @@ -157,6 +157,8 @@ int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req, uloop_cancelled = cancelled; } ctx->stack_depth--; + if (ctx->stack_depth) + uloop_cancelled = true; if (timeout) uloop_timeout_cancel(&cb.timeout); |