diff options
author | Ashish Pandey <aspandey@redhat.com> | 2018-08-30 15:08:02 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-08-31 12:56:49 +0000 |
commit | 67cfacaa9d5ce31240a4d39e81b2984a57ac8865 (patch) | |
tree | 020f142e630a5cbe20c7cae45fe2971b5bd2ed74 /xlators/cluster | |
parent | 19436f2e5fa6dc7f33b7d32d170d3c18f5fdd0d4 (diff) |
cluster/ec: Fix Coverity issue
Fix following coverity issues-
CID:
1382378
1382459
https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=85091670&defectInstanceId=25915064&mergedDefectId=1382459
https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=85091670&defectInstanceId=25915063&mergedDefectId=1382378
Problem:
ASSERT_LOCAL(this, healer) function is supposed to get the local healer
so that we can take advantage of it while healing and reading data.
However, we are not using healer->local anywhere.
Also, this is not as useful in context of EC as it is in AFR.
In EC we have to raed fragments from 4 bricks to heal a bad
fragment on other brick.
Change-Id: Iea8ce127ea02cc84e3823cb2be82a47872217b33
updates: bz#789278
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/ec/src/ec-heald.c | 41 | ||||
-rw-r--r-- | xlators/cluster/ec/src/ec-types.h | 1 |
2 files changed, 0 insertions, 42 deletions
diff --git a/xlators/cluster/ec/src/ec-heald.c b/xlators/cluster/ec/src/ec-heald.c index 65d8b5c4284..f36901ef74f 100644 --- a/xlators/cluster/ec/src/ec-heald.c +++ b/xlators/cluster/ec/src/ec-heald.c @@ -19,20 +19,6 @@ #include "syncop-utils.h" #include "protocol-common.h" -#define ASSERT_LOCAL(this, healer) \ - do { \ - if (!ec_shd_is_subvol_local (this, healer->subvol)) { \ - healer->local = _gf_false; \ - if (safe_break (healer)) { \ - break; \ - } else { \ - continue; \ - } \ - } else { \ - healer->local = _gf_true; \ - } \ - } while (0); - #define NTH_INDEX_HEALER(this, n) (&((((ec_t *)this->private))->shd.index_healers[n])) #define NTH_FULL_HEALER(this, n) (&((((ec_t *)this->private))->shd.full_healers[n])) @@ -106,26 +92,6 @@ ec_shd_healer_wait (struct subvol_healer *healer) return ret; } - -gf_boolean_t -safe_break (struct subvol_healer *healer) -{ - gf_boolean_t ret = _gf_false; - - pthread_mutex_lock (&healer->mutex); - { - if (healer->rerun) - goto unlock; - - healer->running = _gf_false; - ret = _gf_true; - } -unlock: - pthread_mutex_unlock (&healer->mutex); - - return ret; -} - int ec_shd_index_inode (xlator_t *this, xlator_t *subvol, inode_t **inode) { @@ -360,9 +326,6 @@ ec_shd_index_healer (void *data) for (;;) { ec_shd_healer_wait (healer); - ASSERT_LOCAL(this, healer); - - if (ec->xl_up_count > ec->fragments) { gf_msg_debug (this->name, 0, "starting index sweep on subvol %s", @@ -404,9 +367,6 @@ ec_shd_full_healer (void *data) if (!run) break; - ASSERT_LOCAL(this, healer); - - if (ec->xl_up_count > ec->fragments) { gf_msg (this->name, GF_LOG_INFO, 0, EC_MSG_FULL_SWEEP_START, @@ -443,7 +403,6 @@ ec_shd_healer_init (xlator_t *this, struct subvol_healer *healer) healer->this = this; healer->running = _gf_false; healer->rerun = _gf_false; - healer->local = _gf_false; out: return ret; } diff --git a/xlators/cluster/ec/src/ec-types.h b/xlators/cluster/ec/src/ec-types.h index 2724da6415f..0682a73fd6b 100644 --- a/xlators/cluster/ec/src/ec-types.h +++ b/xlators/cluster/ec/src/ec-types.h @@ -596,7 +596,6 @@ struct _ec_heal { struct subvol_healer { xlator_t *this; int subvol; - gf_boolean_t local; gf_boolean_t running; gf_boolean_t rerun; pthread_mutex_t mutex; |