diff options
-rw-r--r-- | src/external_cache.c | 7 | ||||
-rw-r--r-- | src/sync-mode.c | 8 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/external_cache.c b/src/external_cache.c index 4b6fa6f..3f896a0 100644 --- a/src/external_cache.c +++ b/src/external_cache.c @@ -91,12 +91,7 @@ static void external_cache_ct_dump(int fd, int type) static int external_cache_ct_commit(struct nfct_handle *h, int fd) { - if (!cache_commit(external, h, fd)) { - dlog(LOG_NOTICE, "commit already in progress, skipping"); - return LOCAL_RET_OK; - } - /* Keep the client socket open, we want synchronous commits. */ - return LOCAL_RET_STOLEN; + return cache_commit(external, h, fd); } static void external_cache_ct_flush(void) diff --git a/src/sync-mode.c b/src/sync-mode.c index 7e6fa31..fa522c7 100644 --- a/src/sync-mode.c +++ b/src/sync-mode.c @@ -516,6 +516,14 @@ static int local_handler_sync(int fd, int type, void *data) dlog(LOG_NOTICE, "committing external cache"); ret = STATE_SYNC(external)->ct.commit(STATE_SYNC(commit).h, fd); + if (ret == 0) { + dlog(LOG_NOTICE, "commit already in progress, " + "skipping"); + ret = LOCAL_RET_OK; + } else { + /* Keep open the client, we want synchronous commit. */ + ret = LOCAL_RET_STOLEN; + } break; case RESET_TIMERS: if (!alarm_pending(&STATE_SYNC(reset_cache_alarm))) { |