Don't truncate read requests based on v_size; v_size can be stale in the

case of directories extended by subfilesystem. Rely on subfilesystem to
do read size truncating and return actual i/o size. This fixes bug 81 in
gforge, and unbreaks test 23.
This commit is contained in:
Ben Gras 2007-09-11 15:52:22 +00:00
parent 007bb33c7d
commit 38604e4e3a

View file

@ -150,7 +150,9 @@ int rw_flag; /* READING or WRITING */
/* Fill in request structure */
num_of_bytes = m_in.nbytes;
/* Truncate read request at size (mustn't do this for special files). */
#if 0 /* Don't truncate read request at size. The filesystem process will
* do this itself.
*/
if((rw_flag == READING) &&
cmp64ul(add64ul(position, num_of_bytes), vp->v_size) > 0) {
/* Position always should fit in an off_t (LONG_MAX). */
@ -162,6 +164,7 @@ int rw_flag; /* READING or WRITING */
num_of_bytes = vp->v_size - pos32;
assert(num_of_bytes >= 0);
}
#endif
/* Issue request */
r = req_readwrite(vp->v_fs_e, vp->v_inode_nr, vp->v_index, position,