From 664e3fba9b2888c414e7bf9feca22bf71c716194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 8 Dec 2013 01:39:20 +0100 Subject: [PATCH] Partially revert 24d0e21f51e88ab35cc3f1c1750741dfeb40933d This reverts the extra for loop condition from "do_iterative_fd_io_iterate(): Support sparse files". When reading a file with more than 8 block_runs, get_vecs() would return B_BUFFER_OVERFLOW which would never create any subrequest due to the test on error == B_OK on the loop, but instead just fail. Except for the get_vecs() return code, where it is not wanted, the test made no sense as all other assignments are tested directly or passed around with break. Works for me but I don't guarantee it's completely correct. --- src/system/kernel/fs/vfs_request_io.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/system/kernel/fs/vfs_request_io.cpp b/src/system/kernel/fs/vfs_request_io.cpp index 8c42dbd1ab..1aefcc3081 100644 --- a/src/system/kernel/fs/vfs_request_io.cpp +++ b/src/system/kernel/fs/vfs_request_io.cpp @@ -165,9 +165,7 @@ do_iterative_fd_io_iterate(void* _cookie, io_request* request, // create subrequests for the file vecs we've got size_t subRequestCount = 0; - for (size_t i = 0; - i < vecCount && subRequestCount < kMaxSubRequests && error == B_OK; - i++) { + for (size_t i = 0; i < vecCount && subRequestCount < kMaxSubRequests; 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",