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
committerVijay Bellur <vbellur@redhat.com>2016-03-08 07:29:51 -0800
commitccdfd9f8550e1d1f9d311eb997f23c9b10c7a70b (patch)
treee3daf4934965a62d8acad5271847f0d748503cd6 /xlators/features/trash/src
parenteae63bbcdaf6ec6ae5340b51bd05c476c791e38b (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> (cherry picked from commit b609a55be4119c44b19252bd951780a78deb21c9) Signed-off-by: Anoop C S <anoopcs@redhat.com> Change-Id: I88950b7d2e42bda65272bc359e8dc60a2ce04d89 BUG: 1305749 Reviewed-on: http://review.gluster.org/13401 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com>
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 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);