Messages in this thread Patch in this message | | | Date | Tue, 5 Aug 1997 23:12:01 +0200 | From | "Dr. Werner Fink" <> | Subject | Re: New pre-2.0.31 patches.. |
| |
> > o some isofs fixes
This one is apended to this message.
Werner
----------------------------------------------------------------------- diff -urN linux-2.0.31-linus/fs/isofs/inode.c linux/fs/isofs/inode.c --- linux-2.0.31-linus/fs/isofs/inode.c Sat Aug 17 20:19:28 1996 +++ linux/fs/isofs/inode.c Tue Aug 5 23:06:56 1997 @@ -476,6 +476,34 @@ 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; } diff -urN linux-2.0.31-linus/fs/isofs/namei.c linux/fs/isofs/namei.c --- linux-2.0.31-linus/fs/isofs/namei.c Sat Nov 30 11:21:20 1996 +++ linux/fs/isofs/namei.c Tue Aug 5 23:06:56 1997 @@ -242,9 +242,12 @@ if (!ino) { char *lcname; - /* If mounted with check=relaxed (and most likely norock), - then first convert this name to lower case. */ - if (dir->i_sb->u.isofs_sb.s_name_check == 'r' + /* First try the original name. If that doesn't work and the fs + * was mounted with check=relaxed, convert the name to lower + * case and try again. + */ + if (!(bh = isofs_find_entry(dir,name,len, &ino, &ino_back)) + && dir->i_sb->u.isofs_sb.s_name_check == 'r' && (lcname = kmalloc(len, GFP_KERNEL)) != NULL) { int i; char c; @@ -256,8 +259,7 @@ } bh = isofs_find_entry(dir,lcname,len, &ino, &ino_back); kfree(lcname); - } else - bh = isofs_find_entry(dir,name,len, &ino, &ino_back); + } if (!bh) { iput(dir);
| |