mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
daemon: Do not error out when deduplication fails due to ENOSPC.
This solves a problem whereby if /gnu/store/.links had enough entries, ext4's directory index would be full, leading to link(2) returning ENOSPC. * nix/libstore/optimise-store.cc (LocalStore::optimisePath_): Upon ENOSPC from link(2), print a message and return instead of throwing a 'SysError'.
This commit is contained in:
parent
b1fd0ab734
commit
12b6c951cf
1 changed files with 18 additions and 5 deletions
|
@ -148,10 +148,23 @@ void LocalStore::optimisePath_(OptimiseStats & stats, const Path & path, InodeHa
|
|||
inodeHash.insert(st.st_ino);
|
||||
return;
|
||||
}
|
||||
if (errno != EEXIST)
|
||||
throw SysError(format("cannot link `%1%' to `%2%'") % linkPath % path);
|
||||
|
||||
switch (errno) {
|
||||
case EEXIST:
|
||||
/* Fall through if another process created ‘linkPath’ before
|
||||
we did. */
|
||||
break;
|
||||
|
||||
case ENOSPC:
|
||||
/* On ext4, that probably means the directory index is full. When
|
||||
that happens, it's fine to ignore it: we just effectively
|
||||
disable deduplication of this file. */
|
||||
printMsg(lvlInfo, format("cannot link `%1%' to `%2%': %m") % linkPath % path);
|
||||
return;
|
||||
|
||||
default:
|
||||
throw SysError(format("cannot link `%1%' to `%2%'") % linkPath % path);
|
||||
}
|
||||
}
|
||||
|
||||
/* Yes! We've seen a file with the same contents. Replace the
|
||||
|
|
Loading…
Reference in a new issue