summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/posix.c
diff options
context:
space:
mode:
authorBhumika Goyal <bgoyal@redhat.com>2018-08-20 21:06:37 +0530
committerAmar Tumballi <amarts@redhat.com>2018-08-24 05:41:57 +0000
commit94a532464d1149dc1574e2e4b5484d35415bde5b (patch)
tree4f5abe4df13a68e98bfb402002b91367899fb210 /xlators/features/locks/src/posix.c
parent8c4b20bc0b9d491bee1efb1a18d87852020f045d (diff)
locks: coverity fixes
Fixes CID: 1356583 1356582 1356581 1356580 Add logs and also replace gf_log with gf_msg_debug. Change-Id: I348dc94f7a52034542d29096c12a2cf60aabe97f updates: bz#789278 Signed-off-by: Bhumika Goyal <bgoyal@redhat.com>
Diffstat (limited to 'xlators/features/locks/src/posix.c')
-rw-r--r--xlators/features/locks/src/posix.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
index e83a93ded11..c4ca71cfd7f 100644
--- a/xlators/features/locks/src/posix.c
+++ b/xlators/features/locks/src/posix.c
@@ -271,6 +271,10 @@ pl_parent_entrylk_xattr_fill (xlator_t *this, inode_t *parent,
goto out;
if (keep_max) {
ret = dict_get_int32 (dict, GLUSTERFS_PARENT_ENTRYLK, &maxcount);
+ if (ret < 0)
+ gf_msg_debug (this->name, 0,
+ " Failed to fetch the value for key %s",
+ GLUSTERFS_PARENT_ENTRYLK);
}
entrylk = check_entrylk_on_basename (this, parent, basename);
if (maxcount >= entrylk)
@@ -278,7 +282,7 @@ pl_parent_entrylk_xattr_fill (xlator_t *this, inode_t *parent,
out:
ret = dict_set_int32 (dict, GLUSTERFS_PARENT_ENTRYLK, entrylk);
if (ret < 0) {
- gf_log (this->name, GF_LOG_DEBUG,
+ gf_msg_debug (this->name, 0,
" dict_set failed on key %s", GLUSTERFS_PARENT_ENTRYLK);
}
}
@@ -293,6 +297,11 @@ pl_entrylk_xattr_fill (xlator_t *this, inode_t *inode,
if (keep_max) {
ret = dict_get_int32 (dict, GLUSTERFS_ENTRYLK_COUNT, &maxcount);
+ if (ret < 0)
+ gf_msg_debug (this->name, 0,
+ " Failed to fetch the value for key %s",
+ GLUSTERFS_ENTRYLK_COUNT);
+
}
count = get_entrylk_count (this, inode);
if (maxcount >= count)
@@ -300,7 +309,7 @@ pl_entrylk_xattr_fill (xlator_t *this, inode_t *inode,
ret = dict_set_int32 (dict, GLUSTERFS_ENTRYLK_COUNT, count);
if (ret < 0) {
- gf_log (this->name, GF_LOG_DEBUG,
+ gf_msg_debug (this->name, 0,
" dict_set failed on key %s", GLUSTERFS_ENTRYLK_COUNT);
}
@@ -316,6 +325,10 @@ pl_inodelk_xattr_fill (xlator_t *this, inode_t *inode, dict_t *dict,
if (keep_max) {
ret = dict_get_int32 (dict, GLUSTERFS_INODELK_COUNT, &maxcount);
+ if (ret < 0)
+ gf_msg_debug (this->name, 0,
+ " Failed to fetch the value for key %s",
+ GLUSTERFS_INODELK_COUNT);
}
count = get_inodelk_count (this, inode, domname);
if (maxcount >= count)
@@ -323,7 +336,7 @@ pl_inodelk_xattr_fill (xlator_t *this, inode_t *inode, dict_t *dict,
ret = dict_set_int32 (dict, GLUSTERFS_INODELK_COUNT, count);
if (ret < 0) {
- gf_log (this->name, GF_LOG_DEBUG, "Failed to set count for "
+ gf_msg_debug (this->name, 0, "Failed to set count for "
"key %s", GLUSTERFS_INODELK_COUNT);
}
@@ -340,6 +353,10 @@ pl_posixlk_xattr_fill (xlator_t *this, inode_t *inode,
if (keep_max) {
ret = dict_get_int32 (dict, GLUSTERFS_POSIXLK_COUNT, &maxcount);
+ if (ret < 0)
+ gf_msg_debug (this->name, 0,
+ " Failed to fetch the value for key %s",
+ GLUSTERFS_POSIXLK_COUNT);
}
count = get_posixlk_count (this, inode);
if (maxcount >= count)
@@ -347,7 +364,7 @@ pl_posixlk_xattr_fill (xlator_t *this, inode_t *inode,
ret = dict_set_int32 (dict, GLUSTERFS_POSIXLK_COUNT, count);
if (ret < 0) {
- gf_log (this->name, GF_LOG_DEBUG,
+ gf_msg_debug (this->name, 0,
" dict_set failed on key %s", GLUSTERFS_POSIXLK_COUNT);
}