From: Jan Kara Date: Mon, 7 Apr 2008 21:16:38 +0000 (+0200) Subject: udf: Silence warning about accesses beyond end of device X-Git-Tag: v2.6.26-rc1~1108^2~9 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4f7874c868eaedd0e64b2f6c800bc852bdc7f38b;p=linux-2.6-omap-h63xx.git 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 --- diff --git a/fs/udf/super.c b/fs/udf/super.c index b9e719de070..28ed3f5ebd7 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, 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);