diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-29 13:36:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-29 13:36:49 -0400 |
commit | 435f49a518c78eec8e2edbbadd912737246cbe20 (patch) | |
tree | 106df2617d42ace231e2fa9fcf1e0fd1075874ea /include/linux/fs.h | |
parent | f56f44001cb5b40089deac094dbb74e5c9f64d81 (diff) |
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>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4d07902bc50c..7b7b507ffa1c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1867,6 +1867,7 @@ extern int current_umask(void); | |||
1867 | /* /sys/fs */ | 1867 | /* /sys/fs */ |
1868 | extern struct kobject *fs_kobj; | 1868 | extern struct kobject *fs_kobj; |
1869 | 1869 | ||
1870 | #define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK) | ||
1870 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); | 1871 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); |
1871 | 1872 | ||
1872 | #define FLOCK_VERIFY_READ 1 | 1873 | #define FLOCK_VERIFY_READ 1 |