From 0e01963615a5ef510bbb806280f7590c16a2af4c Mon Sep 17 00:00:00 2001 From: Sunil Kumar Acharya Date: Tue, 31 Oct 2017 15:29:30 +0530 Subject: 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 --- xlators/cluster/ec/src/ec-heal.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c index 7d4bed1b18..e4fbbc15a4 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, -- cgit