diff options
Diffstat (limited to 'fs/jffs2/nodelist.c')
-rw-r--r-- | fs/jffs2/nodelist.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c index 4bf86088b3ae..87c6f555e1a0 100644 --- a/fs/jffs2/nodelist.c +++ b/fs/jffs2/nodelist.c | |||
@@ -32,15 +32,18 @@ void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new | |||
32 | if ((*prev)->nhash == new->nhash && !strcmp((*prev)->name, new->name)) { | 32 | if ((*prev)->nhash == new->nhash && !strcmp((*prev)->name, new->name)) { |
33 | /* Duplicate. Free one */ | 33 | /* Duplicate. Free one */ |
34 | if (new->version < (*prev)->version) { | 34 | if (new->version < (*prev)->version) { |
35 | dbg_dentlist("Eep! Marking new dirent node is obsolete, old is \"%s\", ino #%u\n", | 35 | dbg_dentlist("Eep! Marking new dirent node obsolete, old is \"%s\", ino #%u\n", |
36 | (*prev)->name, (*prev)->ino); | 36 | (*prev)->name, (*prev)->ino); |
37 | jffs2_mark_node_obsolete(c, new->raw); | 37 | jffs2_mark_node_obsolete(c, new->raw); |
38 | jffs2_free_full_dirent(new); | 38 | jffs2_free_full_dirent(new); |
39 | } else { | 39 | } else { |
40 | dbg_dentlist("marking old dirent \"%s\", ino #%u bsolete\n", | 40 | dbg_dentlist("marking old dirent \"%s\", ino #%u obsolete\n", |
41 | (*prev)->name, (*prev)->ino); | 41 | (*prev)->name, (*prev)->ino); |
42 | new->next = (*prev)->next; | 42 | new->next = (*prev)->next; |
43 | jffs2_mark_node_obsolete(c, ((*prev)->raw)); | 43 | /* It may have been a 'placeholder' deletion dirent, |
44 | if jffs2_can_mark_obsolete() (see jffs2_do_unlink()) */ | ||
45 | if ((*prev)->raw) | ||
46 | jffs2_mark_node_obsolete(c, ((*prev)->raw)); | ||
44 | jffs2_free_full_dirent(*prev); | 47 | jffs2_free_full_dirent(*prev); |
45 | *prev = new; | 48 | *prev = new; |
46 | } | 49 | } |