summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/cluster/nsr-server/src/nsr.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/xlators/cluster/nsr-server/src/nsr.c b/xlators/cluster/nsr-server/src/nsr.c
index b4618bb62..75412a8f5 100644
--- a/xlators/cluster/nsr-server/src/nsr.c
+++ b/xlators/cluster/nsr-server/src/nsr.c
@@ -20,7 +20,7 @@
#include "api/src/glfs-internal.h"
#include "run.h"
#include "common-utils.h"
-
+#include "syncop.h"
#include "etcd-api.h"
#include "nsr-internal.h"
@@ -318,6 +318,7 @@ nsr_flush_thread (void *ctx)
struct list_head dirty_fds;
nsr_fd_ctx_t *fd_ctx;
nsr_fd_ctx_t *fd_tmp;
+ int ret;
for (;;) {
/*
@@ -351,6 +352,13 @@ nsr_flush_thread (void *ctx)
UNLOCK(&priv->dirty_lock);
list_for_each_entry_safe (fd_ctx, fd_tmp, &dirty_fds, fd_list) {
+ ret = syncop_fsync(FIRST_CHILD(this),fd_ctx->fd,0);
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "failed to fsync %p (%d)",
+ fd_ctx->fd, -ret);
+ }
+
LOCK(&fd_ctx->fd->lock);
nsr_flush_fd(this,fd_ctx);
list_del_init(&fd_ctx->fd_list);