From 77d9a17a712a250c773a2bc724f16ecb3a3aa919 Mon Sep 17 00:00:00 2001 From: Pavan Sondur Date: Mon, 21 Dec 2009 04:30:04 +0000 Subject: features/locks: Unwind if inode is NULL to prevent 'lost' frame. Signed-off-by: Pavan Vilas Sondur Signed-off-by: Vijay Bellur BUG: 222 (Enhance Internal locks to support multilple domains and rewrite inodelks) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=222 --- xlators/features/locks/src/inodelk.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c index 41228c887d0..9e9d6d17389 100644 --- a/xlators/features/locks/src/inodelk.c +++ b/xlators/features/locks/src/inodelk.c @@ -526,7 +526,7 @@ new_inode_lock (struct flock *flock, transport_t *transport, pid_t client_pid, return lock; } -/* Common inodelk code called form pl_inodelk and pl_finodelk */ +/* Common inodelk code called from pl_inodelk and pl_finodelk */ int pl_common_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, inode_t *inode, int32_t cmd, @@ -540,12 +540,12 @@ pl_common_inodelk (call_frame_t *frame, xlator_t *this, pid_t client_pid = -1; uint64_t owner = -1; pl_inode_t * pinode = NULL; - pl_inode_lock_t * reqlock = NULL; + pl_inode_lock_t * reqlock = NULL; pl_dom_list_t * dom = NULL; VALIDATE_OR_GOTO (frame, out); - VALIDATE_OR_GOTO (inode, out); - VALIDATE_OR_GOTO (flock, out); + VALIDATE_OR_GOTO (inode, unwind); + VALIDATE_OR_GOTO (flock, unwind); if ((flock->l_start < 0) || (flock->l_len < 0)) { op_errno = EINVAL; @@ -628,8 +628,11 @@ pl_common_inodelk (call_frame_t *frame, xlator_t *this, op_ret = 0; unwind: - pl_update_refkeeper (this, inode); - pl_trace_out (this, frame, fd, loc, cmd, flock, op_ret, op_errno, volume); + if ((inode != NULL) && (flock !=NULL)) { + pl_update_refkeeper (this, inode); + pl_trace_out (this, frame, fd, loc, cmd, flock, op_ret, op_errno, volume); + } + STACK_UNWIND_STRICT (inodelk, frame, op_ret, op_errno); out: return 0; -- cgit