forked from lix-project/lix
Fall back to copyPath if link fails with EPERM
BeeGFS doesn't allow hard-links and returns EPERM, so we fall back to copyPath. See https://github.com/NixOS/nix/issues/3748
This commit is contained in:
parent
3c50e84387
commit
3a642187c3
|
@ -1950,8 +1950,11 @@ void linkOrCopy(const Path & from, const Path & to)
|
||||||
/* Hard-linking fails if we exceed the maximum link count on a
|
/* Hard-linking fails if we exceed the maximum link count on a
|
||||||
file (e.g. 32000 of ext3), which is quite possible after a
|
file (e.g. 32000 of ext3), which is quite possible after a
|
||||||
'nix-store --optimise'. FIXME: actually, why don't we just
|
'nix-store --optimise'. FIXME: actually, why don't we just
|
||||||
bind-mount in this case? */
|
bind-mount in this case?
|
||||||
if (errno != EMLINK)
|
|
||||||
|
It can also fail with EPERM in BeegFS v7 and earlier versions
|
||||||
|
which don't allow hard-links to other directories */
|
||||||
|
if (errno != EMLINK && errno != EPERM)
|
||||||
throw SysError("linking '%s' to '%s'", to, from);
|
throw SysError("linking '%s' to '%s'", to, from);
|
||||||
copyPath(from, to);
|
copyPath(from, to);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue