summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/dht-common.c8
-rw-r--r--xlators/cluster/dht/src/dht-rename.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 83a2fe8d138..d94a78c3054 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -1262,6 +1262,7 @@ dht_lookup_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local = (dht_local_t*)frame->local;
path = local->loc.path;
+ FRAME_SU_UNDO (frame, dht_local_t);
gf_msg (this->name, GF_LOG_INFO, 0,
DHT_MSG_UNLINK_LOOKUP_INFO, "lookup_unlink returned with "
@@ -1955,7 +1956,12 @@ unlock:
loc->path, subvol->name,
(local->hashed_subvol?
local->hashed_subvol->name : "<null>"));
-
+ /* *
+ * These stale files may be created using root
+ * user. Hence deletion will work only with
+ * root.
+ */
+ FRAME_SU_DO (frame, dht_local_t);
STACK_WIND (frame, dht_lookup_unlink_cbk,
subvol, subvol->fops->unlink, loc,
0, dict_req);
diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c
index 4ed659b588e..c48753a85f4 100644
--- a/xlators/cluster/dht/src/dht-rename.c
+++ b/xlators/cluster/dht/src/dht-rename.c
@@ -641,6 +641,7 @@ dht_rename_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local = frame->local;
prev = cookie;
+ FRAME_SU_UNDO (frame, dht_local_t);
if (!local) {
gf_msg (this->name, GF_LOG_ERROR, 0,
DHT_MSG_INVALID_VALUE,
@@ -749,7 +750,12 @@ dht_rename_cleanup (call_frame_t *frame)
local->loc2.pargfid) == 0) {
DHT_MARKER_DONT_ACCOUNT(xattr_new);
}
-
+ /* *
+ * The link to file is created using root permission.
+ * Hence deletion should happen using root. Otherwise
+ * it will fail.
+ */
+ FRAME_SU_DO (frame, dht_local_t);
STACK_WIND (frame, dht_rename_unlink_cbk,
src_cached, src_cached->fops->unlink,
&local->loc2, 0, xattr_new);