ext4: fix setup_new_group_blocks locking
authorEric Sandeen <sandeen@redhat.com>
Tue, 16 Oct 2007 22:38:25 +0000 (18:38 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 17 Oct 2007 22:50:04 +0000 (18:50 -0400)
setup_new_group_blocks() manipulates the group descriptor block bh
under the block_bitmap bh's lock.  It shouldn't matter since nobody
but resize should be touching these blocks, but it's worth fixing up.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
fs/ext4/resize.c

index 0a7e914c495a861625cd01834544531b15e2748b..484e5699f84873cbce200be44122fb482398666e 100644 (file)
@@ -199,10 +199,10 @@ static int setup_new_group_blocks(struct super_block *sb,
                        brelse(gdb);
                        goto exit_bh;
                }
-               lock_buffer(bh);
-               memcpy(gdb->b_data, sbi->s_group_desc[i]->b_data, bh->b_size);
+               lock_buffer(gdb);
+               memcpy(gdb->b_data, sbi->s_group_desc[i]->b_data, gdb->b_size);
                set_buffer_uptodate(gdb);
-               unlock_buffer(bh);
+               unlock_buffer(gdb);
                ext4_journal_dirty_metadata(handle, gdb);
                ext4_set_bit(bit, bh->b_data);
                brelse(gdb);