[Ocfs2-devel] [PATCH]Enable 2.6 file data flushing

Rusty Lynch rusty at linux.co.intel.com
Tue Mar 23 21:58:57 CST 2004


On Tue, Mar 23, 2004 at 08:23:06PM -0800, Wim Coekaerts wrote:
> hmm now I wonder if we dont' also need that in 2.4...
> 
> 
> On Tue, Mar 23, 2004 at 08:11:53PM -0800, Rusty Lynch wrote:
> > The following small patch makes a 2.6 built kernel flush it's 
> > data buffers to disk on ocfs_sync_inode, fixing bug #46
> > 
> > http://oss.oracle.com/bugzilla/show_bug.cgi?id=46
> > 
> >     --rusty
> > 

the equivilant call in 2.4 would be filemap_fdatasync().  I gave it a 
try and it does fix the mmap issue talked about in bug #50.

Here is a patch


Index: src/file.c
===================================================================
--- src/file.c	(revision 807)
+++ src/file.c	(working copy)
@@ -68,8 +68,10 @@
 {
 	int status;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+	filemap_fdatawrite(inode->i_mapping);
 	status = sync_mapping_buffers(inode->i_mapping);
 #else
+	filemap_fdatasync(inode->i_mapping);
 	status = fsync_inode_buffers(inode);
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,18)
 	if (!status)	       


More information about the Ocfs2-devel mailing list