Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

isofs: Fix isofs_get_blocks for 8TB files

Currently isofs_get_blocks() was limited to handle only 4TB files on 32-bit
architectures because of unnecessary use of iblock variable which was signed
long. Just remove the variable. The error messages that were using this
variable should have rather used b_off anyway because that is the block we
are currently mapping.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by

Jan Kara and committed by
Al Viro
fde214d4 ebdec241

+8 -9
+8 -9
fs/isofs/inode.c
··· 962 962 * or getblk() if they are not. Returns the number of blocks inserted 963 963 * (-ve == error.) 964 964 */ 965 - int isofs_get_blocks(struct inode *inode, sector_t iblock_s, 965 + int isofs_get_blocks(struct inode *inode, sector_t iblock, 966 966 struct buffer_head **bh, unsigned long nblocks) 967 967 { 968 - unsigned long b_off; 968 + unsigned long b_off = iblock; 969 969 unsigned offset, sect_size; 970 970 unsigned int firstext; 971 971 unsigned long nextblk, nextoff; 972 - long iblock = (long)iblock_s; 973 972 int section, rv, error; 974 973 struct iso_inode_info *ei = ISOFS_I(inode); 975 974 976 975 error = -EIO; 977 976 rv = 0; 978 - if (iblock < 0 || iblock != iblock_s) { 977 + if (iblock != b_off) { 979 978 printk(KERN_DEBUG "%s: block number too large\n", __func__); 980 979 goto abort; 981 980 } 982 981 983 - b_off = iblock; 984 982 985 983 offset = 0; 986 984 firstext = ei->i_first_extent; ··· 996 998 * I/O errors. 997 999 */ 998 1000 if (b_off > ((inode->i_size + PAGE_CACHE_SIZE - 1) >> ISOFS_BUFFER_BITS(inode))) { 999 - printk(KERN_DEBUG "%s: block >= EOF (%ld, %ld)\n", 1000 - __func__, iblock, (unsigned long) inode->i_size); 1001 + printk(KERN_DEBUG "%s: block >= EOF (%lu, %llu)\n", 1002 + __func__, b_off, 1003 + (unsigned long long)inode->i_size); 1001 1004 goto abort; 1002 1005 } 1003 1006 ··· 1024 1025 if (++section > 100) { 1025 1026 printk(KERN_DEBUG "%s: More than 100 file sections ?!?" 1026 1027 " aborting...\n", __func__); 1027 - printk(KERN_DEBUG "%s: block=%ld firstext=%u sect_size=%u " 1028 + printk(KERN_DEBUG "%s: block=%lu firstext=%u sect_size=%u " 1028 1029 "nextblk=%lu nextoff=%lu\n", __func__, 1029 - iblock, firstext, (unsigned) sect_size, 1030 + b_off, firstext, (unsigned) sect_size, 1030 1031 nextblk, nextoff); 1031 1032 goto abort; 1032 1033 }