summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-rename.c
diff options
context:
space:
mode:
authorshishir gowda <sgowda@redhat.com>2013-05-16 19:25:25 +0530
committerVijay Bellur <vbellur@redhat.com>2013-05-16 08:47:44 -0700
commitddc0b45c4d4826e86500740f672892eeb28ab325 (patch)
tree1c39888af578dad23ca17162a7389a7b8961d52d /xlators/cluster/dht/src/dht-rename.c
parent2ee82710c088461cf4d3769625723346345566f9 (diff)
cluster/dht: Create linkfile with file uid/gid
Currently, linkfile creation happens as root. use uid/gid returned from _cbk (link/rename) to set the correct ownership of the link files. Change-Id: I5345cff193d5095442ca446fbe5ea05f2c2d86a3 Signed-off-by: shishir gowda <sgowda@redhat.com> BUG: 884597 Reviewed-on: http://review.gluster.org/5024 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-rename.c')
-rw-r--r--xlators/cluster/dht/src/dht-rename.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c
index f1a4364df..35fedeaa7 100644
--- a/xlators/cluster/dht/src/dht-rename.c
+++ b/xlators/cluster/dht/src/dht-rename.c
@@ -441,6 +441,10 @@ dht_rename_links_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->loc.path, prev->this->name, strerror (op_errno));
}
+ if (local->linked == _gf_true) {
+ local->linked = _gf_false;
+ dht_linkfile_attr_heal (frame, this);
+ }
DHT_STACK_DESTROY (frame);
return 0;
@@ -511,6 +515,11 @@ err:
dht_iatt_merge (this, &local->preparent, prenewparent, prev->this);
dht_iatt_merge (this, &local->postparent, postnewparent, prev->this);
+ if (local->linked == _gf_true) {
+ local->linked = _gf_false;
+ dht_linkfile_attr_heal (frame, this);
+ }
+
/* NOTE: rename_subvol is the same subvolume from which dht_rename_cbk
* is called. since rename has already happened on rename_subvol,
* unlink should not be sent for oldpath (either linkfile or cached-file)
@@ -645,6 +654,8 @@ dht_rename_links_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->op_ret = -1;
if (op_errno != ENOENT)
local->op_errno = op_errno;
+ } else {
+ dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
}
this_call_cnt = dht_frame_return (frame);