From b7840a68b9753de5d8926f2a299bcccba2d653e5 Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Wed, 6 Feb 2008 01:36:17 -0800 Subject: [PATCH] --- yaml --- r: 83380 b: refs/heads/master c: 7f0adaecede9ca68d9fcddae5a5a7ed6fc31a5e5 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ext2/balloc.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 15157002d132..1a91092ca01e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 73de76a0a42efa173c29aff32e555ac6de992573 +refs/heads/master: 7f0adaecede9ca68d9fcddae5a5a7ed6fc31a5e5 diff --git a/trunk/fs/ext2/balloc.c b/trunk/fs/ext2/balloc.c index 377ad172d74b..794008b6ce29 100644 --- a/trunk/fs/ext2/balloc.c +++ b/trunk/fs/ext2/balloc.c @@ -474,11 +474,13 @@ void ext2_free_blocks (struct inode * inode, unsigned long block, in_range (block, le32_to_cpu(desc->bg_inode_table), sbi->s_itb_per_group) || in_range (block + count - 1, le32_to_cpu(desc->bg_inode_table), - sbi->s_itb_per_group)) + sbi->s_itb_per_group)) { ext2_error (sb, "ext2_free_blocks", "Freeing blocks in system zones - " "Block = %lu, count = %lu", block, count); + goto error_return; + } for (i = 0, group_freed = 0; i < count; i++) { if (!ext2_clear_bit_atomic(sb_bgl_lock(sbi, block_group), @@ -1311,11 +1313,13 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal, in_range(ret_block, le32_to_cpu(gdp->bg_inode_table), EXT2_SB(sb)->s_itb_per_group) || in_range(ret_block + num - 1, le32_to_cpu(gdp->bg_inode_table), - EXT2_SB(sb)->s_itb_per_group)) + EXT2_SB(sb)->s_itb_per_group)) { ext2_error(sb, "ext2_new_blocks", "Allocating block in system zone - " "blocks from "E2FSBLK", length %lu", ret_block, num); + goto out; + } performed_allocation = 1;