> The following strange behavior can be observed:>> 1. large file is written> 2. after 30 seconds, nr_dirty goes down by 1024> 3. then for some time (< 30 sec) nothing happens (disk idle)> 4. then nr_dirty again goes down by 1024> 5. repeat from 3. until whole file is written>> So basically a 4Mbyte chunk of the file is written every 30 seconds.> I'm quite sure this is not the intended behavior.

# line 548 in fs/fs-writeback.c:543 if (wbc->pages_skipped != pages_skipped) {544 /*545 * writeback is not making progress due to locked546 * buffers. Skip this inode for now.547 */548 redirty_tail(inode);549 }More debug efforts show that __block_write_full_page()never has the chance to call submit_bh() for that big dirty file:the buffer head is *clean*. So basicly no page io is issued by__block_write_full_page(), hence pages_skipped goes up.

Also the comment in generic_sync_sb_inodes():

544 /*545 * writeback is not making progress due to locked546 * buffers. Skip this inode for now.547 */and the comment in __block_write_full_page():

1713 /*1714 * The page was marked dirty, but the buffers were1715 * clean. Someone wrote them back by hand with1716 * ll_rw_block/submit_bh. A rare case.1717 */do not quite agree with each other. The page writeback should be skipped for'locked buffer', but here it is 'clean buffer'!

This patch fixes this bug. Though I'm not sure why __block_write_full_page()is called only to do nothing and who actually issued the writeback for us.