summaryrefslogtreecommitdiffstats
path: root/xlators/features/trash/src
diff options
context:
space:
mode:
authorAnoop C S <anoopcs@redhat.com>2016-02-03 18:24:20 +0530
committerJeff Darcy <jdarcy@redhat.com>2016-02-04 09:15:01 -0800
commitb609a55be4119c44b19252bd951780a78deb21c9 (patch)
tree75ac321f8e0d35eae6fe7860b54e2b25d9c30c46 /xlators/features/trash/src
parent453abcb821b712f849f91a2a370a4debff89eed2 (diff)
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 <anoopcs@redhat.com> Reviewed-on: http://review.gluster.org/13346 Smoke: Gluster Build System <jenkins@build.gluster.com> Tested-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/features/trash/src')
-rw-r--r--xlators/features/trash/src/trash.c8
1 files 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)