Merge branch 'mlx4-fixes'
[cascardo/linux.git] / fs / fs-writeback.c
index 56c8fda..05713a5 100644 (file)
@@ -1327,6 +1327,7 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
        dirty = inode->i_state & I_DIRTY;
        if (inode->i_state & I_DIRTY_TIME) {
                if ((dirty & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) ||
+                   wbc->sync_mode == WB_SYNC_ALL ||
                    unlikely(inode->i_state & I_DIRTY_TIME_EXPIRED) ||
                    unlikely(time_after(jiffies,
                                        (inode->dirtied_time_when +
@@ -1948,6 +1949,12 @@ void wakeup_flusher_threads(long nr_pages, enum wb_reason reason)
 {
        struct backing_dev_info *bdi;
 
+       /*
+        * If we are expecting writeback progress we must submit plugged IO.
+        */
+       if (blk_needs_flush_plug(current))
+               blk_schedule_flush_plug(current);
+
        if (!nr_pages)
                nr_pages = get_nr_dirty_pages();