lkml.org 
[lkml]   [2008]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] ZISOFS : readpage over i_size fix
Read request over i_size will be dealed in do_generic_file_read.
So we just return 0 to avoid getting -EIO as normal reading,
let do_generic_file_read do the rest.

At the same time we need unlock the page to avoid system stuck.

For the bug report please see
http://bugzilla.kernel.org/show_bug.cgi?id=10227

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Acked-by: Jan Kara <jack@suse.cz>

---
fs/isofs/compress.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff -upr linux/fs/isofs/compress.c linux.new/fs/isofs/compress.c
--- linux/fs/isofs/compress.c 2008-03-17 18:07:44.000000000 +0800
+++ linux.new/fs/isofs/compress.c 2008-03-17 18:13:14.000000000 +0800
@@ -72,6 +72,16 @@ static int zisofs_readpage(struct file *
offset = index & ~zisofs_block_page_mask;
blockindex = offset >> zisofs_block_page_shift;
maxpage = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+
+ /* Here the outsize request we just return 0 because
+ do_generic_file_read will handle this for us */
+
+ if (page->index >= maxpage) {
+ SetPageUptodate(page);
+ unlock_page(page);
+ return 0;
+ }
+
maxpage = min(zisofs_block_pages, maxpage-offset);

for ( i = 0 ; i < maxpage ; i++, offset++ ) {

\
 
 \ /
  Last update: 2008-03-18 01:47    [W:0.022 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site