Re: Nasty 2.6 sendfile() bug / regression; affects vsftpd

From: Linus Torvalds
Date: Sat Apr 17 2004 - 22:13:52 EST

On Sun, 18 Apr 2004 chris@xxxxxxxxxxxxxxxx wrote:
> Any chance you can review this and sneak into 2.6.soon?

Your patch is horribly ugly. How about this (much simpler) patch instead?

It just sets the "max" to zero if pos in NULL in the caller. That just
seems a much better/saner approach.

Can you test that this one-liner fixes the issue for you?


--- 1.37/fs/read_write.c Mon Apr 12 10:54:20 2004
+++ edited/fs/read_write.c Sat Apr 17 20:09:41 2004
@@ -635,7 +635,7 @@
return ret;

- return do_sendfile(out_fd, in_fd, NULL, count, MAX_NON_LFS);
+ return do_sendfile(out_fd, in_fd, NULL, count, 0);

asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t __user *offset, size_t count)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at