changeset 1500:4963fc37647a

Fix locking issues - from David Woodhouse
author gthomas
date Tue, 17 Feb 2004 15:36:14 +0000
parents ad5bef19f519
children 5eb5b0f94930
files packages/fs/jffs2/current/ChangeLog packages/fs/jffs2/current/src/fs-ecos.c packages/fs/jffs2/current/src/write.c
diffstat 3 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/packages/fs/jffs2/current/ChangeLog
+++ b/packages/fs/jffs2/current/ChangeLog
@@ -1,12 +1,20 @@
-2004-01-09  Thomas Koeller  <thomas.koeller@baslerweb.com>
+2004-02-17  David Woodhouse  <dwmw2@redhat.com>
 
-	* 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  <dwmw2@redhat.com>
 
-2004-01-05  Thomas Koeller  <thomas.koeller@baslerweb.com>
+	* 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  <thomas.koeller@baslerweb.com>
+
+	* cdl/jffs2.cdl: Re-added CYGPKG_FS_JFFS2_CFLAGS_REMOVE that had been
 	removed by previous change.
-
+	
 2003-11-26  David Woodhouse  <dwmw2@redhat.com>
 
 	JFFS2 cleanup and import of newer code. Remove last vestiges of
--- 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;
 	}
--- 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);