Patch for 2.6.25 queue
This diff contain mballoc fixes and update for ext3-4 migrate patch.
Testing:
ext3 to ext4 migration.
I will be putting the patch queue for abat test now.
-aneesh
fs/ext4/extents.c +1 -1
@@ -62,7 +62,7 @@ static ext4_fsblk_t ext_pblock(struct ext4_extent *ex)* idx_pblock: * combine low and high parts of a leaf physical block number into ext4_fsblk_t */ -static ext4_fsblk_t idx_pblock (struct ext4_extent_idx *ix) +ext4_fsblk_t idx_pblock (struct ext4_extent_idx *ix) {ext4_fsblk_t block;
fs/ext4/mballoc.c +1 -2
@@ -2723,7 +2723,7 @@ int ext4_mb_release(struct super_block *sb)#endif ext4_lock_group (sb, i);ext4_mb_cleanup_pa (grinfo); -ext4_lock_group (sb, i); +ext4_unlock_group (sb, i);kfree (grinfo); } num_meta_group_infos = (sbi->s_groups_count +
@@ -4452,7 +4452,6 @@ do_more: overflow = bit + count -EXT4_BLOCKS_PER_GROUP (sb); count -= overflow; } -put_bh (bitmap_bh); bitmap_bh =read_block_bitmap (sb, block_group);if (!bitmap_bh) goto error_return;
fs/ext4/migrate.c +2 -13
@@ -342,16 +342,6 @@ err_out:return retval; } -/* Will go away */ -static ext4_fsblk_t idx_pblock (struct ext4_extent_idx *ix) -{ -ext4_fsblk_t block; - - block =le32_to_cpu (ix->ei_leaf_lo); - block |= ((ext4_fsblk_t )le16_to_cpu (ix->ei_leaf_hi) <<31 ) <<1 ; -return block; -} -static int free_ext_idx (handle_t *handle,struct inode *inode,struct ext4_extent_idx *ix) {
@@ -366,9 +356,7 @@ static int free_ext_idx(handle_t *handle, struct inode *inode,return -EIO ; eh = (struct ext4_extent_header *)bh->b_data; -if (eh->eh_depth ==0 ) -ext4_free_blocks (handle, inode, block,1 ,1 ); -else { +if (eh->eh_depth !=0 ) { ix =EXT_FIRST_INDEX (eh);for (i =0 ; i <le16_to_cpu (eh->eh_entries); i++, ix++) { retval =free_ext_idx (handle, inode, ix);
@@ -377,6 +365,7 @@ static int free_ext_idx(handle_t *handle, struct inode *inode, } }put_bh (bh); +ext4_free_blocks (handle, inode, block,1 ,1 );return retval; }
include/linux/ext4_fs_extents.h +1 -0
@@ -212,6 +212,7 @@ static inline int ext4_ext_get_actual_len(struct ext4_extent *ext) (le16_to_cpu(ext->ee_len) - EXT_INIT_MAX_LEN)); } +extern ext4_fsblk_t idx_pblock (struct ext4_extent_idx *);extern void ext4_ext_store_pblock (struct ext4_extent *,ext4_fsblk_t );extern int ext4_extent_tree_init (handle_t *,struct inode *);extern int ext4_ext_calc_credits_for_insert (struct inode *,struct ext4_ext_path *);
Theodore Tso
maintainerQuoted 1 line · Aneesh Kumar K.V
This diff contain mballoc fixes and update for ext3-4 migrate patch.
I will fold these patches into the patch queue in the proper places (and adjust other patches as necessary).
fs/ext4/mballoc.c do_more: · line 4457
Quoted 12 lines
fs/ext4/mballoc.c +0
-1@@ -4452,7 +4452,6 @@ do_more: overflow = bit + count -EXT4_BLOCKS_PER_GROUP (sb); count -= overflow; } -put_bh (bitmap_bh); bitmap_bh =read_block_bitmap (sb, block_group);if (!bitmap_bh) goto error_return;
This patch hunk causes a failure due to a botched brelse->put_bh conversion, but removing it isn't the right fix. It was there to avoid a buffer leak on a goto. So the right fix is to remove the put_bh() above, but to add one here, circa line 4542 of mballoc.c:
if (overflow && !err) {
block += count;
count = overflow;
+ put_bh(bitmap_bh);
goto do_more;
}And once we do that, we can drop the initialization of bitmap_bh to NULL, circa line 4408:
int metadata, unsigned long *freed)
{
- struct buffer_head *bitmap_bh = NULL;
+ struct buffer_head *bitmap_bh; struct super_block *sb = inode->i_sb; struct ext4_allocation_context ac; - Ted
Theodore Tso
maintainerQuoted 2 lines · Theodore Tso
This patch hunk causes a failure due to a botched
brelse->put_bhconversion, but removing it isn't the right fix.
Err, sorry, the above should read, "This patch hunk FIXES a failure"...
and if it wasn't clear, I was responsible for the initial botched conversion. :-)
- Ted