
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

Use the synchronous updates, in order to guarantee that the writing to
a disk is completeing when a system call returns.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/msdos/namei.c |    5 ++++-
 25-akpm/fs/vfat/namei.c  |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff -puN fs/msdos/namei.c~fat-use-synchronous-update-for fs/msdos/namei.c
--- 25/fs/msdos/namei.c~fat-use-synchronous-update-for	Sun Mar  6 17:13:31 2005
+++ 25-akpm/fs/msdos/namei.c	Sun Mar  6 17:13:31 2005
@@ -278,7 +278,10 @@ static int msdos_add_entry(struct inode 
 		return err;
 
 	dir->i_ctime = dir->i_mtime = *ts;
-	mark_inode_dirty(dir);
+	if (IS_DIRSYNC(dir))
+		(void)fat_sync_inode(dir);
+	else
+		mark_inode_dirty(dir);
 
 	return 0;
 }
diff -puN fs/vfat/namei.c~fat-use-synchronous-update-for fs/vfat/namei.c
--- 25/fs/vfat/namei.c~fat-use-synchronous-update-for	Sun Mar  6 17:13:31 2005
+++ 25-akpm/fs/vfat/namei.c	Sun Mar  6 17:13:31 2005
@@ -684,7 +684,10 @@ static int vfat_add_entry(struct inode *
 
 	/* update timestamp */
 	dir->i_ctime = dir->i_mtime = dir->i_atime = *ts;
-	mark_inode_dirty(dir);
+	if (IS_DIRSYNC(dir))
+		(void)fat_sync_inode(dir);
+	else
+		mark_inode_dirty(dir);
 cleanup:
 	kfree(slots);
 	return err;
_
