diff options
author | shishir gowda <sgowda@redhat.com> | 2013-02-11 22:27:29 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-03-04 02:40:01 -0800 |
commit | 41400b3a4e34a77af5e13ba926ec372291553fe6 (patch) | |
tree | 256f90fc695d5730fdbb4cf35200c301759f0f11 /xlators/cluster/dht/src/dht-rename.c | |
parent | 6a303c8b9ce01d17453914841f5b61bf9daf91ac (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.
Also added test/dht.rc to implement common dht functions
BUG: 884597
Change-Id: I6bc0e04f62d4716fc033681e5678e852a1be7a2f
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.org/4607
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-rename.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-rename.c | 11 |
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 f1a4364df20..35fedeaa7a4 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); |