-
Notifications
You must be signed in to change notification settings - Fork 85
Description
Description
In ocf_core_seq_cutoff_update() per-queue stream information is acquired and updated under req->io_queue->seq_cutoff lock. If stream is to be promoted, the same lock is acquired again together with core seq cutoff lock. It is possible that between the two critical sections the stream is modified, possibly invalidated and/or assigned to a different address. As a result we might promote a stream that is not suitable for promotion yet.
This would not occur in non-preemptive environments (SPDK, non-preemptive Linux kernel) and, based on our analysis, shouldn't affect kernel with voluntary preemption either.
Expected Behavior
Only streams matching promotion criteria are promoted.
Actual Behavior
Theoretically possible to promote a random stream in case of parallel execution of ocf_submit() in multiple threads associated with the same I/O queue.
Steps to Reproduce
no repro steps - defect found by means of static analysis
Context
Possible Fix
Verify that stream information matches our expectation inside the second critical section.