Hard-linking across directories

Hello,

We’ve been running EOS for user homes and have been very happy with it. We’re now looking into moving some other workloads to it.

One of those workloads is a data ingestion process which goes like this:

  • ingester downloads a file and puts it into a common folder, or user puts a file manually there
  • other apps watch said directory, grab newly created files and store them in their own storage if needed, by hardlinking them to avoid slow copies and unnecessary use of space, and notify the ingester that they’re done
  • the ingester waits for all apps to grab the file and then deletes the copy from the common folder

Trying this on EOS, we run into a Invalid cross-device link (EXDEV) error, which I’m assuming is there for permission reasons.

We think the code throwing that error is fusex/eosxd/eosfuse.cc · master · dss / eos · GitLab.

We previously tried this on OpenAFS, where we had user data before moving to EOS, but ran into basically the same issue.

Is there any reason that check couldn’t be removed? If so, we’re happy to run a custom build with this change, and even perhaps contribute changes to allow hardlinks across directories if some option has been set on the parent perhaps.

Thanks in advance,

Hi Marc,

EOS supports hardlinks only within the same directory, which is a similar behavior to AFS, as you’ve already discovered. One of the reasons for this limitation is that since EOS is a distributed file system, a hardlink in a different directory might reside in a different EOS instance altogether and this would mean the hardlink would need to fallback to normal copy, plus the additional complexity of keeping things in sync across different EOS backends.

Cheers,
Elvin