sendfile() has a limit of 2^31-1 bytes even on 64-bit platforms. Linus wants to maintain it in order to avoid potential future security bugs (always a good thing.) This patch changes the behaviour from returning EINVAL when this limit is exceeded to returning a short count. This means that a properly-written userspace program will simply loop around and continue; it will expose bugs in improperly-written userspace programs, which is also a good thing. Additionally, the limit becomes an issue that is completely contained within the kernel, and not encoded in the kernel ABI, so it can be changed in the future. (I set the limit to 2^31-PAGE_CACHE_SIZE so that a transfer that starts at the beginning of the file will continue to be page-aligned.) The Signed-off-by: H. Peter Anvin