git.samba.org
/
metze
/
ctdb
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
54c1036
)
libctdb: synchronous should be using ctdb_cancel to kill unfinished requests.
author
Rusty Russell
<rusty@rustcorp.com.au>
Fri, 18 Jun 2010 05:45:27 +0000
(15:15 +0930)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Fri, 18 Jun 2010 05:45:27 +0000
(15:15 +0930)
Found by ctdb-test.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
libctdb/sync.c
patch
|
blob
|
history
diff --git
a/libctdb/sync.c
b/libctdb/sync.c
index 11cd6cad746a168962faf184db67dbb22e31820f..d60552af70bcafcdd131e563239fdb9734e0760c 100644
(file)
--- a/
libctdb/sync.c
+++ b/
libctdb/sync.c
@@
-41,12
+41,16
@@
static struct ctdb_request *synchronous(struct ctdb_connection *ctdb,
/* Signalled is OK, other error is bad. */
if (errno == EINTR)
continue;
- ctdb_
request_free
(ctdb, req);
+ ctdb_
cancel
(ctdb, req);
DEBUG(ctdb, LOG_ERR, "ctdb_synchronous: poll failed");
return NULL;
}
if (ctdb_service(ctdb, fds.revents) < 0) {
- ctdb_request_free(ctdb, req);
+ /* It can have failed after it completed request. */
+ if (!*done)
+ ctdb_cancel(ctdb, req);
+ else
+ ctdb_request_free(ctdb, req);
return NULL;
}
}