@@ -28,7 +28,7 @@ static void _ocf_read_generic_hit_complete(struct ocf_request *req, int error)
2828 req -> cache );
2929
3030 if (error ) {
31- req -> error |= error ;
31+ env_atomic_cmpxchg ( & req -> error , 0 , error ) ;
3232 ocf_core_stats_cache_error_update (req -> core , OCF_READ );
3333 inc_fallback_pt_error_counter (req -> cache );
3434 }
@@ -40,13 +40,13 @@ static void _ocf_read_generic_hit_complete(struct ocf_request *req, int error)
4040 if (env_atomic_dec_return (& req -> req_remaining ) == 0 ) {
4141 OCF_DEBUG_RQ (req , "HIT completion" );
4242
43- if (req -> error ) {
43+ if (req -> error . counter ) {
4444 ocf_engine_push_req_front_pt (req );
4545 } else {
4646 ocf_req_unlock (c , req );
4747
4848 /* Complete request */
49- req -> complete (req , req -> error );
49+ req -> complete (req , req -> error . counter );
5050
5151 /* Free the request at the last point
5252 * of the completion path
@@ -61,7 +61,7 @@ static void _ocf_read_generic_miss_complete(struct ocf_request *req, int error)
6161 struct ocf_cache * cache = req -> cache ;
6262
6363 if (error )
64- req -> error = error ;
64+ env_atomic_cmpxchg ( & req -> error , 0 , error ) ;
6565
6666 /* Handle callback-caller race to let only one of the two complete the
6767 * request. Also, complete original request only if this is the last
@@ -70,12 +70,12 @@ static void _ocf_read_generic_miss_complete(struct ocf_request *req, int error)
7070 if (env_atomic_dec_return (& req -> req_remaining ) == 0 ) {
7171 OCF_DEBUG_RQ (req , "MISS completion" );
7272
73- if (req -> error ) {
73+ if (req -> error . counter ) {
7474 /*
7575 * --- Do not submit this request to write-back-thread.
7676 * Stop it here ---
7777 */
78- req -> complete (req , req -> error );
78+ req -> complete (req , req -> error . counter );
7979
8080 req -> info .core_error = 1 ;
8181 ocf_core_stats_core_error_update (req -> core , OCF_READ );
@@ -96,7 +96,7 @@ static void _ocf_read_generic_miss_complete(struct ocf_request *req, int error)
9696 req -> byte_length );
9797
9898 /* Complete request */
99- req -> complete (req , req -> error );
99+ req -> complete (req , req -> error . counter );
100100
101101 ocf_engine_backfill (req );
102102 }
0 commit comments