Fix cross-filesystem checkpoint on Windows (#4365)

Summary:
Now port/win_env.cc do check error for cross device link creation.
Fixes #4364
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4365

Differential Revision: D9833144

Pulled By: ajkr

fbshipit-source-id: be7555e510f4b8d2196d843841606a6cfada7644
This commit is contained in:
Constantin Belyaev 2018-09-14 10:12:30 -07:00 committed by Facebook Github Bot
parent c94523ee56
commit 2353c5c821
1 changed files with 3 additions and 0 deletions

View File

@ -706,6 +706,9 @@ Status WinEnvIO::LinkFile(const std::string& src,
if (!CreateHardLinkA(target.c_str(), src.c_str(), NULL)) {
DWORD lastError = GetLastError();
if (lastError == ERROR_NOT_SAME_DEVICE) {
return Status::NotSupported("No cross FS links allowed");
}
std::string text("Failed to link: ");
text.append(src).append(" to: ").append(target);