linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] aborted ext4 leads to inifinity loop in balance_dirty_pages
@ 2011-10-25 12:04 Kazuya Mio
  2011-10-25 13:40 ` Jan Kara
  0 siblings, 1 reply; 14+ messages in thread
From: Kazuya Mio @ 2011-10-25 12:04 UTC (permalink / raw)
  To: ext4; +Cc: Theodore Tso, Andreas Dilger

Write systemcall calls balance_dirty_pages() for direct reclaim.
However, if ext4 is aborted because of the journal abort, ext4_da_writepages()
cannot reduce the number of dirty pages because EXT4_MF_FS_ABORTED is set to
s_mount_flag. banalce_dirty_pages() has a busy loop, and we can pass this loop
only if the number of dirty pages is less than the threshold. So this function
loops infinity.

When write systemcall and kjournald ran at the same time and the disk
corruption happened, the problem occurred. The kernel version was 3.1-rc9.
I corrupted the disk on purpose by using dmsetup command.


process1 (write)                  process2 (kjournald)

generic_perform_write
  ext4_da_write_begin
  ext4_da_write_end

-------------- detect disk corruption --------------

                                  jbd2_journal_commit_transaction
                                     journal_submit_data_buffers
                                     jbd2_journal_abort

  balance_dirty_pages
    writeback_inodes_wb
      ...
        ext4_da_writepages           <- do nothing if EXT4_MF_FS_ABORTED is set
          ext4_journal_start
            ext4_journal_start_sb    <- detect journal abort
              ext4_abort             <- set EXT4_MF_FS_ABORTED


One possible idea to fix this problem is that ext4_da_writepages()
invalidates the dirty pages if the filesystem has been aborted.
Do you have any ideas?

Regards,
Kazuya Mio

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-11-14 11:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25 12:04 [BUG] aborted ext4 leads to inifinity loop in balance_dirty_pages Kazuya Mio
2011-10-25 13:40 ` Jan Kara
2011-10-28  5:34   ` Kazuya Mio
2011-11-01 23:13     ` Jan Kara
2011-11-02  5:24       ` Kazuya Mio
2011-11-07  8:00     ` Dmitry Monakhov
2011-11-07 17:29       ` Jan Kara
2011-11-07 17:45         ` Dmitry Monakhov
2011-11-07 21:23           ` Jan Kara
2011-11-08  0:03     ` Jan Kara
2011-11-09  8:28       ` Kazuya Mio
2011-11-09 11:15         ` Jan Kara
2011-11-14 10:06       ` Kazuya Mio
2011-11-14 11:11         ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).