aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-05-27 08:15:16 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-27 08:15:16 -0400
commitddc58bd65ebe58c243e9f609384825df9ffd04ad (patch)
tree6a88d6293af01e89daa2dc38e1463c7493c688cb /fs/jffs2
parentba0251fe87ea560eb377917e06ba0b5b9ab89094 (diff)
[JFFS2] Fix wbuf recovery of f->metadata->raw node.
A data node might not be in the fraglist; it could be f->metadata. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/wbuf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
index 2febece89062..717fa2f52ac2 100644
--- a/fs/jffs2/wbuf.c
+++ b/fs/jffs2/wbuf.c
@@ -190,6 +190,10 @@ static struct jffs2_raw_node_ref **jffs2_incore_replace_raw(struct jffs2_sb_info
190 190
191 switch (je16_to_cpu(node->u.nodetype)) { 191 switch (je16_to_cpu(node->u.nodetype)) {
192 case JFFS2_NODETYPE_INODE: 192 case JFFS2_NODETYPE_INODE:
193 if (f->metadata && f->metadata->raw == raw) {
194 dbg_noderef("Will replace ->raw in f->metadata at %p\n", f->metadata);
195 return &f->metadata->raw;
196 }
193 frag = jffs2_lookup_node_frag(&f->fragtree, je32_to_cpu(node->i.offset)); 197 frag = jffs2_lookup_node_frag(&f->fragtree, je32_to_cpu(node->i.offset));
194 BUG_ON(!frag); 198 BUG_ON(!frag);
195 /* Find a frag which refers to the full_dnode we want to modify */ 199 /* Find a frag which refers to the full_dnode we want to modify */
@@ -199,7 +203,6 @@ static struct jffs2_raw_node_ref **jffs2_incore_replace_raw(struct jffs2_sb_info
199 } 203 }
200 dbg_noderef("Will replace ->raw in full_dnode at %p\n", frag->node); 204 dbg_noderef("Will replace ->raw in full_dnode at %p\n", frag->node);
201 return &frag->node->raw; 205 return &frag->node->raw;
202 break;
203 206
204 case JFFS2_NODETYPE_DIRENT: 207 case JFFS2_NODETYPE_DIRENT:
205 for (fd = f->dents; fd; fd = fd->next) { 208 for (fd = f->dents; fd; fd = fd->next) {
@@ -209,6 +212,7 @@ static struct jffs2_raw_node_ref **jffs2_incore_replace_raw(struct jffs2_sb_info
209 } 212 }
210 } 213 }
211 BUG(); 214 BUG();
215
212 default: 216 default:
213 dbg_noderef("Don't care about replacing raw for nodetype %x\n", 217 dbg_noderef("Don't care about replacing raw for nodetype %x\n",
214 je16_to_cpu(node->u.nodetype)); 218 je16_to_cpu(node->u.nodetype));