Skip to content

Commit

Permalink
udf: Silence warning about accesses beyond end of device
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Kara committed Apr 17, 2008
1 parent 5fb28aa commit 4f7874c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/udf/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,12 @@ static int udf_check_anchor_block(struct super_block *sb, sector_t block,
uint16_t ident;
uint32_t location;

if (varconv)
if (varconv) {
if (udf_fixed_to_variable(block) >=
sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits)
return 0;
bh = sb_bread(sb, udf_fixed_to_variable(block));
}
else
bh = sb_bread(sb, block);

Expand Down

0 comments on commit 4f7874c

Please sign in to comment.