]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/backing-dev.c
backing_dev: fix hung task on sync
[mirror_ubuntu-bionic-kernel.git] / mm / backing-dev.c
index ce682f7a4f29d161189f47fd7e376d69bea2359d..fab8401fc54e9241eeacd314f064d696e608d481 100644 (file)
@@ -288,13 +288,16 @@ int bdi_has_dirty_io(struct backing_dev_info *bdi)
  * Note, we wouldn't bother setting up the timer, but this function is on the
  * fast-path (used by '__mark_inode_dirty()'), so we save few context switches
  * by delaying the wake-up.
+ *
+ * We have to be careful not to postpone flush work if it is scheduled for
+ * earlier. Thus we use queue_delayed_work().
  */
 void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi)
 {
        unsigned long timeout;
 
        timeout = msecs_to_jiffies(dirty_writeback_interval * 10);
-       mod_delayed_work(bdi_wq, &bdi->wb.dwork, timeout);
+       queue_delayed_work(bdi_wq, &bdi->wb.dwork, timeout);
 }
 
 /*