diff options
Diffstat (limited to 'mm/filemap.c')
-rw-r--r-- | mm/filemap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 5efa9aaf7..51624abcf 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -127,7 +127,7 @@ repeat: goto repeat; } if (page_count(page) != 2) - printk("hm, busy page invalidated? (not necesserily a bug)\n"); + printk("hm, busy page invalidated? (not necessarily a bug)\n"); lru_cache_del(page); remove_page_from_inode_queue(page); @@ -912,6 +912,8 @@ static void generic_file_readahead(int reada_ok, ahead = 0; while (ahead < max_ahead) { ahead += PAGE_CACHE_SIZE; + if ((raend + ahead) >= inode->i_size) + break; page_cache_read(filp, raend + ahead); } /* @@ -1779,6 +1781,7 @@ generic_file_write(struct file *file, const char *buf, long status; int err; + down(&inode->i_sem); err = file->f_error; if (err) { file->f_error = 0; @@ -1872,6 +1875,7 @@ repeat_find: err = written ? written : status; out: + up(&inode->i_sem); return err; } |