Merge pull request #826 from mmichal10/errors-in-engines
Errors in engines
This commit is contained in:
commit
5531b9cc79
@ -21,10 +21,8 @@ static void _ocf_d2c_completion(struct ocf_request *req, int error)
|
|||||||
|
|
||||||
OCF_DEBUG_RQ(req, "Completion");
|
OCF_DEBUG_RQ(req, "Completion");
|
||||||
|
|
||||||
if (req->error) {
|
if (req->error)
|
||||||
req->info.core_error = 1;
|
|
||||||
ocf_core_stats_core_error_update(req->core, req->rw);
|
ocf_core_stats_core_error_update(req->core, req->rw);
|
||||||
}
|
|
||||||
|
|
||||||
/* Complete request */
|
/* Complete request */
|
||||||
req->complete(req, req->error);
|
req->complete(req, req->error);
|
||||||
|
@ -28,10 +28,8 @@ static void _ocf_read_pt_complete(struct ocf_request *req, int error)
|
|||||||
|
|
||||||
OCF_DEBUG_RQ(req, "Completion");
|
OCF_DEBUG_RQ(req, "Completion");
|
||||||
|
|
||||||
if (req->error) {
|
if (req->error)
|
||||||
req->info.core_error = 1;
|
|
||||||
ocf_core_stats_core_error_update(req->core, OCF_READ);
|
ocf_core_stats_core_error_update(req->core, OCF_READ);
|
||||||
}
|
|
||||||
|
|
||||||
/* Complete request */
|
/* Complete request */
|
||||||
req->complete(req, req->error);
|
req->complete(req, req->error);
|
||||||
|
@ -78,7 +78,6 @@ static void _ocf_read_generic_miss_complete(struct ocf_request *req, int error)
|
|||||||
*/
|
*/
|
||||||
req->complete(req, req->error);
|
req->complete(req, req->error);
|
||||||
|
|
||||||
req->info.core_error = 1;
|
|
||||||
ocf_core_stats_core_error_update(req->core, OCF_READ);
|
ocf_core_stats_core_error_update(req->core, OCF_READ);
|
||||||
|
|
||||||
ctx_data_free(cache->owner, req->cp_data);
|
ctx_data_free(cache->owner, req->cp_data);
|
||||||
|
@ -107,7 +107,6 @@ static void _ocf_write_wi_core_complete(struct ocf_request *req, int error)
|
|||||||
{
|
{
|
||||||
if (error) {
|
if (error) {
|
||||||
req->error = error;
|
req->error = error;
|
||||||
req->info.core_error = 1;
|
|
||||||
ocf_core_stats_core_error_update(req->core, OCF_WRITE);
|
ocf_core_stats_core_error_update(req->core, OCF_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +156,6 @@ static void _ocf_read_wo_core_complete(struct ocf_request *req, int error)
|
|||||||
{
|
{
|
||||||
if (error) {
|
if (error) {
|
||||||
req->error |= error;
|
req->error |= error;
|
||||||
req->info.core_error = 1;
|
|
||||||
ocf_core_stats_core_error_update(req->core, OCF_READ);
|
ocf_core_stats_core_error_update(req->core, OCF_READ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ static void _ocf_write_wt_do_flush_metadata_compl(struct ocf_request *req,
|
|||||||
|
|
||||||
ocf_req_unlock_wr(ocf_cache_line_concurrency(req->cache), req);
|
ocf_req_unlock_wr(ocf_cache_line_concurrency(req->cache), req);
|
||||||
|
|
||||||
req->complete(req, req->info.core_error ? req->error : 0);
|
req->complete(req, error);
|
||||||
|
|
||||||
ocf_req_put(req);
|
ocf_req_put(req);
|
||||||
}
|
}
|
||||||
@ -100,14 +100,9 @@ static void _ocf_write_wt_req_complete(struct ocf_request *req)
|
|||||||
|
|
||||||
OCF_DEBUG_RQ(req, "Completion");
|
OCF_DEBUG_RQ(req, "Completion");
|
||||||
|
|
||||||
if (req->error) {
|
if (req->info.cache_error || req->info.core_error) {
|
||||||
/* An error occured */
|
req->complete(req, req->error);
|
||||||
|
|
||||||
/* Complete request */
|
|
||||||
req->complete(req, req->info.core_error ? req->error : 0);
|
|
||||||
|
|
||||||
ocf_engine_invalidate(req);
|
ocf_engine_invalidate(req);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,9 +112,7 @@ static void _ocf_write_wt_req_complete(struct ocf_request *req)
|
|||||||
OCF_QUEUE_ALLOW_SYNC | OCF_QUEUE_PRIO_HIGH);
|
OCF_QUEUE_ALLOW_SYNC | OCF_QUEUE_PRIO_HIGH);
|
||||||
} else {
|
} else {
|
||||||
ocf_req_unlock_wr(ocf_cache_line_concurrency(req->cache), req);
|
ocf_req_unlock_wr(ocf_cache_line_concurrency(req->cache), req);
|
||||||
|
req->complete(req, 0);
|
||||||
req->complete(req, req->info.core_error ? req->error : 0);
|
|
||||||
|
|
||||||
ocf_req_put(req);
|
ocf_req_put(req);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,11 +120,14 @@ static void _ocf_write_wt_req_complete(struct ocf_request *req)
|
|||||||
static void _ocf_write_wt_cache_complete(struct ocf_request *req, int error)
|
static void _ocf_write_wt_cache_complete(struct ocf_request *req, int error)
|
||||||
{
|
{
|
||||||
if (error) {
|
if (error) {
|
||||||
req->error = req->error ?: error;
|
/* Cache error code is not propagated further to the user here
|
||||||
|
* because data could be successfully written to the core device
|
||||||
|
* despite the cache IO error.
|
||||||
|
* Error flag is set though to indicate that the error occurred
|
||||||
|
* and to invalidate the request in completion. */
|
||||||
|
req->info.cache_error = 1;
|
||||||
ocf_core_stats_cache_error_update(req->core, OCF_WRITE);
|
ocf_core_stats_cache_error_update(req->core, OCF_WRITE);
|
||||||
|
inc_fallback_pt_error_counter(req->cache);
|
||||||
if (req->error)
|
|
||||||
inc_fallback_pt_error_counter(req->cache);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_ocf_write_wt_req_complete(req);
|
_ocf_write_wt_req_complete(req);
|
||||||
|
@ -55,8 +55,11 @@ struct ocf_req_info {
|
|||||||
uint32_t cleaning_required : 1;
|
uint32_t cleaning_required : 1;
|
||||||
/*!< Eviction failed, need to request cleaning */
|
/*!< Eviction failed, need to request cleaning */
|
||||||
|
|
||||||
|
uint32_t cache_error : 1;
|
||||||
|
/*!< Error occurred during I/O on cache device */
|
||||||
|
|
||||||
uint32_t core_error : 1;
|
uint32_t core_error : 1;
|
||||||
/*!< Error occured during I/O on core device */
|
/*!< Error occurred during I/O on core device */
|
||||||
|
|
||||||
uint32_t cleaner_cache_line_lock : 1;
|
uint32_t cleaner_cache_line_lock : 1;
|
||||||
/*!< Cleaner flag - acquire cache line lock */
|
/*!< Cleaner flag - acquire cache line lock */
|
||||||
@ -192,6 +195,12 @@ struct ocf_request {
|
|||||||
int error;
|
int error;
|
||||||
/*!< This filed indicates an error for OCF request */
|
/*!< This filed indicates an error for OCF request */
|
||||||
|
|
||||||
|
int cache_error;
|
||||||
|
/*!< Indicator of forward IO cache device error */
|
||||||
|
|
||||||
|
int core_error;
|
||||||
|
/*!< Indicator of forward IO core device error */
|
||||||
|
|
||||||
ocf_part_id_t part_id;
|
ocf_part_id_t part_id;
|
||||||
/*!< Targeted partition of requests */
|
/*!< Targeted partition of requests */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user