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
main
anand76 2 years ago committed by Facebook GitHub Bot
parent dab19afe56
commit 7574841aac
  1. 6
      env/fs_posix.cc

6
env/fs_posix.cc vendored

@ -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);
}

Loading…
Cancel
Save