diff options
-rw-r--r-- | kernel/file.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/file.c b/kernel/file.c index fe83c19..3e9b80b 100644 --- a/kernel/file.c +++ b/kernel/file.c @@ -148,7 +148,7 @@ static int fuse_cache_block(struct address_space *mapping, size_t end_index = ((bl_index + 1) << FUSE_BLOCK_PAGE_SHIFT) - 1; size_t file_end_index = inode->i_size >> PAGE_CACHE_SHIFT; - int i, error = 0; + int i; if (end_index > file_end_index) end_index = file_end_index; @@ -160,6 +160,9 @@ static int fuse_cache_block(struct address_space *mapping, page = find_or_create_page(mapping, index, GFP_NOFS); + if (!page) + return -1; + if (!Page_Uptodate(page)) { buffer = kmap(page); memcpy(buffer, bl_buf + i * PAGE_CACHE_SIZE, @@ -172,7 +175,7 @@ static int fuse_cache_block(struct address_space *mapping, page_cache_release(page); } - return error; + return 0; } static int fuse_file_read_block(struct inode *inode, char *bl_buf, |