From 9546996591481890cbfc0c36f64d0fa93aa9b03f Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Thu, 1 May 2008 16:59:24 +0100 Subject: [PATCH] --- yaml --- r: 95735 b: refs/heads/master c: 1b690b48786229571e590dd22fe01ecc22a8746b h: refs/heads/master i: 95733: e1f3dfb1ce4f8a337b423e88cbba065156e7996e 95731: ec316dbe76a4fcba8728d5bbd170f8da74fbe7c4 95727: 5b66419e458859120bc630011c86698ae6c14e29 v: v3 --- [refs] | 2 +- trunk/fs/jffs2/fs.c | 9 +++++---- trunk/fs/jffs2/gc.c | 2 +- trunk/fs/jffs2/os-linux.h | 2 +- trunk/fs/jffs2/wbuf.c | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 69126be66200..b2b896979b0e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 590fe34c47cb5c2d836ac76fabc5f160bf31a3f1 +refs/heads/master: 1b690b48786229571e590dd22fe01ecc22a8746b diff --git a/trunk/fs/jffs2/fs.c b/trunk/fs/jffs2/fs.c index 3eb1c84b0a33..e14b185a80df 100644 --- a/trunk/fs/jffs2/fs.c +++ b/trunk/fs/jffs2/fs.c @@ -586,11 +586,12 @@ void jffs2_gc_release_inode(struct jffs2_sb_info *c, } struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, - int inum, int nlink) + int inum, int unlinked) { struct inode *inode; struct jffs2_inode_cache *ic; - if (!nlink) { + + if (unlinked) { /* The inode has zero nlink but its nodes weren't yet marked obsolete. This has to be because we're still waiting for the final (close() and) iput() to happen. @@ -638,8 +639,8 @@ struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, return ERR_CAST(inode); } if (is_bad_inode(inode)) { - printk(KERN_NOTICE "Eep. read_inode() failed for ino #%u. nlink %d\n", - inum, nlink); + printk(KERN_NOTICE "Eep. read_inode() failed for ino #%u. unlinked %d\n", + inum, unlinked); /* NB. This will happen again. We need to do something appropriate here. */ iput(inode); return ERR_PTR(-EIO); diff --git a/trunk/fs/jffs2/gc.c b/trunk/fs/jffs2/gc.c index bad005664e30..d4db0efeceaf 100644 --- a/trunk/fs/jffs2/gc.c +++ b/trunk/fs/jffs2/gc.c @@ -401,7 +401,7 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c) nlink = ic->nlink; spin_unlock(&c->inocache_lock); - f = jffs2_gc_fetch_inode(c, inum, nlink); + f = jffs2_gc_fetch_inode(c, inum, !nlink); if (IS_ERR(f)) { ret = PTR_ERR(f); goto release_sem; diff --git a/trunk/fs/jffs2/os-linux.h b/trunk/fs/jffs2/os-linux.h index 1b10d2594092..2cc866cf134f 100644 --- a/trunk/fs/jffs2/os-linux.h +++ b/trunk/fs/jffs2/os-linux.h @@ -187,7 +187,7 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent); void jffs2_gc_release_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f); struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, - int inum, int nlink); + int inum, int unlinked); unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, struct jffs2_inode_info *f, diff --git a/trunk/fs/jffs2/wbuf.c b/trunk/fs/jffs2/wbuf.c index 8de52b607678..92ab32a987ba 100644 --- a/trunk/fs/jffs2/wbuf.c +++ b/trunk/fs/jffs2/wbuf.c @@ -494,7 +494,7 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c) /* If it's an in-core inode, then we have to adjust any full_dirent or full_dnode structure to point to the new version instead of the old */ - f = jffs2_gc_fetch_inode(c, ic->ino, ic->nlink); + f = jffs2_gc_fetch_inode(c, ic->ino, !ic->nlink); if (IS_ERR(f)) { /* Should never happen; it _must_ be present */ JFFS2_ERROR("Failed to iget() ino #%u, err %ld\n",