diff --git a/block/src/lib.rs b/block/src/lib.rs index 3b6d721c4..8f70805cc 100644 --- a/block/src/lib.rs +++ b/block/src/lib.rs @@ -668,9 +668,11 @@ where file.seek(SeekFrom::Start(offset as u64)) .map_err(AsyncIoError::ReadVectored)?; - // Read vectored - file.read_vectored(slices.as_mut_slice()) - .map_err(AsyncIoError::ReadVectored)? + let mut r = 0; + for b in slices.iter_mut() { + r += file.read(b).map_err(AsyncIoError::ReadVectored)?; + } + r }; completion_list.push_back((user_data, result as i32)); @@ -703,9 +705,11 @@ where file.seek(SeekFrom::Start(offset as u64)) .map_err(AsyncIoError::WriteVectored)?; - // Write vectored - file.write_vectored(slices.as_slice()) - .map_err(AsyncIoError::WriteVectored)? + let mut r = 0; + for b in slices.iter() { + r += file.write(b).map_err(AsyncIoError::WriteVectored)?; + } + r }; completion_list.push_back((user_data, result as i32));