diff -NurpP --minimal linux-2.6.14.3-vs2.1.0-rc10/fs/read_write.c linux-2.6.14.3-vs2.1.0-rc10.1/fs/read_write.c --- linux-2.6.14.3-vs2.1.0-rc10/fs/read_write.c 2005-12-09 18:46:42.000000000 +0100 +++ linux-2.6.14.3-vs2.1.0-rc10.1/fs/read_write.c 2005-12-09 18:48:31.000000000 +0100 @@ -675,6 +675,11 @@ ssize_t vfs_sendfile(struct file *out_fi ret = in_file->f_op->sendfile(in_file, ppos, count, file_send_actor, out_file); + if (ret > 0) { + current->rchar += ret; + current->wchar += ret; + } + if (*ppos > max) return -EOVERFLOW; return ret; @@ -715,16 +720,9 @@ static ssize_t do_sendfile(int out_fd, i retval = vfs_sendfile(out_file, in_file, ppos, count, max); - if (retval > 0) { - current->rchar += retval; - current->wchar += retval; - } current->syscr++; current->syscw++; - if (*ppos > max) - retval = -EOVERFLOW; - fput_out: fput_light(out_file, fput_needed_out); fput_in: