Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
CORTX-33577: Fixed panic in degraded read, replaced assert with error…
Browse files Browse the repository at this point in the history
… code

* It might possible that in degraded mode we may land up in a situation
  where there are more than K failure and read_verify_is not true. In this
  case ideally, we should return proper error code (-EIO) instead of assert.

Signed-off-by: Yatin Mahajan <yatin.mahajan@seagate.com>
  • Loading branch information
yatin-mahajan committed Jul 8, 2022
1 parent d827ecf commit 26b1142
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions motr/io_nw_xfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1928,8 +1928,14 @@ static int nw_xfer_req_dispatch(struct nw_xfer_request *xfer)
* The units needed for recvoery are ready.
*/
M0_ASSERT(ioreq_sm_state(ioo) == IRS_DEGRADED_READING);
M0_ASSERT(op->op_code == M0_OC_READ &&
instance->m0c_config->mc_is_read_verify);
if (op->op_code == M0_OC_READ &&
instance->m0c_config->mc_is_read_verify) {
M0_LOG(M0_DEBUG, "As per design in Read verify mode");
} else {
M0_LOG(M0_ERROR, "More than K targets are offline");
rc = -EIO;
}

ioreq_sm_state_set_locked(ioo, IRS_READ_COMPLETE);
} else if (rc == 0)
xfer->nxr_state = NXS_INFLIGHT;
Expand Down

0 comments on commit 26b1142

Please sign in to comment.