summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2009-10-30 12:32:07 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-31 07:14:10 -0700
commit4ff046a1e1747cf93c650bd9c630547cdeaa3793 (patch)
tree5d0e08254e91ea76090636c501302533de5ba2ab
parente4548d105538182ee3e2be72d9ceb11df18610fd (diff)
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 <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 306 (Enhance locks to aid debugging) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=306
-rw-r--r--xlators/features/locks/src/posix.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
index 52c4c5441b9..d71324417e5 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)