diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index d34054fcb70295c00ee0b6eb0da3bbd8ff84545b..1208f61373c84e50992df26260121a701d6f65e3 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -1786,6 +1786,7 @@ static long wb_writeback(struct bdi_writeback *wb, struct inode *inode; long progress; struct blk_plug plug; + bool queued = false; blk_start_plug(&plug); spin_lock(&wb->list_lock); @@ -1826,8 +1827,10 @@ static long wb_writeback(struct bdi_writeback *wb, dirtied_before = jiffies; trace_writeback_start(wb, work); - if (list_empty(&wb->b_io)) + if (list_empty(&wb->b_io)) { queue_io(wb, work, dirtied_before); + queued = true; + } if (work->sb) progress = writeback_sb_inodes(work->sb, wb, work); else @@ -1844,7 +1847,7 @@ static long wb_writeback(struct bdi_writeback *wb, * mean the overall work is done. So we keep looping as long * as made some progress on cleaning pages or inodes. */ - if (progress) + if (progress || !queued) continue; /* * No more inodes for IO, bail