diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 6fa75d18d30521ad4f931ad1751eedd13ac5dffb..bed8478dd1aec224999a7371e455eba58d12819f 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -2461,7 +2461,7 @@ pre_sync_fname(char *fname, bool isdir)
 
 	if (fd < 0)
 		ereport(FATAL,
-				(errmsg("could not open file \"%s\" before fsync",
+				(errmsg("could not open file \"%s\": %m",
 						fname)));
 
 	pg_flush_data(fd, 0, 0);