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

Commit

Permalink
CORTX-33577: fix panic in degraded mode read (#1970)
Browse files Browse the repository at this point in the history
Problem:
It might be 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.

Solution:
Fixed panic in degraded read, replaced assert with error code.

Signed-off-by: Yatin Mahajan <yatin.mahajan@seagate.com>
  • Loading branch information
yatin-mahajan authored Aug 17, 2022
1 parent 62623f0 commit d0ba6b2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions motr/io_nw_xfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1925,11 +1925,17 @@ static int nw_xfer_req_dispatch(struct nw_xfer_request *xfer)
* In 'parity verify' mode, a whole parity group, including
* data and parity units are all read from ioservices.
* If some units failed to read, no need to read extra unit.
* The units needed for recvoery are ready.
* The units needed for recovery 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 d0ba6b2

Please sign in to comment.