* The "bytes" as passed to {read|write}_file_io_vec_pages() was never
initialized, causing those functions to read|write a random amount. * This fixes bug #1614 - amazing how well the system worked with those randomly sized requests... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22901 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -358,7 +358,7 @@ bfs_read_pages(fs_volume _fs, fs_vnode _node, fs_cookie _cookie, off_t pos,
|
|||||||
|
|
||||||
bool bufferOverflow = status == B_BUFFER_OVERFLOW;
|
bool bufferOverflow = status == B_BUFFER_OVERFLOW;
|
||||||
|
|
||||||
size_t bytes;
|
size_t bytes = bytesLeft;
|
||||||
status = read_file_io_vec_pages(volume->Device(), fileVecs,
|
status = read_file_io_vec_pages(volume->Device(), fileVecs,
|
||||||
fileVecCount, vecs, count, &vecIndex, &vecOffset, &bytes);
|
fileVecCount, vecs, count, &vecIndex, &vecOffset, &bytes);
|
||||||
if (status != B_OK || !bufferOverflow)
|
if (status != B_OK || !bufferOverflow)
|
||||||
@@ -404,7 +404,7 @@ bfs_write_pages(fs_volume _fs, fs_vnode _node, fs_cookie _cookie, off_t pos,
|
|||||||
|
|
||||||
bool bufferOverflow = status == B_BUFFER_OVERFLOW;
|
bool bufferOverflow = status == B_BUFFER_OVERFLOW;
|
||||||
|
|
||||||
size_t bytes;
|
size_t bytes = bytesLeft;
|
||||||
status = write_file_io_vec_pages(volume->Device(), fileVecs,
|
status = write_file_io_vec_pages(volume->Device(), fileVecs,
|
||||||
fileVecCount, vecs, count, &vecIndex, &vecOffset, &bytes);
|
fileVecCount, vecs, count, &vecIndex, &vecOffset, &bytes);
|
||||||
if (status != B_OK || !bufferOverflow)
|
if (status != B_OK || !bufferOverflow)
|
||||||
|
|||||||
@@ -1505,7 +1505,7 @@ dosfs_read_pages(fs_volume _fs, fs_vnode _node, fs_cookie _cookie, off_t pos,
|
|||||||
struct file_io_vec fileVecs[8];
|
struct file_io_vec fileVecs[8];
|
||||||
uint32 fileVecCount = 8;
|
uint32 fileVecCount = 8;
|
||||||
bool bufferOverflow;
|
bool bufferOverflow;
|
||||||
size_t bytes;
|
size_t bytes = bytesLeft;
|
||||||
|
|
||||||
status = file_map_translate(node->file_map, pos, bytesLeft, fileVecs,
|
status = file_map_translate(node->file_map, pos, bytesLeft, fileVecs,
|
||||||
&fileVecCount);
|
&fileVecCount);
|
||||||
@@ -1557,7 +1557,7 @@ dosfs_write_pages(fs_volume _fs, fs_vnode _node, fs_cookie _cookie, off_t pos,
|
|||||||
struct file_io_vec fileVecs[8];
|
struct file_io_vec fileVecs[8];
|
||||||
uint32 fileVecCount = 8;
|
uint32 fileVecCount = 8;
|
||||||
bool bufferOverflow;
|
bool bufferOverflow;
|
||||||
size_t bytes;
|
size_t bytes = bytesLeft;
|
||||||
|
|
||||||
status = file_map_translate(node->file_map, pos, bytesLeft, fileVecs,
|
status = file_map_translate(node->file_map, pos, bytesLeft, fileVecs,
|
||||||
&fileVecCount);
|
&fileVecCount);
|
||||||
|
|||||||
Reference in New Issue
Block a user