readv/writev: do the same MAX_RW_COUNT truncation that read/write does
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 Oct 2010 17:36:49 +0000 (10:36 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 Oct 2010 17:36:49 +0000 (10:36 -0700)
commit7a0c73c5dded29e97d1fdc66cdbc996c0e1f7277
tree106df2617d42ace231e2fa9fcf1e0fd1075874ea
parentdafee7ceb45a6e38224e03cdb2dcefaa42cc8fb2
readv/writev: do the same MAX_RW_COUNT truncation that read/write does

We used to protect against overflow, but rather than return an error, do
what read/write does, namely to limit the total size to MAX_RW_COUNT.
This is not only more consistent, but it also means that any broken
low-level read/write routine that still keeps counts in 'int' can't
break.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/compat.c
fs/read_write.c
include/linux/fs.h