This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

jffs2 umount


The jffs2_umount() function always decrements the mount count
for the file system, even if the umount attempt fails with
EBUSY. This means the umount can never be retried. Patch
attached.


diff -ru packages-orig/fs/jffs2/current/ChangeLog packages/fs/jffs2/current/ChangeLog
--- packages-orig/fs/jffs2/current/ChangeLog	Sun Sep 21 20:40:11 2003
+++ packages/fs/jffs2/current/ChangeLog	Sun Sep 21 22:29:28 2003
@@ -1,3 +1,8 @@
+2003-09-21  Thomas Koeller  <thomas.koeller@baslerweb.com>
+
+	* 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.
diff -ru packages-orig/fs/jffs2/current/src/fs-ecos.c packages/fs/jffs2/current/src/fs-ecos.c
--- packages-orig/fs/jffs2/current/src/fs-ecos.c	Sun Sep 21 20:40:11 2003
+++ packages/fs/jffs2/current/src/fs-ecos.c	Sun Sep 21 22:17:56 2003
@@ -584,11 +584,8 @@
 
 	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
@@ -611,7 +608,8 @@
 		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;
 }


-- 
Thomas Koeller, Software Development

Basler Vision Technologies
An der Strusbek 60-62
22926 Ahrensburg
Germany

Tel +49 (4102) 463-162
Fax +49 (4102) 463-239

mailto:thomas.koeller@baslerweb.com
http://www.baslerweb.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]