X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=fs%2Fext3%2Ffsync.c;h=d33634119e17e893eeff553781ef0307389c35f4;hb=5412b5399e095730008a14f2107331b2123733e4;hp=dd1fd3c0fc05c1bf4593decf9cd692df28558079;hpb=db1a19b38f3a85f475b4ad716c71be133d8ca48e;p=linux-2.6-omap-h63xx.git diff --git a/fs/ext3/fsync.c b/fs/ext3/fsync.c index dd1fd3c0fc0..d33634119e1 100644 --- a/fs/ext3/fsync.c +++ b/fs/ext3/fsync.c @@ -47,7 +47,7 @@ int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync) struct inode *inode = dentry->d_inode; int ret = 0; - J_ASSERT(ext3_journal_current_handle() == 0); + J_ASSERT(ext3_journal_current_handle() == NULL); /* * data=writeback: @@ -72,6 +72,9 @@ int ext3_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.