diff options
author | Sunil Kumar Acharya <sheggodu@redhat.com> | 2017-10-31 15:29:30 +0530 |
---|---|---|
committer | Xavier Hernandez <jahernan@redhat.com> | 2017-11-07 21:41:19 +0000 |
commit | 0e01963615a5ef510bbb806280f7590c16a2af4c (patch) | |
tree | c4f55da55267154f69f68416f21e724d8f89bc4b /xlators/cluster | |
parent | 54bf1a9d46eeb5c4582977eb2bc1d4fbd4f9dd91 (diff) |
cluster/ec: NEGATIVE_RETURNS coverity fix
Problem: Source could be negative.
Solution: Check has been added to verify the same.
BUG: 789278
Change-Id: I8cca6297327e7923b25949c20ec8d1a711207a76
Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/ec/src/ec-heal.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c index 7d4bed1b185..e4fbbc15a46 100644 --- a/xlators/cluster/ec/src/ec-heal.c +++ b/xlators/cluster/ec/src/ec-heal.c @@ -2144,6 +2144,11 @@ __ec_fd_data_adjust_versions (call_frame_t *frame, ec_t *ec, fd_t *fd, } } + if (source == -1) { + op_ret = -ENOTCONN; + goto out; + } + for (i = 0; i < ec->nodes; i++) { if (healed_sinks[i]) { ret = ec_data_undo_pending (frame, ec, fd, xattr, |