Open wzx-ipads opened 2 years ago
In int ext4_balloc_alloc_block(), ext4_fs_put_block_group_ref() should be called in early returns in line#440 and line#455.
int ext4_balloc_alloc_block()
ext4_fs_put_block_group_ref()
/* Try to find free block near to goal */ uint32_t tmp_idx; for (tmp_idx = idx_in_bg + 1; tmp_idx < end_idx; ++tmp_idx) { if (ext4_bmap_is_bit_clr(b.data, tmp_idx)) { ext4_bmap_bit_set(b.data, tmp_idx); ext4_balloc_set_bitmap_csum(sb, bg, b.data); ext4_trans_set_block_dirty(b.buf); r = ext4_block_set(inode_ref->fs->bdev, &b); if (r != EOK) return r; alloc = ext4_fs_bg_idx_to_addr(sb, tmp_idx, bg_id); goto success; } } /* Find free bit in bitmap */ r = ext4_bmap_bit_find_clr(b.data, idx_in_bg, blk_in_bg, &rel_blk_idx); if (r == EOK) { ext4_bmap_bit_set(b.data, rel_blk_idx); ext4_balloc_set_bitmap_csum(sb, bg_ref.block_group, b.data); ext4_trans_set_block_dirty(b.buf); r = ext4_block_set(inode_ref->fs->bdev, &b); if (r != EOK) return r; alloc = ext4_fs_bg_idx_to_addr(sb, rel_blk_idx, bg_id); goto success; }
In
int ext4_balloc_alloc_block()
,ext4_fs_put_block_group_ref()
should be called in early returns in line#440 and line#455.