[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: sync writes - was Re: how to counteract slowdown



Neil Brown wrote:
> 
> ButButButButButBut

Sorry.  I misread your script.

It would appear to be an outrageous bug.  Linux isn't
syncing write() data for either synchronous mounts or
for `chattr +S' files.

Here's a fix.  It could adversely affect ext3 - I'll check.

--- linux-2.4.15-pre4/mm/filemap.c	Mon Nov 12 11:16:12 2001
+++ linux-akpm/mm/filemap.c	Wed Nov 14 22:34:26 2001
@@ -2916,8 +2916,10 @@ unlock:
 
 	/* For now, when the user asks for O_SYNC, we'll actually
 	 * provide O_DSYNC. */
-	if ((status >= 0) && (file->f_flags & O_SYNC))
-		status = generic_osync_inode(inode, OSYNC_METADATA|OSYNC_DATA);
+	if (status >= 0) {
+		if ((file->f_flags & O_SYNC) || IS_SYNC(inode))
+			status = generic_osync_inode(inode, OSYNC_METADATA|OSYNC_DATA);
+	}
 	
 	err = written ? written : status;
 out:





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]