[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/07: daemon: Correctly handle EMLINK corner case when deduplicating.
From: |
guix-commits |
Subject: |
01/07: daemon: Correctly handle EMLINK corner case when deduplicating. |
Date: |
Thu, 25 Jun 2020 06:29:57 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit b930f0ba2115f71c323d4bf3d72efb763f716296
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Jun 25 10:07:09 2020 +0200
daemon: Correctly handle EMLINK corner case when deduplicating.
Suggested by Caleb Ristvedt <caleb.ristvedt@cune.org>.
* nix/libstore/optimise-store.cc (LocalStore::optimisePath_): Save errno
from 'rename' before calling 'unlink'.
---
nix/libstore/optimise-store.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/nix/libstore/optimise-store.cc b/nix/libstore/optimise-store.cc
index d8f8d23..eb303ab 100644
--- a/nix/libstore/optimise-store.cc
+++ b/nix/libstore/optimise-store.cc
@@ -215,9 +215,10 @@ void LocalStore::optimisePath_(OptimiseStats & stats,
const Path & path, InodeHa
/* Atomically replace the old file with the new hard link. */
if (rename(tempLink.c_str(), path.c_str()) == -1) {
+ int renameErrno = errno;
if (unlink(tempLink.c_str()) == -1)
printMsg(lvlError, format("unable to unlink `%1%'") % tempLink);
- if (errno == EMLINK) {
+ if (renameErrno == EMLINK) {
/* Some filesystems generate too many links on the rename,
rather than on the original link. (Probably it
temporarily increases the st_nlink field before
- branch master updated (b06ba9e -> d1a26be), guix-commits, 2020/06/25
- 01/07: daemon: Correctly handle EMLINK corner case when deduplicating.,
guix-commits <=
- 02/07: deduplication: Use 'dynamic-wind' when changing permissions of the parent., guix-commits, 2020/06/25
- 03/07: deduplication: Fix default value of #:store in 'deduplicate'., guix-commits, 2020/06/25
- 07/07: gnu: knot-resolver: Enable automatic reloading of policy files., guix-commits, 2020/06/25
- 04/07: deduplication: Leave the store permissions unchanged., guix-commits, 2020/06/25
- 05/07: gnu: Add lua-ossl., guix-commits, 2020/06/25
- 06/07: gnu: Add lua-cqueues., guix-commits, 2020/06/25