writeback: fix queue_io() ordering
authorWu Fengguang <[email protected]>
Wed, 11 Aug 2010 21:17:42 +0000 (14:17 -0700)
committerLinus Torvalds <[email protected]>
Thu, 12 Aug 2010 15:43:30 +0000 (08:43 -0700)
This was not a bug, since b_io is empty for kupdate writeback.  The next
patch will do requeue_io() for non-kupdate writeback, so let's fix it.

Signed-off-by: Wu Fengguang <[email protected]>
Cc: Dave Chinner <[email protected]>
Cc: Martin Bligh <[email protected]>
Cc: Michael Rubin <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Jens Axboe <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/fs-writeback.c

index 1ce364bbb0037698ecf499132a819058de05ecdf..863bfb0eb49254fd9c07f21e27952fb6311e0e88 100644 (file)
@@ -249,10 +249,18 @@ static void move_expired_inodes(struct list_head *delaying_queue,
 
 /*
  * Queue all expired dirty inodes for io, eldest first.
+ * Before
+ *         newly dirtied     b_dirty    b_io    b_more_io
+ *         =============>    gf         edc     BA
+ * After
+ *         newly dirtied     b_dirty    b_io    b_more_io
+ *         =============>    g          fBAedc
+ *                                           |
+ *                                           +--> dequeue for IO
  */
 static void queue_io(struct bdi_writeback *wb, unsigned long *older_than_this)
 {
-       list_splice_init(&wb->b_more_io, wb->b_io.prev);
+       list_splice_init(&wb->b_more_io, &wb->b_io);
        move_expired_inodes(&wb->b_dirty, &wb->b_io, older_than_this);
 }