diff options
Diffstat (limited to 'mm/filemap.c')
-rw-r--r-- | mm/filemap.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index d6846de08887..c4fe97f5ace0 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -2020,6 +2020,7 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i | |||
2020 | if (unlikely(*pos + *count > inode->i_sb->s_maxbytes)) | 2020 | if (unlikely(*pos + *count > inode->i_sb->s_maxbytes)) |
2021 | *count = inode->i_sb->s_maxbytes - *pos; | 2021 | *count = inode->i_sb->s_maxbytes - *pos; |
2022 | } else { | 2022 | } else { |
2023 | #ifdef CONFIG_BLOCK | ||
2023 | loff_t isize; | 2024 | loff_t isize; |
2024 | if (bdev_read_only(I_BDEV(inode))) | 2025 | if (bdev_read_only(I_BDEV(inode))) |
2025 | return -EPERM; | 2026 | return -EPERM; |
@@ -2031,6 +2032,9 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i | |||
2031 | 2032 | ||
2032 | if (*pos + *count > isize) | 2033 | if (*pos + *count > isize) |
2033 | *count = isize - *pos; | 2034 | *count = isize - *pos; |
2035 | #else | ||
2036 | return -EPERM; | ||
2037 | #endif | ||
2034 | } | 2038 | } |
2035 | return 0; | 2039 | return 0; |
2036 | } | 2040 | } |