Jan, Laurynas,
Thank you both for your helpful answers. The general question I have is that do we need to call fsync to guarantee a dirty page is written to persistent storage before it's removed from the flush list, and how would this affect the recovery process? Based on the code, looks like it does not call fsync before buf_flush_write_complete is called. So I guess not calling fsync will not affect recovery process. But I also saw fsync is called after synchronous IOs. So I am confused about if we should call fsync or not after flushing a dirty page in order to not break recovery. Thanks.
Xiaofei