summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPavan Sondur <pavan@gluster.com>2009-12-21 04:30:04 +0000
committerVijay Bellur <vijay@dev.gluster.com>2009-12-21 22:43:41 -0800
commit77d9a17a712a250c773a2bc724f16ecb3a3aa919 (patch)
tree228730500703b41cfe1a5c97b0670fdb2fb1e923 /xlators
parent96ae032a9cb9b198f31e26aba30a39e5148a2ba4 (diff)
features/locks: Unwind if inode is NULL to prevent 'lost' frame.
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> 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
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/locks/src/inodelk.c15
1 files changed, 9 insertions, 6 deletions
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;