aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2008-04-28 05:16:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:43 -0400
commit8b91582500ae750db22bd515379616e5e9ad06ab (patch)
treea8af9408f1c8136504efbcae8cde5e8eeb4a1089 /fs/ext2
parent605afd60ef6dde254fc9b8667c5bccebade251c3 (diff)
ext2: retry block allocation if new blocks are allocated from system zone
If the block allocator gets blocks out of system zone ext2 calls ext2_error. But if the file system is mounted with errors=continue retry block allocation. We need to mark the system zone blocks as in use to make sure retry don't pick them again System zone is the block range mapping block bitmap, inode bitmap and inode table. [akpm@linux-foundation.org: fix typo in comment] Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: <linux-ext4@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ext2')
-rw-r--r--fs/ext2/balloc.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
index 25dec8633c94..10bb02c3f25c 100644
--- a/fs/ext2/balloc.c
+++ b/fs/ext2/balloc.c
@@ -149,11 +149,12 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group)
149 block_group, le32_to_cpu(desc->bg_block_bitmap)); 149 block_group, le32_to_cpu(desc->bg_block_bitmap));
150 return NULL; 150 return NULL;
151 } 151 }
152 if (!ext2_valid_block_bitmap(sb, desc, block_group, bh)) {
153 brelse(bh);
154 return NULL;
155 }
156 152
153 ext2_valid_block_bitmap(sb, desc, block_group, bh);
154 /*
155 * file system mounted not to panic on error, continue with corrupt
156 * bitmap
157 */
157 return bh; 158 return bh;
158} 159}
159 160
@@ -1380,7 +1381,12 @@ allocated:
1380 "Allocating block in system zone - " 1381 "Allocating block in system zone - "
1381 "blocks from "E2FSBLK", length %lu", 1382 "blocks from "E2FSBLK", length %lu",
1382 ret_block, num); 1383 ret_block, num);
1383 goto out; 1384 /*
1385 * ext2_try_to_allocate marked the blocks we allocated as in
1386 * use. So we may want to selectively mark some of the blocks
1387 * as free
1388 */
1389 goto retry_alloc;
1384 } 1390 }
1385 1391
1386 performed_allocation = 1; 1392 performed_allocation = 1;