From 2353c5c821cf85312bad2e3724e9ad77078498e5 Mon Sep 17 00:00:00 2001 From: Constantin Belyaev Date: Fri, 14 Sep 2018 10:12:30 -0700 Subject: [PATCH] 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 --- port/win/env_win.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/port/win/env_win.cc b/port/win/env_win.cc index 34b3de788..723a273f0 100644 --- a/port/win/env_win.cc +++ b/port/win/env_win.cc @@ -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);