GFS2: dirty inode correctly in gfs2_write_end
[cascardo/linux.git] / fs / gfs2 / file.c
index 72c3866..0621b46 100644 (file)
@@ -650,7 +650,7 @@ static int gfs2_fsync(struct file *file, loff_t start, loff_t end,
 {
        struct address_space *mapping = file->f_mapping;
        struct inode *inode = mapping->host;
-       int sync_state = inode->i_state & (I_DIRTY_SYNC|I_DIRTY_DATASYNC);
+       int sync_state = inode->i_state & I_DIRTY;
        struct gfs2_inode *ip = GFS2_I(inode);
        int ret = 0, ret1 = 0;
 
@@ -660,6 +660,8 @@ static int gfs2_fsync(struct file *file, loff_t start, loff_t end,
                        return ret1;
        }
 
+       if (!gfs2_is_jdata(ip))
+               sync_state &= ~I_DIRTY_PAGES;
        if (datasync)
                sync_state &= ~I_DIRTY_SYNC;