diff options
Diffstat (limited to 'fs/jffs2/erase.c')
-rw-r--r-- | fs/jffs2/erase.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index ae858f878875..a3c6cc150497 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * | 7 | * |
8 | * For licensing information, see the file 'LICENCE' in this directory. | 8 | * For licensing information, see the file 'LICENCE' in this directory. |
9 | * | 9 | * |
10 | * $Id: erase.c,v 1.70 2005/02/09 09:09:01 pavlov Exp $ | 10 | * $Id: erase.c,v 1.71 2005/02/09 09:17:40 pavlov Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
@@ -310,7 +310,7 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb | |||
310 | int ret; | 310 | int ret; |
311 | uint32_t bad_offset; | 311 | uint32_t bad_offset; |
312 | 312 | ||
313 | if (!jffs2_cleanmarker_oob(c)) { | 313 | if ((!jffs2_cleanmarker_oob(c)) && (c->cleanmarker_size > 0)) { |
314 | marker_ref = jffs2_alloc_raw_node_ref(); | 314 | marker_ref = jffs2_alloc_raw_node_ref(); |
315 | if (!marker_ref) { | 315 | if (!marker_ref) { |
316 | printk(KERN_WARNING "Failed to allocate raw node ref for clean marker\n"); | 316 | printk(KERN_WARNING "Failed to allocate raw node ref for clean marker\n"); |
@@ -351,7 +351,7 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb | |||
351 | bad_offset += i; | 351 | bad_offset += i; |
352 | printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08x\n", datum, bad_offset); | 352 | printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08x\n", datum, bad_offset); |
353 | bad: | 353 | bad: |
354 | if (!jffs2_cleanmarker_oob(c)) | 354 | if ((!jffs2_cleanmarker_oob(c)) && (c->cleanmarker_size > 0)) |
355 | jffs2_free_raw_node_ref(marker_ref); | 355 | jffs2_free_raw_node_ref(marker_ref); |
356 | kfree(ebuf); | 356 | kfree(ebuf); |
357 | bad2: | 357 | bad2: |
@@ -387,6 +387,13 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb | |||
387 | jeb->used_size = 0; | 387 | jeb->used_size = 0; |
388 | jeb->dirty_size = 0; | 388 | jeb->dirty_size = 0; |
389 | jeb->wasted_size = 0; | 389 | jeb->wasted_size = 0; |
390 | } else if (c->cleanmarker_size == 0) { | ||
391 | jeb->first_node = jeb->last_node = NULL; | ||
392 | |||
393 | jeb->free_size = c->sector_size; | ||
394 | jeb->used_size = 0; | ||
395 | jeb->dirty_size = 0; | ||
396 | jeb->wasted_size = 0; | ||
390 | } else { | 397 | } else { |
391 | struct kvec vecs[1]; | 398 | struct kvec vecs[1]; |
392 | struct jffs2_unknown_node marker = { | 399 | struct jffs2_unknown_node marker = { |