You should call
fsyncon the parent directory — that is, the directory containing your file — when you need to ensure that a newly-created file is fully synchronized back to disk. In that situation, you would call
fsyncon both your file and its parent directory.
— Robert Love in response to When should you fsync the containing directory in addition to the file itself? on Quora.