aboutsummaryrefslogtreecommitdiffstats
path: root/fs/isofs/inode.c
diff options
context:
space:
mode:
authorJoel & Rebecca VanderZee <joel_vanderzee@yahoo.com>2006-09-29 05:00:30 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 12:18:15 -0400
commitfb50ae7446abb35184be029c51f825e45a4e0670 (patch)
tree493a51a67bf5c3505f2833a551554c12a45578bd /fs/isofs/inode.c
parente4b765551aa6355eae60b644bed851a9477c4e2b (diff)
[PATCH] I/O Error attempting to read last partial block of a file in an ISO9660 file system
There was an I/O error that prevented reading the last partial block of large files in an ISO9660 filesystem. The error was generated when a file comprised more than one section and had a size that was not an exact multiple of the filesystem block size. This patch removes the check (and failure) for reading into the last partial block (and possibly beyond) for multiple-section files. It worked in my testing to prevent reading beyond the end of the section; my first patch just incremented the sect_size block count for a partial block and continued doing the check. But there is a commment in the source code about reading beyond the end of the file to fill a page cache. Failing to access beyond the section would prevent reading beyond the end of the file. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/isofs/inode.c')
-rw-r--r--fs/isofs/inode.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 4527692f432b..c34b862cdbf2 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -960,30 +960,30 @@ int isofs_get_blocks(struct inode *inode, sector_t iblock_s,
960 goto abort; 960 goto abort;
961 } 961 }
962 962
963 if (nextblk) { 963 /* On the last section, nextblk == 0, section size is likely to
964 while (b_off >= (offset + sect_size)) { 964 * exceed sect_size by a partial block, and access beyond the
965 struct inode *ninode; 965 * end of the file will reach beyond the section size, too.
966 966 */
967 offset += sect_size; 967 while (nextblk && (b_off >= (offset + sect_size))) {
968 if (nextblk == 0) 968 struct inode *ninode;
969 goto abort; 969
970 ninode = isofs_iget(inode->i_sb, nextblk, nextoff); 970 offset += sect_size;
971 if (!ninode) 971 ninode = isofs_iget(inode->i_sb, nextblk, nextoff);
972 goto abort; 972 if (!ninode)
973 firstext = ISOFS_I(ninode)->i_first_extent; 973 goto abort;
974 sect_size = ISOFS_I(ninode)->i_section_size >> ISOFS_BUFFER_BITS(ninode); 974 firstext = ISOFS_I(ninode)->i_first_extent;
975 nextblk = ISOFS_I(ninode)->i_next_section_block; 975 sect_size = ISOFS_I(ninode)->i_section_size >> ISOFS_BUFFER_BITS(ninode);
976 nextoff = ISOFS_I(ninode)->i_next_section_offset; 976 nextblk = ISOFS_I(ninode)->i_next_section_block;
977 iput(ninode); 977 nextoff = ISOFS_I(ninode)->i_next_section_offset;
978 978 iput(ninode);
979 if (++section > 100) { 979
980 printk("isofs_get_blocks: More than 100 file sections ?!?, aborting...\n"); 980 if (++section > 100) {
981 printk("isofs_get_blocks: block=%ld firstext=%u sect_size=%u " 981 printk("isofs_get_blocks: More than 100 file sections ?!?, aborting...\n");
982 "nextblk=%lu nextoff=%lu\n", 982 printk("isofs_get_blocks: block=%ld firstext=%u sect_size=%u "
983 iblock, firstext, (unsigned) sect_size, 983 "nextblk=%lu nextoff=%lu\n",
984 nextblk, nextoff); 984 iblock, firstext, (unsigned) sect_size,
985 goto abort; 985 nextblk, nextoff);
986 } 986 goto abort;
987 } 987 }
988 } 988 }
989 989