Fix race condition during cache attach

After attaching new cache device handle all the IOs in Pass-Through mode
until all the d2c requests are completed.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
Robert Baldyga
2024-11-21 21:26:00 +01:00
parent 2c28f33e37
commit 0d06b3a597
3 changed files with 27 additions and 3 deletions

View File

@@ -162,6 +162,11 @@ void ocf_resolve_effective_cache_mode(ocf_cache_t cache,
return;
}
if (env_atomic_read(&cache->attach_pt)) {
req->cache_mode = ocf_req_cache_mode_pt;
return;
}
if (cache->pt_unaligned_io && !ocf_req_is_4k(req->addr, req->bytes)) {
req->cache_mode = ocf_req_cache_mode_pt;
return;