diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-09 13:34:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-09 13:34:55 -0500 |
commit | 6e96783f586cc0a64651087cb518209a8577123f (patch) | |
tree | 8b74a5a8fda055ffeaa0c1ae3c070772599f8b3b /fs | |
parent | 8466c833799b30ab343c5108cd2e460f9f16c9d8 (diff) | |
parent | 0feba829ee82a6e43baabe3f0bdf91bd937a67a1 (diff) |
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6:
[JFFS2] print a message when marking bad block
[JFFS2] Check for all-zero node headers
[MTD] [OneNAND] Classify the page data and oob buffer
[MTD] [OneNAND] Exit the loop when transferring/filling of the oob is finished
[MTD] [OneNAND] add Nokia Copyright and a credit
[MTD] [OneNAND] Fix typo & wrong comments
[MTD] [OneNAND] Use oob buffer instead of main one in oob functions
[MTD] Correct partition failed erase address
[JFFS2] Use yield() between GC passes in background thread.
[MTD] [NAND] Correct misspelled preprocessor variable.
[MTD] [MAPS] dilnetpc: Fix printk warning
[MTD] [NOR] Fix oops in cfi_amdstd_sync
[MTD] ESB2 check for closed ROM window
[JFFS2] Fix writebuffer recovery in the first page of a block
[MTD] [NAND] make oobavail public
Diffstat (limited to 'fs')
-rw-r--r-- | fs/jffs2/background.c | 8 | ||||
-rw-r--r-- | fs/jffs2/readinode.c | 16 | ||||
-rw-r--r-- | fs/jffs2/scan.c | 9 | ||||
-rw-r--r-- | fs/jffs2/wbuf.c | 7 |
4 files changed, 36 insertions, 4 deletions
diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c index 6eb3daebd563..888f236e5494 100644 --- a/fs/jffs2/background.c +++ b/fs/jffs2/background.c | |||
@@ -99,7 +99,13 @@ static int jffs2_garbage_collect_thread(void *_c) | |||
99 | if (try_to_freeze()) | 99 | if (try_to_freeze()) |
100 | continue; | 100 | continue; |
101 | 101 | ||
102 | cond_resched(); | 102 | /* This thread is purely an optimisation. But if it runs when |
103 | other things could be running, it actually makes things a | ||
104 | lot worse. Use yield() and put it at the back of the runqueue | ||
105 | every time. Especially during boot, pulling an inode in | ||
106 | with read_inode() is much preferable to having the GC thread | ||
107 | get there first. */ | ||
108 | yield(); | ||
103 | 109 | ||
104 | /* Put_super will send a SIGKILL and then wait on the sem. | 110 | /* Put_super will send a SIGKILL and then wait on the sem. |
105 | */ | 111 | */ |
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index 58a0b912e9d0..717a48cf7df2 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c | |||
@@ -373,7 +373,14 @@ free_out: | |||
373 | static inline int read_unknown(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, struct jffs2_unknown_node *un) | 373 | static inline int read_unknown(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, struct jffs2_unknown_node *un) |
374 | { | 374 | { |
375 | /* We don't mark unknown nodes as REF_UNCHECKED */ | 375 | /* We don't mark unknown nodes as REF_UNCHECKED */ |
376 | BUG_ON(ref_flags(ref) == REF_UNCHECKED); | 376 | if (ref_flags(ref) == REF_UNCHECKED) { |
377 | JFFS2_ERROR("REF_UNCHECKED but unknown node at %#08x\n", | ||
378 | ref_offset(ref)); | ||
379 | JFFS2_ERROR("Node is {%04x,%04x,%08x,%08x}. Please report this error.\n", | ||
380 | je16_to_cpu(un->magic), je16_to_cpu(un->nodetype), | ||
381 | je32_to_cpu(un->totlen), je32_to_cpu(un->hdr_crc)); | ||
382 | return 1; | ||
383 | } | ||
377 | 384 | ||
378 | un->nodetype = cpu_to_je16(JFFS2_NODE_ACCURATE | je16_to_cpu(un->nodetype)); | 385 | un->nodetype = cpu_to_je16(JFFS2_NODE_ACCURATE | je16_to_cpu(un->nodetype)); |
379 | 386 | ||
@@ -576,6 +583,13 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf | |||
576 | jffs2_mark_node_obsolete(c, ref); | 583 | jffs2_mark_node_obsolete(c, ref); |
577 | goto cont; | 584 | goto cont; |
578 | } | 585 | } |
586 | /* Due to poor choice of crc32 seed, an all-zero node will have a correct CRC */ | ||
587 | if (!je32_to_cpu(node->u.hdr_crc) && !je16_to_cpu(node->u.nodetype) && | ||
588 | !je16_to_cpu(node->u.magic) && !je32_to_cpu(node->u.totlen)) { | ||
589 | JFFS2_NOTICE("All zero node header at %#08x.\n", ref_offset(ref)); | ||
590 | jffs2_mark_node_obsolete(c, ref); | ||
591 | goto cont; | ||
592 | } | ||
579 | 593 | ||
580 | switch (je16_to_cpu(node->u.nodetype)) { | 594 | switch (je16_to_cpu(node->u.nodetype)) { |
581 | 595 | ||
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 31c1475d922a..7fb45bd4915c 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c | |||
@@ -734,6 +734,15 @@ scan_more: | |||
734 | ofs += 4; | 734 | ofs += 4; |
735 | continue; | 735 | continue; |
736 | } | 736 | } |
737 | /* Due to poor choice of crc32 seed, an all-zero node will have a correct CRC */ | ||
738 | if (!je32_to_cpu(node->hdr_crc) && !je16_to_cpu(node->nodetype) && | ||
739 | !je16_to_cpu(node->magic) && !je32_to_cpu(node->totlen)) { | ||
740 | noisy_printk(&noise, "jffs2_scan_eraseblock(): All zero node header at 0x%08x.\n", ofs); | ||
741 | if ((err = jffs2_scan_dirty_space(c, jeb, 4))) | ||
742 | return err; | ||
743 | ofs += 4; | ||
744 | continue; | ||
745 | } | ||
737 | 746 | ||
738 | if (ofs + je32_to_cpu(node->totlen) > | 747 | if (ofs + je32_to_cpu(node->totlen) > |
739 | jeb->offset + c->sector_size) { | 748 | jeb->offset + c->sector_size) { |
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c index de718e3a1692..4fac6dd53954 100644 --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c | |||
@@ -238,7 +238,10 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c) | |||
238 | jeb = &c->blocks[c->wbuf_ofs / c->sector_size]; | 238 | jeb = &c->blocks[c->wbuf_ofs / c->sector_size]; |
239 | 239 | ||
240 | spin_lock(&c->erase_completion_lock); | 240 | spin_lock(&c->erase_completion_lock); |
241 | jffs2_block_refile(c, jeb, REFILE_NOTEMPTY); | 241 | if (c->wbuf_ofs % c->mtd->erasesize) |
242 | jffs2_block_refile(c, jeb, REFILE_NOTEMPTY); | ||
243 | else | ||
244 | jffs2_block_refile(c, jeb, REFILE_ANYWAY); | ||
242 | spin_unlock(&c->erase_completion_lock); | 245 | spin_unlock(&c->erase_completion_lock); |
243 | 246 | ||
244 | BUG_ON(!ref_obsolete(jeb->last_node)); | 247 | BUG_ON(!ref_obsolete(jeb->last_node)); |
@@ -1087,7 +1090,7 @@ int jffs2_write_nand_badblock(struct jffs2_sb_info *c, struct jffs2_eraseblock * | |||
1087 | if (!c->mtd->block_markbad) | 1090 | if (!c->mtd->block_markbad) |
1088 | return 1; // What else can we do? | 1091 | return 1; // What else can we do? |
1089 | 1092 | ||
1090 | D1(printk(KERN_WARNING "jffs2_write_nand_badblock(): Marking bad block at %08x\n", bad_offset)); | 1093 | printk(KERN_WARNING "JFFS2: marking eraseblock at %08x\n as bad", bad_offset); |
1091 | ret = c->mtd->block_markbad(c->mtd, bad_offset); | 1094 | ret = c->mtd->block_markbad(c->mtd, bad_offset); |
1092 | 1095 | ||
1093 | if (ret) { | 1096 | if (ret) { |