From 3e405b546e8b9fe15ae477613474e9cd2d2df4e7 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Tue, 8 Nov 2016 14:10:49 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/15794 Reviewed-by: Susant Palai NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Smoke: Gluster Build System Reviewed-by: Raghavendra G Reviewed-by: Jeff Darcy --- xlators/cluster/dht/src/dht-common.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/cluster/dht/src') 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); } -- cgit