From 9f0a64c4f17653c74903cd8844f3bb4f39c9fb8a Mon Sep 17 00:00:00 2001 From: anand76 Date: Mon, 7 Mar 2022 11:39:31 -0800 Subject: [PATCH] Fix issue #9627 (#9657) Summary: SMB mounts do not support hard links. The ENOTSUP error code is returned, which should be interpreted by PosixFileSystem as IOStatus::NotSupported(). Pull Request resolved: https://github.com/facebook/rocksdb/pull/9657 Reviewed By: mrambacher Differential Revision: D34634783 Pulled By: anand1976 fbshipit-source-id: 0d57f5b2e6118e4c20e9ed1a293327428c3aecac --- env/fs_posix.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/env/fs_posix.cc b/env/fs_posix.cc index e63381066..db5319615 100644 --- a/env/fs_posix.cc +++ b/env/fs_posix.cc @@ -753,8 +753,10 @@ class PosixFileSystem : public FileSystem { const IOOptions& /*opts*/, IODebugContext* /*dbg*/) override { if (link(src.c_str(), target.c_str()) != 0) { - if (errno == EXDEV) { - return IOStatus::NotSupported("No cross FS links allowed"); + if (errno == EXDEV || errno == ENOTSUP) { + return IOStatus::NotSupported(errno == EXDEV + ? "No cross FS links allowed" + : "Links not supported by FS"); } return IOError("while link file to " + target, src, errno); }