X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fext4%2Ffsync.c;h=1c8ba48d4f8d6014e5708b44706640e3e29a11e9;hb=6924d1ab8b7bbe5ab416713f5701b3316b2df85b;hp=8d50879d1c2c68f23284314ff4fc7c5afe3c0a8e;hpb=9cf52b2921fbe62566b6b2ee79f71203749c9e5e;p=linux-2.6 diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index 8d50879d1c..1c8ba48d4f 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c @@ -27,8 +27,8 @@ #include #include #include -#include -#include +#include "ext4.h" +#include "ext4_jbd2.h" /* * akpm: A new design for ext4_sync_file(). @@ -72,6 +72,9 @@ int ext4_sync_file(struct file * file, struct dentry *dentry, int datasync) goto out; } + if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) + goto out; + /* * The VFS has written the file data. If the inode is unaltered * then we need not start a commit.