patch-2.4.23 linux-2.4.23/fs/jfs/file.c

Next file: linux-2.4.23/fs/jfs/inode.c
Previous file: linux-2.4.23/fs/jffs2/write.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/fs/jfs/file.c linux-2.4.23/fs/jfs/file.c
@@ -39,10 +39,12 @@
 
 	rc = fsync_inode_data_buffers(inode);
 
-	if (!(inode->i_state & I_DIRTY))
-		return rc;
-	if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
+	if (!(inode->i_state & I_DIRTY) ||
+	    (datasync && !(inode->i_state & I_DIRTY_DATASYNC))) {
+		/* Make sure committed changes hit the disk */
+		jfs_flush_journal(JFS_SBI(inode->i_sb)->log, 1);
 		return rc;
+	}
 
 	rc |= jfs_commit_inode(inode, 1);
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)