diff options
Diffstat (limited to 'fs/jffs2')
-rw-r--r-- | fs/jffs2/fs.c | 9 | ||||
-rw-r--r-- | fs/jffs2/gc.c | 2 | ||||
-rw-r--r-- | fs/jffs2/os-linux.h | 2 | ||||
-rw-r--r-- | fs/jffs2/wbuf.c | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 3eb1c84b0a33..e14b185a80df 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c | |||
@@ -586,11 +586,12 @@ void jffs2_gc_release_inode(struct jffs2_sb_info *c, | |||
586 | } | 586 | } |
587 | 587 | ||
588 | struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, | 588 | struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, |
589 | int inum, int nlink) | 589 | int inum, int unlinked) |
590 | { | 590 | { |
591 | struct inode *inode; | 591 | struct inode *inode; |
592 | struct jffs2_inode_cache *ic; | 592 | struct jffs2_inode_cache *ic; |
593 | if (!nlink) { | 593 | |
594 | if (unlinked) { | ||
594 | /* The inode has zero nlink but its nodes weren't yet marked | 595 | /* The inode has zero nlink but its nodes weren't yet marked |
595 | obsolete. This has to be because we're still waiting for | 596 | obsolete. This has to be because we're still waiting for |
596 | the final (close() and) iput() to happen. | 597 | the final (close() and) iput() to happen. |
@@ -638,8 +639,8 @@ struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, | |||
638 | return ERR_CAST(inode); | 639 | return ERR_CAST(inode); |
639 | } | 640 | } |
640 | if (is_bad_inode(inode)) { | 641 | if (is_bad_inode(inode)) { |
641 | printk(KERN_NOTICE "Eep. read_inode() failed for ino #%u. nlink %d\n", | 642 | printk(KERN_NOTICE "Eep. read_inode() failed for ino #%u. unlinked %d\n", |
642 | inum, nlink); | 643 | inum, unlinked); |
643 | /* NB. This will happen again. We need to do something appropriate here. */ | 644 | /* NB. This will happen again. We need to do something appropriate here. */ |
644 | iput(inode); | 645 | iput(inode); |
645 | return ERR_PTR(-EIO); | 646 | return ERR_PTR(-EIO); |
diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c index bad005664e30..d4db0efeceaf 100644 --- a/fs/jffs2/gc.c +++ b/fs/jffs2/gc.c | |||
@@ -401,7 +401,7 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c) | |||
401 | nlink = ic->nlink; | 401 | nlink = ic->nlink; |
402 | spin_unlock(&c->inocache_lock); | 402 | spin_unlock(&c->inocache_lock); |
403 | 403 | ||
404 | f = jffs2_gc_fetch_inode(c, inum, nlink); | 404 | f = jffs2_gc_fetch_inode(c, inum, !nlink); |
405 | if (IS_ERR(f)) { | 405 | if (IS_ERR(f)) { |
406 | ret = PTR_ERR(f); | 406 | ret = PTR_ERR(f); |
407 | goto release_sem; | 407 | goto release_sem; |
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index 1b10d2594092..2cc866cf134f 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h | |||
@@ -187,7 +187,7 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent); | |||
187 | void jffs2_gc_release_inode(struct jffs2_sb_info *c, | 187 | void jffs2_gc_release_inode(struct jffs2_sb_info *c, |
188 | struct jffs2_inode_info *f); | 188 | struct jffs2_inode_info *f); |
189 | struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, | 189 | struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, |
190 | int inum, int nlink); | 190 | int inum, int unlinked); |
191 | 191 | ||
192 | unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, | 192 | unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, |
193 | struct jffs2_inode_info *f, | 193 | struct jffs2_inode_info *f, |
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c index 8de52b607678..92ab32a987ba 100644 --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c | |||
@@ -494,7 +494,7 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c) | |||
494 | /* If it's an in-core inode, then we have to adjust any | 494 | /* If it's an in-core inode, then we have to adjust any |
495 | full_dirent or full_dnode structure to point to the | 495 | full_dirent or full_dnode structure to point to the |
496 | new version instead of the old */ | 496 | new version instead of the old */ |
497 | f = jffs2_gc_fetch_inode(c, ic->ino, ic->nlink); | 497 | f = jffs2_gc_fetch_inode(c, ic->ino, !ic->nlink); |
498 | if (IS_ERR(f)) { | 498 | if (IS_ERR(f)) { |
499 | /* Should never happen; it _must_ be present */ | 499 | /* Should never happen; it _must_ be present */ |
500 | JFFS2_ERROR("Failed to iget() ino #%u, err %ld\n", | 500 | JFFS2_ERROR("Failed to iget() ino #%u, err %ld\n", |