Re: ext3 writing of data before metadata in ordered mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Joel...

On Mon, Oct 26, 2009 at 4:33 AM, Joel Fernandes <agnel.joel@xxxxxxxxx> 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 an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux