diff options
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r-- | fs/udf/super.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index fe0dafebde7..b9e719de070 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -709,14 +709,16 @@ static int udf_check_anchor_block(struct super_block *sb, sector_t block, | |||
709 | static sector_t udf_scan_anchors(struct super_block *sb, bool varconv, | 709 | static sector_t udf_scan_anchors(struct super_block *sb, bool varconv, |
710 | sector_t lastblock) | 710 | sector_t lastblock) |
711 | { | 711 | { |
712 | sector_t last[4]; | 712 | sector_t last[6]; |
713 | int i; | 713 | int i; |
714 | struct udf_sb_info *sbi = UDF_SB(sb); | 714 | struct udf_sb_info *sbi = UDF_SB(sb); |
715 | 715 | ||
716 | last[0] = lastblock; | 716 | last[0] = lastblock; |
717 | last[1] = last[0] - 2; | 717 | last[1] = last[0] - 1; |
718 | last[2] = last[0] - 150; | 718 | last[2] = last[0] + 1; |
719 | last[3] = last[0] - 152; | 719 | last[3] = last[0] - 2; |
720 | last[4] = last[0] - 150; | ||
721 | last[5] = last[0] - 152; | ||
720 | 722 | ||
721 | /* according to spec, anchor is in either: | 723 | /* according to spec, anchor is in either: |
722 | * block 256 | 724 | * block 256 |
@@ -727,6 +729,9 @@ static sector_t udf_scan_anchors(struct super_block *sb, bool varconv, | |||
727 | for (i = 0; i < ARRAY_SIZE(last); i++) { | 729 | for (i = 0; i < ARRAY_SIZE(last); i++) { |
728 | if (last[i] < 0) | 730 | if (last[i] < 0) |
729 | continue; | 731 | continue; |
732 | if (last[i] >= sb->s_bdev->bd_inode->i_size >> | ||
733 | sb->s_blocksize_bits) | ||
734 | continue; | ||
730 | 735 | ||
731 | if (udf_check_anchor_block(sb, last[i], varconv)) { | 736 | if (udf_check_anchor_block(sb, last[i], varconv)) { |
732 | sbi->s_anchor[0] = last[i]; | 737 | sbi->s_anchor[0] = last[i]; |