summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_persistent.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2008-07-17 18:47:20 +1000
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2008-07-17 18:47:20 +1000
commit90ff67dc7403e714424b4c356ef6ee78dfffbb47 (patch)
treec5d86b8e319cb20c5c37bc7d128be2b97a9a4cfc /ctdb/server/ctdb_persistent.c
parentb9ba443da36d3d3832e7e08e3f3d0d457889cf54 (diff)
downloadsamba-90ff67dc7403e714424b4c356ef6ee78dfffbb47.tar.gz
samba-90ff67dc7403e714424b4c356ef6ee78dfffbb47.tar.xz
samba-90ff67dc7403e714424b4c356ef6ee78dfffbb47.zip
Only decrement the "number of persistent writes in flight" If/when
it is >0 or we will break if used against an unpatched samba server (This used to be ctdb commit 52a38487f981fd5981c02a7a063ad2c598591c10)
Diffstat (limited to 'ctdb/server/ctdb_persistent.c')
-rw-r--r--ctdb/server/ctdb_persistent.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ctdb/server/ctdb_persistent.c b/ctdb/server/ctdb_persistent.c
index 66311a9f89..455ccba4b0 100644
--- a/ctdb/server/ctdb_persistent.c
+++ b/ctdb/server/ctdb_persistent.c
@@ -89,7 +89,9 @@ int32_t ctdb_control_persistent_store(struct ctdb_context *ctdb,
DEBUG(DEBUG_ERR,(__location__ " can not match persistent_store to a client. Returning error\n"));
return -1;
}
- client->num_persistent_updates--;
+ if (client->num_persistent_updates > 0) {
+ client->num_persistent_updates--;
+ }
state = talloc_zero(ctdb, struct ctdb_persistent_state);
CTDB_NO_MEMORY(ctdb, state);
@@ -454,7 +456,9 @@ int32_t ctdb_control_cancel_persistent_update(struct ctdb_context *ctdb,
return -1;
}
- client->num_persistent_updates--;
+ if (client->num_persistent_updates > 0) {
+ client->num_persistent_updates--;
+ }
return 0;
}