From 4ff046a1e1747cf93c650bd9c630547cdeaa3793 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Fri, 30 Oct 2009 12:32:07 +0000 Subject: features/locks: Do not try to set values in dictionary when lookup has failed lock-count was being set without checking for op_ret from lookup. This would cause a lot of Critical messages in the log as dict would be NULL in case of a lookup failure. Also, did some minor re-factoring. Signed-off-by: Vijay Bellur Signed-off-by: Anand V. Avati BUG: 306 (Enhance locks to aid debugging) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=306 --- xlators/features/locks/src/posix.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index 52c4c5441..d71324417 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -825,8 +825,9 @@ out: return count; } -void pl_entrylk_xattr_fill (xlator_t *this, inode_t *inode, - dict_t *dict) +void +pl_entrylk_xattr_fill (xlator_t *this, inode_t *inode, + dict_t *dict) { int32_t count = 0; int ret = -1; @@ -840,8 +841,9 @@ void pl_entrylk_xattr_fill (xlator_t *this, inode_t *inode, } -void pl_inodelk_xattr_fill (xlator_t *this, inode_t *inode, - dict_t *dict) +void +pl_inodelk_xattr_fill (xlator_t *this, inode_t *inode, + dict_t *dict) { int32_t count = 0; int ret = -1; @@ -855,8 +857,9 @@ void pl_inodelk_xattr_fill (xlator_t *this, inode_t *inode, } -void pl_posixlk_xattr_fill (xlator_t *this, inode_t *inode, - dict_t *dict) +void +pl_posixlk_xattr_fill (xlator_t *this, inode_t *inode, + dict_t *dict) { int32_t count = 0; int ret = -1; @@ -886,6 +889,9 @@ pl_lookup_cbk (call_frame_t *frame, goto out; } + if (op_ret) + goto out; + local = frame->local; if (local->entrylk_count_req) -- cgit