linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question on delalloc
@ 2013-06-03 19:00 宋柏翰
  2013-06-04  5:22 ` Theodore Ts'o
  2013-06-04 14:26 ` Eric Sandeen
  0 siblings, 2 replies; 5+ messages in thread
From: 宋柏翰 @ 2013-06-03 19:00 UTC (permalink / raw)
  To: linux-ext4

Hi everybody,

I am new to ext4 and doing research on Android with ext4 as file
system. These days, I have a question on ext4's delayed allocation
against ext4_sync_file.
I have learned that delalloc won't guarantee file data's integrity on
power failure, since those delayed allocated buffer heads won't be
handled by jbd2. In order to protect data, user programs need to fsync
those files to be secured.
But I have no idea on how ext4_sync_file would write those delalloc'd
data down to disk.
This is how I traced it.
In ext4_sync_file, I split it into roughly three parts where I think
possible to do IOs:
1. filemap_write_and_wait_range
2. ext4_flush_completed_IO
3. ext4_force_commit or jbd2_log_start_commit

Since we know that jbd2 don't play with those delalloc'd data, part 3
can be excluded.
Also after I traced into filemap_write_and_wait_range, I found it
eventually calls ext4_writepage to do the most part of work, which in
its comment says "We don't do any block allocation in this function."
And it will redirty page and do nothing whenever it find those pages
have delay or unwritten buffer heads.
Last, I found ext4_flush_completed_IO won't do anything for most of
the time list_empty(&ei->i_completed_io_list) holds.

So, can anyone kindly shed any light on my question, or point out my mistakes?

thanks,

Sung Po-Han

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

end of thread, other threads:[~2013-06-04 19:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-03 19:00 Question on delalloc 宋柏翰
2013-06-04  5:22 ` Theodore Ts'o
2013-06-04 14:26 ` Eric Sandeen
2013-06-04 17:30   ` 宋柏翰
2013-06-04 19:01     ` Theodore Ts'o

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