aboutsummaryrefslogtreecommitdiffstats
path: root/fs/isofs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/isofs')
-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