CreateSubRequest() could still return an error and break out of the
while loop without exiting the outer for loop.

Instead we reset the error code before entering the for loop.
This commit is contained in:
François Revol
2013-12-08 11:34:07 +01:00
parent 664e3fba9b
commit e36ad522d6
+6 -1
View File
@@ -163,9 +163,14 @@ do_iterative_fd_io_iterate(void* _cookie, io_request* request,
}
TRACE_RIO("[%ld] got %zu file vecs\n", find_thread(NULL), vecCount);
// Reset the error code for the loop below
error = B_OK;
// create subrequests for the file vecs we've got
size_t subRequestCount = 0;
for (size_t i = 0; i < vecCount && subRequestCount < kMaxSubRequests; i++) {
for (size_t i = 0;
i < vecCount && subRequestCount < kMaxSubRequests && error == B_OK;
i++) {
off_t vecOffset = vecs[i].offset;
off_t vecLength = min_c(vecs[i].length, (off_t)requestLength);
TRACE_RIO("[%ld] vec %lu offset: %lld, length: %lld\n",