Public bug reported:

W're getting the »invalid block bitmap« error since kernel 3.13.0-157

see 
https://github.com/torvalds/linux/commit/22be37acce25d66ecf6403fc8f44df9c5ded2372

and in this diff the error is within
»if (offset < 0 || EXT4_B2C(sbi, offset) >= sb->s_blocksize ||«

Kind regards, J. Barth

*** linux_3.13.0-155.205.diff   2018-08-28 14:56:04.357521118 +0200
--- linux_3.13.0-157.207.diff   2018-08-28 14:48:27.168863046 +0200
***************
*** 31,37 ****
   }
   
   /* Return the number of free blocks in a block group.  It is used when
! @@ -419,11 +420,15 @@
        }
        ext4_lock_group(sb, block_group);
        if (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
--- 31,102 ----
   }
   
   /* Return the number of free blocks in a block group.  It is used when
! @@ -307,6 +308,7 @@
!                                           ext4_group_t block_group,
!                                           struct buffer_head *bh)
!  {
! +     struct ext4_sb_info *sbi = EXT4_SB(sb);
!       ext4_grpblk_t offset;
!       ext4_grpblk_t next_zero_bit;
!       ext4_fsblk_t blk;
! @@ -326,24 +328,30 @@
!       /* check whether block bitmap block number is set */
!       blk = ext4_block_bitmap(sb, desc);
!       offset = blk - group_first_block;
! -     if (!ext4_test_bit(offset, bh->b_data))
! +     if (offset < 0 || EXT4_B2C(sbi, offset) >= sb->s_blocksize ||
! +         !ext4_test_bit(EXT4_B2C(sbi, offset), bh->b_data))
!               /* bad block bitmap */
!               return blk;
!  
!       /* check whether the inode bitmap block number is set */
!       blk = ext4_inode_bitmap(sb, desc);
!       offset = blk - group_first_block;
! -     if (!ext4_test_bit(offset, bh->b_data))
! +     if (offset < 0 || EXT4_B2C(sbi, offset) >= sb->s_blocksize ||
! +         !ext4_test_bit(EXT4_B2C(sbi, offset), bh->b_data))
!               /* bad block bitmap */
!               return blk;
!  
!       /* check whether the inode table block number is set */
!       blk = ext4_inode_table(sb, desc);
!       offset = blk - group_first_block;
! +     if (offset < 0 || EXT4_B2C(sbi, offset) >= sb->s_blocksize ||
! +         EXT4_B2C(sbi, offset + sbi->s_itb_per_group) >= sb->s_blocksize)
! +             return blk;
!       next_zero_bit = ext4_find_next_zero_bit(bh->b_data,
! -                             offset + EXT4_SB(sb)->s_itb_per_group,
! -                             offset);
! -     if (next_zero_bit < offset + EXT4_SB(sb)->s_itb_per_group)
! +                     EXT4_B2C(sbi, offset + EXT4_SB(sb)->s_itb_per_group),
! +                     EXT4_B2C(sbi, offset));
! +     if (next_zero_bit <
! +         EXT4_B2C(sbi, offset + EXT4_SB(sb)->s_itb_per_group))
!               /* bad bitmap for inode tables */
!               return blk;
!       return 0;
! @@ -394,6 +402,7 @@
!  ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t 
block_group)
!  {
!       struct ext4_group_desc *desc;
! +     struct ext4_sb_info *sbi = EXT4_SB(sb);
!       struct buffer_head *bh;
!       ext4_fsblk_t bitmap_blk;
!  
! @@ -401,6 +410,12 @@
!       if (!desc)
!               return NULL;
!       bitmap_blk = ext4_block_bitmap(sb, desc);
! +     if ((bitmap_blk <= le32_to_cpu(sbi->s_es->s_first_data_block)) ||
! +         (bitmap_blk >= ext4_blocks_count(sbi->s_es))) {
! +             ext4_error(sb, "Invalid block bitmap block %llu in "
! +                        "block_group %u", bitmap_blk, block_group);
! +             return ERR_PTR(-EIO);
! +     }
!       bh = sb_getblk(sb, bitmap_blk);
!       if (unlikely(!bh)) {
!               ext4_error(sb, "Cannot get buffer for block bitmap - "
! @@ -419,11 +434,15 @@
        }
        ext4_lock_group(sb, block_group);
        if (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1789435

Title:
  kernel 3.13.0-157+158: ext4: wrong error message »invalid block
  bitmap«

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1789435/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to