diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-05-20 19:02:06 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-05-20 19:02:06 -0400 |
commit | 6171586a7ae5198988774e8480631e8d15f65dfe (patch) | |
tree | eef74bde60005c4e39c0c213030b27cb07a5c236 /fs/jffs2/scan.c | |
parent | fb9fbbcc9389edabb172ac1b6419c01e32046787 (diff) |
[JFFS2] Correct handling of JFFS2_FEATURE_RWCOMPAT_COPY nodes.
We should preserve these when we come to garbage collect them, not let
them get erased. Use jffs2_garbage_collect_pristine() for this, and make
sure the summary code copes -- just refrain from writing a summary for any
block which contains a node we don't understand.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2/scan.c')
-rw-r--r-- | fs/jffs2/scan.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 3cbe9f029e01..06637050749d 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c | |||
@@ -851,11 +851,22 @@ scan_more: | |||
851 | ofs += PAD(je32_to_cpu(node->totlen)); | 851 | ofs += PAD(je32_to_cpu(node->totlen)); |
852 | break; | 852 | break; |
853 | 853 | ||
854 | case JFFS2_FEATURE_RWCOMPAT_COPY: | 854 | case JFFS2_FEATURE_RWCOMPAT_COPY: { |
855 | struct jffs2_raw_node_ref *ref; | ||
855 | D1(printk(KERN_NOTICE "Unknown but compatible feature node (0x%04x) found at offset 0x%08x\n", je16_to_cpu(node->nodetype), ofs)); | 856 | D1(printk(KERN_NOTICE "Unknown but compatible feature node (0x%04x) found at offset 0x%08x\n", je16_to_cpu(node->nodetype), ofs)); |
856 | USED_SPACE(PAD(je32_to_cpu(node->totlen))); | 857 | |
858 | ref = jffs2_alloc_raw_node_ref(); | ||
859 | if (!ref) | ||
860 | return -ENOMEM; | ||
861 | ref->flash_offset = ofs | REF_PRISTINE; | ||
862 | ref->next_in_ino = 0; | ||
863 | jffs2_link_node_ref(c, jeb, ref, PAD(je32_to_cpu(node->totlen))); | ||
864 | |||
865 | /* We can't summarise nodes we don't grok */ | ||
866 | jffs2_sum_disable_collecting(s); | ||
857 | ofs += PAD(je32_to_cpu(node->totlen)); | 867 | ofs += PAD(je32_to_cpu(node->totlen)); |
858 | break; | 868 | break; |
869 | } | ||
859 | } | 870 | } |
860 | } | 871 | } |
861 | } | 872 | } |