linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* kjournald() with DIO
@ 2005-09-12 23:23 Badari Pulavarty
  2005-09-12 23:37 ` Andrew Morton
  0 siblings, 1 reply; 29+ messages in thread
From: Badari Pulavarty @ 2005-09-12 23:23 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: akpm, sct

Hi,

I have been chasing a race condition, which leads to
returning premature EIO with DIO (iozone tests) on
ext3 filesystems.

It seems to be a race between kjournald() & DIO process
invalidating the page. Is this a known issue ?

Thanks,
Badari


Here is the race:

kjournald submited buffers for IO and waiting for them to finish.
Note that it has a ref. against the buffer.

journal_commit_transaction()
        ...
        submited buffers for IO
        /* Waiting for IO to complete */
        while (commit_transaction->t_locked_list) {
                ...
                get_bh(bh);
                if (buffer_locked(bh)) {
                        spin_unlock(&journal->j_list_lock);
                        wait_on_buffer(bh);  <<----------
                        spin_lock(&journal->j_list_lock);
                }

                ..
                put_bh(bh);
        }

Now, DIO process comes to frees the jh through journal_try_to_free_buffers()
but fails to drop_buffers() since kjournald() has a reference against it.

invalidate_complete_range()
        ..
        ext3_releasepage()
                journal_try_to_free_buffers()
                        journal_put_journal_head()
                                __journal_try_to_free_buffer()
                                        <<--- freed jh

                        try_to_free_buffers()
                                drop_buffers()
                                        if (buffer_busy(bh))
                                                goto failed;
                                          <<--- returns EIO due to b_count




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

end of thread, other threads:[~2005-09-21 18:22 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-12 23:23 kjournald() with DIO Badari Pulavarty
2005-09-12 23:37 ` Andrew Morton
2005-09-13  0:06   ` Badari Pulavarty
2005-09-13  0:29     ` Andrew Morton
2005-09-13 16:52       ` Badari Pulavarty
2005-09-13 23:07         ` Andrew Morton
2005-09-14 17:23           ` Mingming Cao
2005-09-14 18:18             ` Andrew Morton
2005-09-14 21:40               ` Mingming Cao
2005-09-14 22:02                 ` Andrew Morton
2005-09-15 11:11                   ` Suparna Bhattacharya
2005-09-15 18:52                     ` Andrew Morton
2005-09-15 15:03                   ` Badari Pulavarty
2005-09-15 19:22                     ` Andrea Arcangeli
2005-09-15 20:00                       ` Andrew Morton
2005-09-15 20:20                         ` Andrea Arcangeli
2005-09-15 20:35                           ` Andrew Morton
2005-09-15 20:49                             ` Badari Pulavarty
2005-09-15 21:06                               ` Andrea Arcangeli
2005-09-15 21:20                               ` Andrew Morton
2005-09-15 22:22                                 ` Badari Pulavarty
2005-09-15 21:03                             ` Andrea Arcangeli
2005-09-15 21:26                               ` Andrew Morton
2005-09-15 22:04                                 ` Andrea Arcangeli
2005-09-15 23:28                                   ` Mingming Cao
2005-09-16  0:18                                     ` Andrea Arcangeli
2005-09-13 17:53       ` Mingming Cao
2005-09-16 13:42       ` Stephen C. Tweedie
2005-09-21 18:22         ` Mingming Cao

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).