diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2014-05-01 10:29:54 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2014-05-05 13:52:51 -0700 |
commit | 3a35f975fceb89c5ae0e8e3e189545f6fceaf6e5 (patch) | |
tree | 089844750210ac0e0899c3455740412e871181dc /xlators/nfs | |
parent | 4cf348fcb683ff8c5b85233610dc9aa8835bd532 (diff) |
mgmt/gluster: Use fsync instead of O_SYNC
Glusterd uses O_SYNC to write to temp file then performs renames
to the actual file and performs fsync on parent directory. Until
this rename happens syncing writes to the file can be deferred.
In this patch O_SYNC open of temp file is removed and fsync of the
fd before rename is done.
Change-Id: Ie7da161b0daec845c7dcfab4154cc45c2f49d825
BUG: 908277
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/7370
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/nfs')
-rw-r--r-- | xlators/nfs/server/src/mount3.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c index 47ff3845e9d..e4cfcebefc5 100644 --- a/xlators/nfs/server/src/mount3.c +++ b/xlators/nfs/server/src/mount3.c @@ -356,7 +356,6 @@ __mount_rewrite_rmtab(struct mount3_state *ms, gf_store_handle_t *sh) gf_log (GF_MNT, GF_LOG_DEBUG, "Updated rmtab with %d entries", idx); - close (fd); if (gf_store_rename_tmppath (sh)) gf_log (GF_MNT, GF_LOG_ERROR, "Failed to overwrite rwtab %s", sh->path); @@ -365,7 +364,6 @@ __mount_rewrite_rmtab(struct mount3_state *ms, gf_store_handle_t *sh) fail: gf_log (GF_MNT, GF_LOG_ERROR, "Failed to update %s", sh->path); - close (fd); gf_store_unlink_tmppath (sh); } |