summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-02-04 01:29:08 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-02-07 00:59:27 -0800
commit3bad56d0d39e132b43d0122a570ba1b59a9a7caa (patch)
tree528ad9f5c9aa05caffed0533bfb871ed36034853 /xlators/mgmt
parent31efe81b13d6761cf153e71f7ac150751b2d4090 (diff)
gluster rebalance: fix the permission issue of rebalanced files
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2369 (Rebalanced files written as root:root on any brick) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2369
Diffstat (limited to 'xlators/mgmt')
-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 3e4b4f5a2..a8a063706 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);