Messages in this thread | | | Date | Tue, 10 Aug 2004 20:13:38 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: sendfile bugs(?) |
| |
On Tue, 10 Aug 2004, Prasanna Meda wrote: > > There seems to be couple of issues in sendfile code. > - read_write.c: sys_sendfile:do_sendfile checks for ppos > to be NULL, the intension is checking the contents for > zero.
No, it really checks the _pointer_ for NULL.
A NULL ptr means that it's not a pread interface, but that we should use f_pos. It's for when the user doesn't pass in any ppos thing: see sys_sendfile() for the two cases.
> - locks_verify_write() may checks at different offset for > permission, and copy at different offset, since it is also > using out_file->f_pos. And also it will be cleaner to > update out_file->f_pos atomically only when it succeeds. > It also deletes the dependency on f_pos from filemap.c.
Yes, this part is probably worth doing. It's probably _also_ worth doing something similar for the in-file f_pos thing (ie pass in a copy of f_pos the same way read/write does these days).
Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |