From ccdfd9f8550e1d1f9d311eb997f23c9b10c7a70b 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 (cherry picked from commit b609a55be4119c44b19252bd951780a78deb21c9) Signed-off-by: Anoop C S Change-Id: I88950b7d2e42bda65272bc359e8dc60a2ce04d89 BUG: 1305749 Reviewed-on: http://review.gluster.org/13401 NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: jiffin tony Thottan Reviewed-by: Vijay Bellur Smoke: Gluster Build System --- xlators/features/trash/src/trash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xlators/features/trash') diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index 8549c644bf3..665737389b9 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -877,14 +877,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) GF_FREE (tmp_str); -- cgit