aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2008-04-07 17:16:38 -0400
committerJan Kara <jack@suse.cz>2008-04-17 08:23:17 -0400
commit4f7874c868eaedd0e64b2f6c800bc852bdc7f38b (patch)
treeb663f87a4740cae9fdbeb09f9ee1a129ee4e618a /fs/udf
parent5fb28aa25ab0b71af2e441d68e63ad257e610a04 (diff)
udf: Silence warning about accesses beyond end of device
Some of the computed positions of anchor block could be beyond the end of device. Skip reading such blocks. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/super.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index b9e719de0704..28ed3f5ebd70 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -688,8 +688,12 @@ static int udf_check_anchor_block(struct super_block *sb, sector_t block,
688 uint16_t ident; 688 uint16_t ident;
689 uint32_t location; 689 uint32_t location;
690 690
691 if (varconv) 691 if (varconv) {
692 if (udf_fixed_to_variable(block) >=
693 sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits)
694 return 0;
692 bh = sb_bread(sb, udf_fixed_to_variable(block)); 695 bh = sb_bread(sb, udf_fixed_to_variable(block));
696 }
693 else 697 else
694 bh = sb_bread(sb, block); 698 bh = sb_bread(sb, block);
695 699