DMAResource: Remove incorrect early unlock.

When bounce buffers were changed from fixed to dynamic in hrev27185, the
early unlock in case of physical vectors was not removed. This would
lead to an unprotected fBounceBuffers list and the possibility for
multiple operations to share the same bounce buffer vecs, leading to
disk corruption. This would not happen when used purely under the
IOScheduler as all translations are done from a single thread there.
With the nvme_disk driver that runs requests in parallel, this was
however easy to trigger.

Change-Id: I46bd55cd5d86174523d3f745b6c8800dae02babc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2524
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Michael Lotz 2020-04-28 01:31:32 +02:00 committed by waddlesplash
parent 5fd6feed3e
commit 943383c889

View File

@ -479,7 +479,6 @@ DMAResource::TranslateNext(IORequest* request, IOOperation* operation,
vecOffset = 0;
} else {
// We do already have physical addresses.
locker.Unlock();
vecs = buffer->Vecs();
segmentCount = min_c(buffer->VecCount() - vecIndex,
fRestrictions.max_segment_count);