On Mon, May 31, 2010 at 04:43:48PM +0300, Boaz Harrosh wrote: > OK Chritoff I would need your help Please. > > It looks like what I need exactly is: > write_inode_now(inode, sync) > > But write_inode_now() has one extra hunk over generic_file_fsync: > if (sync) > inode_sync_wait(inode); It waits for I_SYNC beeing cleared, which is entirely superflous for ->fsync purposes. In fact I don't have the slightest idea what it is useful for, given that we already clear I_SYNC inside writeback_single_inode ourselves. So the only thing it causes is to wait for another code racing to step into this code just after us. > Do you think I can get in trouble calling it from ->fsync > > I don't like generic_file_fsync because it does not write my > data since I don't have buffer_heads. Then copy it. > OK, I'm totally lost what does ->fsync need to do? only write > the inode or the pages as well? The pages are written by vfs_fsync_range. You need to make sure that the inode back, or if the datasync flag is set only changes to the inode require to find that data are written back. That's basically a messy wording for you can skip dirtiness of timestamp updates if the datasync flag is set. Note that your patch below is very wrong for this, as it does a lot of asynchronous activity if the datasync flag is not set. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html