Skip to contentSkip to conversation

Enable 2.6 file data flushing

PATCH New Rusty Lynch 3 participants 5 messages Mar 23, 2004 – Mar 24, 2004 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Enable 2.6 file data flushing

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
file.c +1 -0
Index: src/file.c
===================================================================
@@ -68,6 +68,7 @@
 {
 	int status;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+	filemap_fdatawrite(inode->i_mapping);	
 	status = sync_mapping_buffers(inode->i_mapping);
 #else
 	status = fsync_inode_buffers(inode);
#1 lore raw

PATCH 1/1 Enable 2.6 file data flushing

hmm now I wonder if we dont' also need that in 2.4...

Quoted 23 lines · Rusty Lynch

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

Index: src/file.c
===================================================================

file.c +1 -0
@@ -68,6 +68,7 @@
 {
 	int status;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+	filemap_fdatawrite(inode->i_mapping);	
 	status = sync_mapping_buffers(inode->i_mapping);
 #else
 	status = fsync_inode_buffers(inode);

_______________________________________________
Ocfs2-devel mailing list
[email protected]
http://oss.oracle.com/mailman/listinfo/ocfs2-devel

#2 lore raw

PATCH 1/1 Enable 2.6 file data flushing

Quoted 11 lines · Wim Coekaerts

hmm now I wonder if we dont' also need that in 2.4...

Quoted 7 lines · Rusty Lynch

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

file.c +2 -0
Index: src/file.c
===================================================================
@@ -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)	       
#3 lore raw

PATCH 1/1 Enable 2.6 file data flushing

slick, yeah when I saw your patch I checked in 2.4 and saw it existed as that, totally makes sense, we should put it in our ocfs1 tree also, I think that wills olve some of the weirdness we have seen

cool stuff Rusty :)

Quoted 34 lines · Rusty Lynch
Quoted 11 lines · Wim Coekaerts

hmm now I wonder if we dont' also need that in 2.4...

Quoted 7 lines · Rusty Lynch

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
===================================================================

file.c +2 -0
@@ -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)	       
#4 lore raw

PATCH 1/1 Enable 2.6 file data flushing

In reply to Rusty Lynch
Quoted 2 lines · Rusty Lynch

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.

Ok, excellent. I verified that this bug does indeed exist, and the patch seems to fix it. I'll put it in SVN today. Nice catch Rusty!

	--Mark

--
Mark Fasheh
Software Developer, Oracle Corp
[email protected]