Merge tag 'for-linus-20140610' of git://git.infradead.org/linux-mtd
[cascardo/linux.git] / fs / ocfs2 / alloc.c
index e2edff3..9d8fcf2 100644 (file)
@@ -5728,6 +5728,7 @@ int ocfs2_remove_btree_range(struct inode *inode,
        }
 
        ocfs2_et_update_clusters(et, -len);
+       ocfs2_update_inode_fsync_trans(handle, inode, 1);
 
        ocfs2_journal_dirty(handle, et->et_root_bh);
 
@@ -6045,7 +6046,8 @@ static void ocfs2_truncate_log_worker(struct work_struct *work)
 void ocfs2_schedule_truncate_log_flush(struct ocfs2_super *osb,
                                       int cancel)
 {
-       if (osb->osb_tl_inode) {
+       if (osb->osb_tl_inode &&
+                       atomic_read(&osb->osb_tl_disable) == 0) {
                /* We want to push off log flushes while truncates are
                 * still running. */
                if (cancel)
@@ -6222,6 +6224,8 @@ void ocfs2_truncate_log_shutdown(struct ocfs2_super *osb)
        int status;
        struct inode *tl_inode = osb->osb_tl_inode;
 
+       atomic_set(&osb->osb_tl_disable, 1);
+
        if (tl_inode) {
                cancel_delayed_work(&osb->osb_truncate_log_wq);
                flush_workqueue(ocfs2_wq);
@@ -6253,6 +6257,7 @@ int ocfs2_truncate_log_init(struct ocfs2_super *osb)
         * until we're sure all is well. */
        INIT_DELAYED_WORK(&osb->osb_truncate_log_wq,
                          ocfs2_truncate_log_worker);
+       atomic_set(&osb->osb_tl_disable, 0);
        osb->osb_tl_bh    = tl_bh;
        osb->osb_tl_inode = tl_inode;
 
@@ -6932,6 +6937,7 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode,
        di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features);
        spin_unlock(&oi->ip_lock);
 
+       ocfs2_update_inode_fsync_trans(handle, inode, 1);
        ocfs2_dinode_new_extent_list(inode, di);
 
        ocfs2_journal_dirty(handle, di_bh);
@@ -7208,6 +7214,7 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh,
        di->i_ctime = di->i_mtime = cpu_to_le64(inode->i_ctime.tv_sec);
        di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec);
 
+       ocfs2_update_inode_fsync_trans(handle, inode, 1);
        ocfs2_journal_dirty(handle, di_bh);
 
 out_commit: