deduplication: Ignore EMLINK.

Until now 'guix offload' would fail (transient failure) upon EMLINK.

* guix/store/deduplication.scm (replace-with-link)
(deduplicate): Ignore EMLINK.
This commit is contained in:
Ludovic Courtès 2019-01-23 22:27:29 +01:00
parent 1d209d06ed
commit ba5e89be8c
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Caleb Ristvedt <caleb.ristvedt@cune.org> ;;; Copyright © 2017 Caleb Ristvedt <caleb.ristvedt@cune.org>
;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -109,8 +109,9 @@ Note: TARGET, TO-REPLACE, and SWAP-DIRECTORY must be on the same file system."
(get-temp-link target swap-directory)) (get-temp-link target swap-directory))
(lambda args (lambda args
;; We get ENOSPC when we can't fit an additional entry in ;; We get ENOSPC when we can't fit an additional entry in
;; SWAP-DIRECTORY. ;; SWAP-DIRECTORY. If it's EMLINK, then TARGET has reached its
(if (= ENOSPC (system-error-errno args)) ;; maximum number of links.
(if (memv (system-error-errno args) `(,ENOSPC ,EMLINK))
#f #f
(apply throw args))))) (apply throw args)))))
@ -169,4 +170,8 @@ under STORE."
;; more entries in .links, but that's fine: we can ;; more entries in .links, but that's fine: we can
;; just stop. ;; just stop.
#f) #f)
((= errno EMLINK)
;; PATH has reached the maximum number of links, but
;; that's OK: we just can't deduplicate it more.
#f)
(else (apply throw args)))))))))) (else (apply throw args))))))))))