From b609a55be4119c44b19252bd951780a78deb21c9 Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Wed, 3 Feb 2016 18:24:20 +0530 Subject: features/trash: Handle unlink unwind properly When enabled, trash translator does a rename internally for every unlink request and unwinds the original unlink call. But this was unwinded back with prerparent and postparent as NULL which resulted in changing the parent directory permissions to 000. This issue is consistently seen as a failure when a non-root user executes vim commands which internally tries to perform stat operations (as part of swap/backup file creation) on a file whose parent directory's permission was modified to 000 due to recent unlink for another file inside the same directory. Change-Id: I161a036b37fb815866d50d2d6260ff0ad22d7223 BUG: 1302307 Signed-off-by: Anoop C S Reviewed-on: http://review.gluster.org/13346 Smoke: Gluster Build System Tested-by: jiffin tony Thottan Reviewed-by: jiffin tony Thottan CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System --- xlators/features/trash/src/trash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index b363dbab825..964817ef9f1 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -873,14 +873,14 @@ trash_unlink_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } ctr_out: TRASH_STACK_UNWIND (unlink, frame, 0, op_errno, - &local->preparent, - &local->postparent, new_xdata); + preoldparent, postoldparent, + new_xdata); goto out; } } /* All other cases, unlink should return success */ - TRASH_STACK_UNWIND (unlink, frame, 0, op_errno, &local->preparent, - &local->postparent, xdata); + TRASH_STACK_UNWIND (unlink, frame, 0, op_errno, preoldparent, + postoldparent, xdata); out: if (tmp_str) -- cgit