>> The test below creates a sparse file and then fills a hole with
>> O_DIRECT.  As far as I can tell from reading generic_osync_inode, the
>> filesystem metadata is only forced to disk if i_size changes during the
>> file write.  I've tested ext3, xfs and reiserfs and they all skip the
>> commit when filling holes.
>> 
>> I would argue that filling holes via O_DIRECT is supposed to commit the
>> metadata required to find those file blocks later.  At least on ext3,
>> O_SYNC does force a commit on fill holes  (haven't tested others).
>> 

>I don't think it's a bug.  Sure, O_DIRECT is synchronous, but that's
>because it is, err, direct.  Not because it provides extra data-integrity
>guarantees.  If you want those guarantees, use O_SYNC as well.

That makes sense, but how do you explain the committing of the size change 
without O_SYNC?  That seems wrong to me.

This does need to be documented carefully, because a person could easily 
believe, even subconsciously,  that O_DIRECT makes the entire file write 
direct, and sloppy documentation might actually use words to that effect.

--
Bryan Henderson                     IBM Almaden Research Center
San Jose CA                         Filesystems

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to