diff options
Diffstat (limited to 'fs/jffs2/erase.c')
-rw-r--r-- | fs/jffs2/erase.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index 1862e8bc101d..1644e3408852 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c | |||
@@ -230,7 +230,6 @@ static inline void jffs2_remove_node_refs_from_ino_list(struct jffs2_sb_info *c, | |||
230 | at the end of the linked list. Stash it and continue | 230 | at the end of the linked list. Stash it and continue |
231 | from the beginning of the list */ | 231 | from the beginning of the list */ |
232 | ic = (struct jffs2_inode_cache *)(*prev); | 232 | ic = (struct jffs2_inode_cache *)(*prev); |
233 | BUG_ON(ic->class != RAWNODE_CLASS_INODE_CACHE); | ||
234 | prev = &ic->nodes; | 233 | prev = &ic->nodes; |
235 | continue; | 234 | continue; |
236 | } | 235 | } |
@@ -254,7 +253,8 @@ static inline void jffs2_remove_node_refs_from_ino_list(struct jffs2_sb_info *c, | |||
254 | 253 | ||
255 | /* PARANOIA */ | 254 | /* PARANOIA */ |
256 | if (!ic) { | 255 | if (!ic) { |
257 | printk(KERN_WARNING "inode_cache not found in remove_node_refs()!!\n"); | 256 | JFFS2_WARNING("inode_cache/xattr_datum/xattr_ref" |
257 | " not found in remove_node_refs()!!\n"); | ||
258 | return; | 258 | return; |
259 | } | 259 | } |
260 | 260 | ||
@@ -279,8 +279,19 @@ static inline void jffs2_remove_node_refs_from_ino_list(struct jffs2_sb_info *c, | |||
279 | printk("\n"); | 279 | printk("\n"); |
280 | }); | 280 | }); |
281 | 281 | ||
282 | if (ic->nodes == (void *)ic && ic->nlink == 0) | 282 | switch (ic->class) { |
283 | jffs2_del_ino_cache(c, ic); | 283 | #ifdef CONFIG_JFFS2_FS_XATTR |
284 | case RAWNODE_CLASS_XATTR_DATUM: | ||
285 | jffs2_release_xattr_datum(c, (struct jffs2_xattr_datum *)ic); | ||
286 | break; | ||
287 | case RAWNODE_CLASS_XATTR_REF: | ||
288 | jffs2_release_xattr_ref(c, (struct jffs2_xattr_ref *)ic); | ||
289 | break; | ||
290 | #endif | ||
291 | default: | ||
292 | if (ic->nodes == (void *)ic && ic->nlink == 0) | ||
293 | jffs2_del_ino_cache(c, ic); | ||
294 | } | ||
284 | } | 295 | } |
285 | 296 | ||
286 | void jffs2_free_jeb_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) | 297 | void jffs2_free_jeb_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) |