diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-05-22 11:29:23 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-05-22 11:29:23 -0400 |
commit | 0eac940b8a087576c66ecf8e0f294f2ceb3b607b (patch) | |
tree | a21f5376f5fec2c21fe23e90e3317f1a1c48cc3e | |
parent | fcb7578719529898aef9edce8e409e457a1c2d15 (diff) |
[JFFS2] Add some preemptive BUG checks for XATTR code
In a couple of places, we assume that what's at the end of the
->next_in_ino list is a struct jffs2_inode_cache. Let's check
for that, since we expect it to change soon.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
-rw-r--r-- | fs/jffs2/erase.c | 1 | ||||
-rw-r--r-- | fs/jffs2/nodemgmt.c | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index 0fc19a2fb5d9..4616fed75730 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c | |||
@@ -230,6 +230,7 @@ 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); | ||
233 | prev = &ic->nodes; | 234 | prev = &ic->nodes; |
234 | continue; | 235 | continue; |
235 | } | 236 | } |
diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c index e10e58eab8e5..34a452bdde05 100644 --- a/fs/jffs2/nodemgmt.c +++ b/fs/jffs2/nodemgmt.c | |||
@@ -661,6 +661,10 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref | |||
661 | spin_lock(&c->erase_completion_lock); | 661 | spin_lock(&c->erase_completion_lock); |
662 | 662 | ||
663 | ic = jffs2_raw_ref_to_ic(ref); | 663 | ic = jffs2_raw_ref_to_ic(ref); |
664 | /* It seems we should never call jffs2_mark_node_obsolete() for | ||
665 | XATTR nodes.... yet. Make sure we notice if/when we change | ||
666 | that :) */ | ||
667 | BUG_ON(ic->class != RAWNODE_CLASS_INODE_CACHE); | ||
664 | for (p = &ic->nodes; (*p) != ref; p = &((*p)->next_in_ino)) | 668 | for (p = &ic->nodes; (*p) != ref; p = &((*p)->next_in_ino)) |
665 | ; | 669 | ; |
666 | 670 | ||