Messages in this thread | | | Date | Sun, 23 Mar 1997 19:10:59 -0500 | From | Eric Youngdale <> | Subject | Re: mkisofs-1.10 now available. |
| |
I finally figured out why people keep getting I/O errors reading to the end of a cdrom. The page cache causes reads to be generated out from the end of the file to the next page boundary. A simple patch to the linux iso9660 filesystem seems to clear up the error.
-Eric
*** fs/isofs/inode.c.~3~ Sat Mar 15 10:05:46 1997 --- fs/isofs/inode.c Sun Mar 23 18:55:25 1997 *************** *** 532,537 **** --- 532,565 ---- printk("_isofs_bmap: block<0"); return 0; } + + /* + * If we are beyond the end of this file, don't give out any + * blocks. + */ + if( (block << ISOFS_BUFFER_BITS(inode)) > inode->i_size ) + { + off_t max_legal_read_offset; + + /* + * If we are *way* beyond the end of the file, print a message. + * Access beyond the end of the file up to the next page boundary + * is normal because of the way the page cache works. + * In this case, we just return 0 so that we can properly fill + * the page with useless information without generating any + * I/O errors. + */ + max_legal_read_offset = (inode->i_size + PAGE_SIZE - 1) + & ~(PAGE_SIZE - 1); + if( (block << ISOFS_BUFFER_BITS(inode)) >= max_legal_read_offset ) + { + + printk("_isofs_bmap: block>= EOF(%d, %d)", block, + inode->i_size); + } + return 0; + } + return (inode->u.isofs_i.i_first_extent >> ISOFS_BUFFER_BITS(inode)) + block; }
| |