diff options
author | N Balachandran <nbalacha@redhat.com> | 2016-11-08 14:10:49 +0530 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-11-21 06:40:15 -0800 |
commit | 3e405b546e8b9fe15ae477613474e9cd2d2df4e7 (patch) | |
tree | e01af3b821b2532f9e531c39cd2844c1ac180aeb | |
parent | f7ab6c45963fa0da68acedfb14281cd2456abc68 (diff) |
cluster/dht Set layout after mkdir as root
DHT does not set the layout for newly created
directories as root. This causes EPERM failures
when a non-root user with insufficient permissions
creates directories.
credit: srangana@redhat.com for RCA
Change-Id: Ia646e41665ce172c43c5f01d2707455e8eb374ed
BUG: 1392772
Signed-off-by: N Balachandran <nbalacha@redhat.com>
Reviewed-on: http://review.gluster.org/15794
Reviewed-by: Susant Palai <spalai@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index a85627a683e..8e80d7b3ef8 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -7170,6 +7170,7 @@ dht_mkdir_selfheal_cbk (call_frame_t *frame, void *cookie, local = frame->local; layout = local->selfheal.layout; + FRAME_SU_UNDO (frame, dht_local_t); dht_set_fixed_dir_stat (&local->preparent); dht_set_fixed_dir_stat (&local->postparent); @@ -7257,6 +7258,7 @@ unlock: this_call_cnt = dht_frame_return (frame); if (is_last_call (this_call_cnt)) { + FRAME_SU_DO (frame, dht_local_t); dht_selfheal_new_directory (frame, dht_mkdir_selfheal_cbk, layout); } @@ -7490,6 +7492,7 @@ dht_mkdir_hashed_cbk (call_frame_t *frame, void *cookie, if (gf_uuid_is_null (local->loc.gfid)) gf_uuid_copy (local->loc.gfid, stbuf->ia_gfid); if (local->call_cnt == 0) { + FRAME_SU_DO (frame, dht_local_t); dht_selfheal_directory (frame, dht_mkdir_selfheal_cbk, &local->loc, layout); } |