From f2404405432cfc7c2369de02f79eee000b9aee13 Mon Sep 17 00:00:00 2001 From: yatipadia Date: Mon, 16 Sep 2019 14:45:12 +0530 Subject: xlators: fixes logically dead code. This patch addresses CID-1124388. Problem: When we reach the "out" section in ra_priv_dump(), if the condition (ret && conf) holds true, then the value of "add_section" will always be true. So the condition (add_section == _gf_false) will be a dead code. Fix:"add_section" has no use in the whole block and was making part of the block as logically dead code and hence, removed it. Change-Id: Id7e0105fc9a5ca5b2c2d098c665e6e32ecc6b62b updates: bz#789278 Signed-off-by: yatipadia --- xlators/performance/read-ahead/src/read-ahead.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c index 224edf0864a..e6bfd25641e 100644 --- a/xlators/performance/read-ahead/src/read-ahead.c +++ b/xlators/performance/read-ahead/src/read-ahead.c @@ -1021,7 +1021,6 @@ ra_priv_dump(xlator_t *this) char key_prefix[GF_DUMP_MAX_BUF_LEN] = { 0, }; - gf_boolean_t add_section = _gf_false; if (!this) { goto out; @@ -1037,7 +1036,6 @@ ra_priv_dump(xlator_t *this) gf_proc_dump_build_key(key_prefix, "xlator.performance.read-ahead", "priv"); gf_proc_dump_add_section("%s", key_prefix); - add_section = _gf_true; ret = pthread_mutex_trylock(&conf->conf_lock); if (ret) @@ -1053,9 +1051,6 @@ ra_priv_dump(xlator_t *this) ret = 0; out: if (ret && conf) { - if (add_section == _gf_false) - gf_proc_dump_add_section("%s", key_prefix); - gf_proc_dump_write("Unable to dump priv", "(Lock acquisition failed) %s", this->name); } -- cgit