From: Ben Gras Date: Tue, 11 Sep 2007 15:52:22 +0000 (+0000) Subject: Don't truncate read requests based on v_size; v_size can be stale in the X-Git-Tag: v3.1.4~323 X-Git-Url: http://zhaoyanbai.com/repos//%22http:/%22%29?a=commitdiff_plain;h=38604e4e3a80ea742001379a3aed867a83ab81c2;p=minix.git 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. --- diff --git a/servers/vfs/read.c b/servers/vfs/read.c index d3660d6cf..8c874d0b1 100644 --- a/servers/vfs/read.c +++ b/servers/vfs/read.c @@ -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,