Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24.4 /fs/isofs/compress.c

Filename:/fs/isofs/compress.c
Lines Added:11
Lines Deleted:0
Also changed in: (Previous) 2.6.24.4-rc3  2.6.24.4-rc2  2.6.24.4-rc1  2.6.24  2.6.24-rc8  2.6.24-rc7 
(Following) 2.6.24.5  2.6.24.6  2.6.24.7  2.6.25-rc6-git8  2.6.25-rc7  2.6.25-rc8 

Location
[  2.6.24.4
  [  fs
    [  isofs
       o  compress.c

Patch

diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c
index 37dbd64..defb932 100644
--- a/fs/isofs/compress.c
+++ b/fs/isofs/compress.c
@@ -72,6 +72,17 @@ static int zisofs_readpage(struct file *file, struct page *page)
    offset = index & ~zisofs_block_page_mask;
    blockindex = offset >> zisofs_block_page_shift;
    maxpage = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+
+   /*
+    * If this page is wholly outside i_size we just return zero;
+    * 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++ ) {


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.