Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101082
b: refs/heads/master
c: 7e5a8cd
h: refs/heads/master
v: v3
  • Loading branch information
Shen Feng authored and Theodore Ts'o committed Jul 14, 2008
1 parent becef1a commit b9b9b25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cfbe7e4f5e4a0e1fc2ff23b167bfb3fa992f623d
refs/heads/master: 7e5a8cdd843b7af8d6d38a9bf96306145edb66e0
13 changes: 5 additions & 8 deletions trunk/fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ static void mb_set_bits(spinlock_t *lock, void *bm, int cur, int len)
}
}

static int mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b,
static void mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b,
int first, int count)
{
int block = 0;
Expand Down Expand Up @@ -1091,11 +1091,12 @@ static int mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b,
blocknr += block;
blocknr +=
le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block);

ext4_unlock_group(sb, e4b->bd_group);
ext4_error(sb, __func__, "double-free of inode"
" %lu's block %llu(bit %u in group %lu)\n",
inode ? inode->i_ino : 0, blocknr, block,
e4b->bd_group);
ext4_lock_group(sb, e4b->bd_group);
}
mb_clear_bit(block, EXT4_MB_BITMAP(e4b));
e4b->bd_info->bb_counters[order]++;
Expand Down Expand Up @@ -1133,8 +1134,6 @@ static int mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b,
} while (1);
}
mb_check_buddy(e4b);

return 0;
}

static int mb_find_extent(struct ext4_buddy *e4b, int order, int block,
Expand Down Expand Up @@ -2570,8 +2569,7 @@ ext4_mb_free_committed_blocks(struct super_block *sb)
ext4_lock_group(sb, md->group);
for (i = 0; i < md->num; i++) {
mb_debug(" %u", md->blocks[i]);
err = mb_free_blocks(NULL, &e4b, md->blocks[i], 1);
BUG_ON(err != 0);
mb_free_blocks(NULL, &e4b, md->blocks[i], 1);
}
mb_debug("\n");
ext4_unlock_group(sb, md->group);
Expand Down Expand Up @@ -4333,10 +4331,9 @@ void ext4_mb_free_blocks(handle_t *handle, struct inode *inode,
ext4_mb_free_metadata(handle, &e4b, block_group, bit, count);
} else {
ext4_lock_group(sb, block_group);
err = mb_free_blocks(inode, &e4b, bit, count);
mb_free_blocks(inode, &e4b, bit, count);
ext4_mb_return_to_preallocation(inode, &e4b, block, count);
ext4_unlock_group(sb, block_group);
BUG_ON(err != 0);
}

spin_lock(sb_bgl_lock(sbi, block_group));
Expand Down

0 comments on commit b9b9b25

Please sign in to comment.