changeset 1238:b3c09d540f56

* src/fs-ecos.c: Do not decrement mount count for unsuccessful umount attempts.
author asl
date Tue, 23 Sep 2003 10:21:00 +0000
parents 5acac6d0cccc
children b3be08d8eebb
files packages/fs/jffs2/current/ChangeLog packages/fs/jffs2/current/src/fs-ecos.c
diffstat 2 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/packages/fs/jffs2/current/ChangeLog
+++ b/packages/fs/jffs2/current/ChangeLog
@@ -1,3 +1,9 @@
+2003-09-21  Thomas Koeller  <thomas.koeller@baslerweb.com>
+	    Andrew Lunn     <andrew.lunn@ascom.ch>
+
+	* src/fs-ecos.c: Do not decrement mount count for unsuccessful
+	umount attempts.
+
 2003-09-19  Thomas Koeller  <thomas.koeller@baslerweb.com>
 
 	* src/fs-ecos.c: Another inode number fix.
--- a/packages/fs/jffs2/current/src/fs-ecos.c
+++ b/packages/fs/jffs2/current/src/fs-ecos.c
@@ -584,17 +584,15 @@ static int jffs2_umount(cyg_mtab_entry *
 
 	D2(printf("jffs2_umount\n"));
 
-	// Decrement the mount count
-	jffs2_sb->s_mount_count--;
-
 	// Only really umount if this is the only mount
-	if (jffs2_sb->s_mount_count == 0) {
+	if (jffs2_sb->s_mount_count == 1) {
 
 		// Check for open/inuse root or any cached inodes
 //if( root->i_count != 1 || root->i_cache_next != NULL) // root icount was set to 1 on mount
 		if (root->i_cache_next != NULL)	// root icount was set to 1 on mount
 			return EBUSY;
-
+                
+		jffs2_sb->s_mount_count--;
 		dec_refcnt(root);	// Time to free the root inode
 
 		//Clear root inode
@@ -611,7 +609,8 @@ static int jffs2_umount(cyg_mtab_entry *
 		mte->fs->data = 0;	// fstab entry, visible to all mounts. No current mount
 		// That's all folks.
 		D2(printf("jffs2_umount No current mounts\n"));
-	}
+	} else
+		jffs2_sb->s_mount_count--;
 
 	return ENOERR;
 }