summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index 3e4b4f5a26c..a8a063706fb 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -128,6 +128,20 @@ gf_glusterd_rebalance_move_data (glusterd_volinfo_t *volinfo, const char *dir)
if (new_stbuf.st_mtime != stbuf.st_mtime)
continue;
+ ret = fchmod (dst_fd, stbuf.st_mode);
+ if (ret) {
+ gf_log ("", GF_LOG_WARNING,
+ "failed to set the mode of file %s: %s",
+ tmp_filename, strerror (errno));
+ }
+
+ ret = fchown (dst_fd, stbuf.st_uid, stbuf.st_gid);
+ if (ret) {
+ gf_log ("", GF_LOG_WARNING,
+ "failed to set the uid/gid of file %s: %s",
+ tmp_filename, strerror (errno));
+ }
+
ret = rename (tmp_filename, full_path);
if (ret != -1) {
LOCK (&defrag->lock);