Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

+5 -1
+5 -1
fs/jffs2/wbuf.c
··· 190 190 191 191 switch (je16_to_cpu(node->u.nodetype)) { 192 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 197 frag = jffs2_lookup_node_frag(&f->fragtree, je32_to_cpu(node->i.offset)); 194 198 BUG_ON(!frag); 195 199 /* Find a frag which refers to the full_dnode we want to modify */ ··· 203 199 } 204 200 dbg_noderef("Will replace ->raw in full_dnode at %p\n", frag->node); 205 201 return &frag->node->raw; 206 - break; 207 202 208 203 case JFFS2_NODETYPE_DIRENT: 209 204 for (fd = f->dents; fd; fd = fd->next) { ··· 212 209 } 213 210 } 214 211 BUG(); 212 + 215 213 default: 216 214 dbg_noderef("Don't care about replacing raw for nodetype %x\n", 217 215 je16_to_cpu(node->u.nodetype));