linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mulyadi Santosa <mulyadi.santosa@gmail.com>
To: Joel Fernandes <agnel.joel@gmail.com>
Cc: linux-fsdevel@vger.kernel.org,
	kernelnewbies <kernelnewbies@nl.linux.org>
Subject: Re: ext3 writing of data before metadata in ordered mode
Date: Mon, 26 Oct 2009 11:40:39 +0700	[thread overview]
Message-ID: <f284c33d0910252140r648e1dd6q326a0db1e6b8e01f@mail.gmail.com> (raw)
In-Reply-To: <9ff7a3bc0910251433k2c719989n981e3652162cafdf@mail.gmail.com>

Hi Joel...

On Mon, Oct 26, 2009 at 4:33 AM, Joel Fernandes <agnel.joel@gmail.com> wrote:
> In data=ordered mode the ext3_ordered_commit_write function marks the
> buffers as dirty, how then does the JBD ensure that the data is
> written before the metadata?  Once the data buffers are marked as
> dirty, JBD doesn't have control anymore over when the data is written
> is actually written to disk right? Because the actually writing of the
> data is handled by the page wtriteback mechanism (pdflush) right?

I am not an expert, but here's my thought:

I think writing to backing device is not done simply marking the
buffer/page cache dirty. So, I think what kernel does is first prepare
an I/O queue to update ext3 journal. Since we talk about data=ordered
here, only metadata are logged.

Perhaps the key here is, metadata writing is done as a async
completion handler of data writing handler. Thus, data is written
first, followed by metadata logging

Another possibility is composing a single atomic I/O writing request,
composed of data writing and metadata logging. Thus, I/O scheduler
won't be able to re-order the request and must complete the sequence
as we prepared.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-10-26  4:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-25 21:33 ext3 writing of data before metadata in ordered mode Joel Fernandes
2009-10-26  4:40 ` Mulyadi Santosa [this message]
2009-10-26  7:17   ` Joel Fernandes
2009-10-26 13:19 ` Josef Bacik
2009-10-26 17:21   ` Joel Fernandes
2009-10-26 17:58     ` Josef Bacik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f284c33d0910252140r648e1dd6q326a0db1e6b8e01f@mail.gmail.com \
    --to=mulyadi.santosa@gmail.com \
    --cc=agnel.joel@gmail.com \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).