From edf9551b38c18be0dab7230c75547f18c2d09747 Mon Sep 17 00:00:00 2001 From: Junaid Date: Fri, 11 Nov 2011 17:05:43 +0530 Subject: features/marker-quota: Use stack_wind_cookie in place of stack_wind to preserve the cookie value. In marker_rename, some of the call back functions make use of cookies sent by the calling functions. In case of stack_wind the frame->cookie is over written with the address of new frame. Change-Id: I8ec98f3305700e2c3295a10dff159ca6a19a380a BUG: 3808 Reviewed-on: http://review.gluster.com/717 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/marker/src/marker.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index f597309e412..ee422bdc3f3 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -1109,10 +1109,10 @@ marker_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, newloc.parent = inode_ref (local->loc.parent); newloc.ino = oplocal->loc.inode->ino; - STACK_WIND (frame, marker_rename_release_oldp_lock, - FIRST_CHILD(this), - FIRST_CHILD(this)->fops->removexattr, &newloc, - contri_key); + STACK_WIND_COOKIE (frame, marker_rename_release_oldp_lock, + frame->cookie, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->removexattr, + &newloc, contri_key); loc_wipe (&newloc); } else { @@ -1249,10 +1249,10 @@ marker_get_newpath_contribution (call_frame_t *frame, void *cookie, */ MARKER_SET_UID_GID (frame, local, frame->root); - STACK_WIND (frame, marker_do_rename, - FIRST_CHILD(this), - FIRST_CHILD(this)->fops->getxattr, &local->loc, - contri_key); + STACK_WIND_COOKIE (frame, marker_do_rename, + frame->cookie, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->getxattr, + &local->loc, contri_key); } else { marker_do_rename (frame, NULL, this, 0, 0, NULL); } @@ -1299,9 +1299,10 @@ marker_get_oldpath_contribution (call_frame_t *frame, void *cookie, */ MARKER_SET_UID_GID (frame, local, frame->root); - STACK_WIND (frame, marker_get_newpath_contribution, FIRST_CHILD(this), - FIRST_CHILD(this)->fops->getxattr, &oplocal->loc, - contri_key); + STACK_WIND_COOKIE (frame, marker_get_newpath_contribution, + frame->cookie, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->getxattr, + &oplocal->loc, contri_key); return 0; quota_err: -- cgit