aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-06-29 13:31:24 +0200
committerGitHub <noreply@github.com>2020-06-29 13:31:24 +0200
commit64232f3ea6a0e6dbbb157d3e435c1b2b8fb05143 (patch)
treec890148ffa9f651e608082158182106e490f5096 /src/libstore
parent3fcbe30eea1c7a9ea7c2431fcb68b7fdff0dcf0e (diff)
parent3a642187c33ed46d952d3a50a83b2576b704fab7 (diff)
Merge pull request #3749 from rodarima/master
Fall back to copyPath if link fails with EPERM
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 0c25897f8..9ac5fd923 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1950,8 +1950,11 @@ void linkOrCopy(const Path & from, const Path & to)
/* Hard-linking fails if we exceed the maximum link count on a
file (e.g. 32000 of ext3), which is quite possible after a
'nix-store --optimise'. FIXME: actually, why don't we just
- bind-mount in this case? */
- if (errno != EMLINK)
+ bind-mount in this case?
+
+ 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);
copyPath(from, to);
}