# HG changeset patch # User gthomas # Date 1077032174 0 # Node ID 4963fc37647a462e2b2bc22fcc6d60b5aee0b97d # Parent ad5bef19f519ac7a04f9c0190e3a077d2025a825 Fix locking issues - from David Woodhouse diff --git a/packages/fs/jffs2/current/ChangeLog b/packages/fs/jffs2/current/ChangeLog --- a/packages/fs/jffs2/current/ChangeLog +++ b/packages/fs/jffs2/current/ChangeLog @@ -1,12 +1,20 @@ -2004-01-09 Thomas Koeller +2004-02-17 David Woodhouse - * src/fs-ecos.c: Fixed inode reference counting in jffs2_ops_link(). + * src/fs-ecos.c: + Don't re-initialise the already-locked f->sem. It makes eCos unhappy. + +2004-01-27 David Woodhouse -2004-01-05 Thomas Koeller + * src/write.c: + Fix bug noted by Howard Gray; dirents belong to, and should dirty, + the _parent_inode, not the child (which may be zero in the case + of an unlink). - * cdl/jffs2.cdl: Re-added CYGPKG_FS_JFFS2_CFLAGS_REMOVE that had been +004-01-05 Thomas Koeller + + * cdl/jffs2.cdl: Re-added CYGPKG_FS_JFFS2_CFLAGS_REMOVE that had been removed by previous change. - + 2003-11-26 David Woodhouse JFFS2 cleanup and import of newer code. Remove last vestiges of diff --git a/packages/fs/jffs2/current/src/fs-ecos.c b/packages/fs/jffs2/current/src/fs-ecos.c --- a/packages/fs/jffs2/current/src/fs-ecos.c +++ b/packages/fs/jffs2/current/src/fs-ecos.c @@ -991,6 +991,7 @@ static int jffs2_ops_link(cyg_mtab_entry // Allow through links to non-existing terminal objects if (ds2.last && err == ENOENT) { + jffs2_iput(ds2.node); ds2.node = NULL; err = ENOERR; } diff --git a/packages/fs/jffs2/current/src/write.c b/packages/fs/jffs2/current/src/write.c --- a/packages/fs/jffs2/current/src/write.c +++ b/packages/fs/jffs2/current/src/write.c @@ -7,7 +7,7 @@ * * For licensing information, see the file 'LICENCE' in this directory. * - * $Id: write.c,v 1.79 2003/12/03 09:41:03 dwmw2 Exp $ + * $Id: write.c,v 1.81 2004/02/17 14:58:16 dwmw2 Exp $ * */ @@ -31,7 +31,6 @@ int jffs2_do_new_inode(struct jffs2_sb_i memset(ic, 0, sizeof(*ic)); - init_MUTEX_LOCKED(&f->sem); f->inocache = ic; f->inocache->nlink = 1; f->inocache->nodes = (struct jffs2_raw_node_ref *)f->inocache; @@ -279,7 +278,7 @@ struct jffs2_full_dirent *jffs2_write_di raw->next_phys = NULL; ret = jffs2_flash_writev(c, vecs, 2, flash_ofs, &retlen, - (alloc_mode==ALLOC_GC)?0:fd->ino); + (alloc_mode==ALLOC_GC)?0:je32_to_cpu(rd->pino)); if (ret || (retlen != sizeof(*rd) + namelen)) { printk(KERN_NOTICE "Write of %zd bytes at 0x%08x failed. returned %d, retlen %zd\n", sizeof(*rd)+namelen, flash_ofs, ret, retlen);