mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-28 15:22:18 -05:00
daemon: Handle EXDEV when moving to trash directory.
Fixes <https://bugs.gnu.org/41607>. Reported by Stephen Scheck <singularsyntax@gmail.com>. * nix/libstore/gc.cc (LocalStore::deletePathRecursive): When we try to move a dead directory into the trashDir using rename(2) but it returns an EXDEV error, just delete the directory instead. This can happen in a Docker container when the directory is not on the "top layer".
This commit is contained in:
parent
c39693d760
commit
d445c30ea6
1 changed files with 4 additions and 1 deletions
|
@ -455,7 +455,10 @@ void LocalStore::deletePathRecursive(GCState & state, const Path & path)
|
||||||
throw SysError(format("unable to rename `%1%' to `%2%'") % path % tmp);
|
throw SysError(format("unable to rename `%1%' to `%2%'") % path % tmp);
|
||||||
state.bytesInvalidated += size;
|
state.bytesInvalidated += size;
|
||||||
} catch (SysError & e) {
|
} catch (SysError & e) {
|
||||||
if (e.errNo == ENOSPC) {
|
/* In a Docker container, rename(2) returns EXDEV when the source
|
||||||
|
and destination are not both on the "top layer". See:
|
||||||
|
https://bugs.gnu.org/41607 */
|
||||||
|
if (e.errNo == ENOSPC || e.errNo == EXDEV) {
|
||||||
printMsg(lvlInfo, format("note: can't create move `%1%': %2%") % path % e.msg());
|
printMsg(lvlInfo, format("note: can't create move `%1%': %2%") % path % e.msg());
|
||||||
deleteGarbage(state, path);
|
deleteGarbage(state, path);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue