Here's a series which should fix the deadlock Jan reported in: https://lore.kernel.org/git/00af268377fb7c3b8efd059482ee7449b71f48b1.camel@xxxxxxxx/ I split it into a new thread since the problem here is distinct from the one fixed in that thread (but they're indeed the same class of problem). The fix is along the same lines as what I showed there, switching to using the tempfile API. But this has the cleanups I noted there, plus nice things like commit messages and tests. As I noted there, pack-objects is still happy to leave its internal tempfiles sitting around. I didn't tackle that in this series, since it really is orthogonal, at least in terms of implementation. I've cc'd Taylor for review. The main problem here goes all the way back to a1bbc6c017 (repack: rewrite the shell script in C, 2013-09-15), but the solution is enabled by your more recent populate_pack_ext(), etc. [1/4]: repack: convert "names" util bitfield to array [2/4]: repack: populate extension bits incrementally [3/4]: repack: use tempfiles for signal cleanup [4/4]: repack: drop remove_temporary_files() builtin/repack.c | 78 ++++++++++++++--------------------------------- t/t7700-repack.sh | 16 ++++++++++ 2 files changed, 39 insertions(+), 55 deletions(-) -Peff