diff --git a/util/env_posix.cc b/util/env_posix.cc index 86571059b..c91b68936 100644 --- a/util/env_posix.cc +++ b/util/env_posix.cc @@ -325,7 +325,7 @@ class PosixWritableFile final : public WritableFile { return status; } - return SyncFd(fd_, filename_, false); + return SyncFd(fd_, filename_); } private: @@ -360,7 +360,7 @@ class PosixWritableFile final : public WritableFile { if (fd < 0) { status = PosixError(dirname_, errno); } else { - status = SyncFd(fd, dirname_, true); + status = SyncFd(fd, dirname_); ::close(fd); } return status; @@ -372,7 +372,7 @@ class PosixWritableFile final : public WritableFile { // // The path argument is only used to populate the description string in the // returned Status if an error occurs. - static Status SyncFd(int fd, const std::string& fd_path, bool syncing_dir) { + static Status SyncFd(int fd, const std::string& fd_path) { #if HAVE_FULLFSYNC // On macOS and iOS, fsync() doesn't guarantee durability past power // failures. fcntl(F_FULLFSYNC) is required for that purpose. Some @@ -392,11 +392,6 @@ class PosixWritableFile final : public WritableFile { if (sync_success) { return Status::OK(); } - // Do not crash if filesystem can't fsync directories - // (see https://github.com/bitcoin/bitcoin/pull/10000) - if (syncing_dir && errno == EINVAL) { - return Status::OK(); - } return PosixError(fd_path, errno); }