diff options
author | Jan Kara <jack@suse.cz> | 2010-10-04 05:37:37 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-10-25 21:18:20 -0400 |
commit | fde214d414218fb6cace35708730986bcc94fb53 (patch) | |
tree | 8f3a1794979866c5f7a7101686ea8e45b7da67ad /fs | |
parent | ebdec241d509cf69f6ebf1ecdc036359d3dbe154 (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/isofs/inode.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 09ff41a752a0..60c2b944d762 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c | |||
@@ -962,25 +962,23 @@ static int isofs_statfs (struct dentry *dentry, struct kstatfs *buf) | |||
962 | * or getblk() if they are not. Returns the number of blocks inserted | 962 | * or getblk() if they are not. Returns the number of blocks inserted |
963 | * (-ve == error.) | 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 | struct buffer_head **bh, unsigned long nblocks) | 966 | struct buffer_head **bh, unsigned long nblocks) |
967 | { | 967 | { |
968 | unsigned long b_off; | 968 | unsigned long b_off = iblock; |
969 | unsigned offset, sect_size; | 969 | unsigned offset, sect_size; |
970 | unsigned int firstext; | 970 | unsigned int firstext; |
971 | unsigned long nextblk, nextoff; | 971 | unsigned long nextblk, nextoff; |
972 | long iblock = (long)iblock_s; | ||
973 | int section, rv, error; | 972 | int section, rv, error; |
974 | struct iso_inode_info *ei = ISOFS_I(inode); | 973 | struct iso_inode_info *ei = ISOFS_I(inode); |
975 | 974 | ||
976 | error = -EIO; | 975 | error = -EIO; |
977 | rv = 0; | 976 | rv = 0; |
978 | if (iblock < 0 || iblock != iblock_s) { | 977 | if (iblock != b_off) { |
979 | printk(KERN_DEBUG "%s: block number too large\n", __func__); | 978 | printk(KERN_DEBUG "%s: block number too large\n", __func__); |
980 | goto abort; | 979 | goto abort; |
981 | } | 980 | } |
982 | 981 | ||
983 | b_off = iblock; | ||
984 | 982 | ||
985 | offset = 0; | 983 | offset = 0; |
986 | firstext = ei->i_first_extent; | 984 | firstext = ei->i_first_extent; |
@@ -998,8 +996,9 @@ int isofs_get_blocks(struct inode *inode, sector_t iblock_s, | |||
998 | * I/O errors. | 996 | * I/O errors. |
999 | */ | 997 | */ |
1000 | if (b_off > ((inode->i_size + PAGE_CACHE_SIZE - 1) >> ISOFS_BUFFER_BITS(inode))) { | 998 | if (b_off > ((inode->i_size + PAGE_CACHE_SIZE - 1) >> ISOFS_BUFFER_BITS(inode))) { |
1001 | printk(KERN_DEBUG "%s: block >= EOF (%ld, %ld)\n", | 999 | printk(KERN_DEBUG "%s: block >= EOF (%lu, %llu)\n", |
1002 | __func__, iblock, (unsigned long) inode->i_size); | 1000 | __func__, b_off, |
1001 | (unsigned long long)inode->i_size); | ||
1003 | goto abort; | 1002 | goto abort; |
1004 | } | 1003 | } |
1005 | 1004 | ||
@@ -1025,9 +1024,9 @@ int isofs_get_blocks(struct inode *inode, sector_t iblock_s, | |||
1025 | if (++section > 100) { | 1024 | if (++section > 100) { |
1026 | printk(KERN_DEBUG "%s: More than 100 file sections ?!?" | 1025 | printk(KERN_DEBUG "%s: More than 100 file sections ?!?" |
1027 | " aborting...\n", __func__); | 1026 | " aborting...\n", __func__); |
1028 | printk(KERN_DEBUG "%s: block=%ld firstext=%u sect_size=%u " | 1027 | printk(KERN_DEBUG "%s: block=%lu firstext=%u sect_size=%u " |
1029 | "nextblk=%lu nextoff=%lu\n", __func__, | 1028 | "nextblk=%lu nextoff=%lu\n", __func__, |
1030 | iblock, firstext, (unsigned) sect_size, | 1029 | b_off, firstext, (unsigned) sect_size, |
1031 | nextblk, nextoff); | 1030 | nextblk, nextoff); |
1032 | goto abort; | 1031 | goto abort; |
1033 | } | 1032 | } |