ext4: handle unwritten or delalloc buffers before enabling per-file data journaling
Thank you, Jan.
Quoted 10 lines
Can we maybe rephrase the whole comment like:
/*
* Before flushing the journal and switching inode's aops, we have
* to flush all dirty data the inode has. There can be outstanding
* delayed allocations, there can be unwritten extents created by
* fallocate or buffered writes indioread_nolockmode covered by
* dirty data which can be converted only after flushing the dirty
* data (and journalled aops don't know how to handle these cases). */
Your comment is more understandable, so I will change the comment in the patch.
Quoted 5 lines
BTW, the code is still racy wrt mmap write faults. Once Ted merges my patches for hole punching races, we need to grab
i_mmap_semfor writing here as well to avoid write page fault from creating dirty page while we are switching aops... I'm mostly writing this here so that there's lower chance this gets lost.
Ok. I've recognized another racy condition when switching aops of an inode. I will also consider the point in v2 of this patch.