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

Commit 26b1142

Browse files
committed
CORTX-33577: Fixed panic in degraded read, replaced assert with error 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 <[email protected]>
1 parent d827ecf commit 26b1142

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

motr/io_nw_xfer.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,8 +1928,14 @@ static int nw_xfer_req_dispatch(struct nw_xfer_request *xfer)
19281928
* The units needed for recvoery are ready.
19291929
*/
19301930
M0_ASSERT(ioreq_sm_state(ioo) == IRS_DEGRADED_READING);
1931-
M0_ASSERT(op->op_code == M0_OC_READ &&
1932-
instance->m0c_config->mc_is_read_verify);
1931+
if (op->op_code == M0_OC_READ &&
1932+
instance->m0c_config->mc_is_read_verify) {
1933+
M0_LOG(M0_DEBUG, "As per design in Read verify mode");
1934+
} else {
1935+
M0_LOG(M0_ERROR, "More than K targets are offline");
1936+
rc = -EIO;
1937+
}
1938+
19331939
ioreq_sm_state_set_locked(ioo, IRS_READ_COMPLETE);
19341940
} else if (rc == 0)
19351941
xfer->nxr_state = NXS_INFLIGHT;

0 commit comments

Comments
 (0)