Question on delalloc

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

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux